From 5623c582f33c15d640d7544cc970066e3895a26d Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 26 Aug 2021 07:06:33 +0000 Subject: [PATCH] CodeGen from PR 15777 in Azure/azure-rest-api-specs Enable SDK automation for track-2 SDKs (#15777) * Add blockchain to latest profile * Add additional types * Enable SDK automation for track-2 SDKs * Revert extra changes * Revert * Revert * Revert Co-authored-by: Mark Cowlishaw --- .../Generated/CassandraResourcesOperations.cs | 5 +- .../CassandraResourcesRestOperations.cs | 43 +- .../src/Generated/CollectionOperations.cs | 5 +- .../CollectionPartitionOperations.cs | 5 +- .../CollectionPartitionRegionOperations.cs | 5 +- ...CollectionPartitionRegionRestOperations.cs | 13 +- .../CollectionPartitionRestOperations.cs | 15 +- .../Generated/CollectionRegionOperations.cs | 5 +- .../CollectionRegionRestOperations.cs | 13 +- .../src/Generated/CollectionRestOperations.cs | 17 +- .../src/Generated/CosmosDBManagementClient.cs | 25 +- .../DatabaseAccountRegionOperations.cs | 5 +- .../DatabaseAccountRegionRestOperations.cs | 13 +- .../Generated/DatabaseAccountsOperations.cs | 5 +- .../DatabaseAccountsRestOperations.cs | 47 +- .../src/Generated/DatabaseOperations.cs | 5 +- .../src/Generated/DatabaseRestOperations.cs | 17 +- .../Generated/GremlinResourcesOperations.cs | 5 +- .../GremlinResourcesRestOperations.cs | 43 +- ...ticalStorageConfiguration.Serialization.cs | 45 + .../Models/AnalyticalStorageConfiguration.cs | 28 + .../Models/AnalyticalStorageSchemaType.cs | 51 + .../src/Generated/Models/ApiType.cs | 63 ++ .../Models/BackupInformation.Serialization.cs | 34 + .../src/Generated/Models/BackupInformation.cs | 28 + .../Models/BackupPolicy.Serialization.cs | 61 ++ .../src/Generated/Models/BackupPolicy.cs | 32 + ...ackupPolicyMigrationState.Serialization.cs | 78 ++ .../Models/BackupPolicyMigrationState.cs | 38 + .../Models/BackupPolicyMigrationStatus.cs | 57 ++ .../src/Generated/Models/BackupPolicyType.cs | 51 + ...aceCreateUpdateParameters.Serialization.cs | 16 +- ...CassandraKeyspaceCreateUpdateParameters.cs | 10 +- ...paceGetPropertiesResource.Serialization.cs | 6 +- .../CassandraKeyspaceGetPropertiesResource.cs | 4 +- ...bleCreateUpdateParameters.Serialization.cs | 16 +- .../CassandraTableCreateUpdateParameters.cs | 10 +- ...ableGetPropertiesResource.Serialization.cs | 6 +- .../CassandraTableGetPropertiesResource.cs | 4 +- .../Models/CloudError.Serialization.cs | 34 + .../src/Generated/Models/CloudError.cs | 28 + ...itiesAdditionalproperties.Serialization.cs | 41 + ...rassignedidentitiesAdditionalproperties.cs | 32 + .../Models/CompositePathSortOrder.cs | 8 +- .../ContainerPartitionKey.Serialization.cs | 13 +- .../Generated/Models/ContainerPartitionKey.cs | 10 +- ...ntinuousBackupInformation.Serialization.cs | 29 + .../Models/ContinuousBackupInformation.cs | 28 + ...uousBackupRestoreLocation.Serialization.cs | 26 + .../Models/ContinuousBackupRestoreLocation.cs | 21 + ...ontinuousModeBackupPolicy.Serialization.cs | 53 + .../Models/ContinuousModeBackupPolicy.cs | 27 + .../src/Generated/Models/CreateMode.cs | 51 + .../src/Generated/Models/CreatedByType.cs | 57 ++ ...untCreateUpdateParameters.Serialization.cs | 156 ++- .../DatabaseAccountCreateUpdateParameters.cs | 41 +- ...DatabaseAccountGetResults.Serialization.cs | 173 +++- .../Models/DatabaseAccountGetResults.cs | 49 +- ...seAccountUpdateParameters.Serialization.cs | 45 + .../Models/DatabaseAccountUpdateParameters.cs | 17 +- .../DatabaseRestoreResource.Serialization.cs | 67 ++ .../Models/DatabaseRestoreResource.cs | 36 + ...xtendedResourceProperties.Serialization.cs | 6 +- .../Models/ExtendedResourceProperties.cs | 4 +- ...aseCreateUpdateParameters.Serialization.cs | 16 +- .../GremlinDatabaseCreateUpdateParameters.cs | 10 +- ...baseGetPropertiesResource.Serialization.cs | 6 +- .../GremlinDatabaseGetPropertiesResource.cs | 4 +- ...aphCreateUpdateParameters.Serialization.cs | 16 +- .../GremlinGraphCreateUpdateParameters.cs | 10 +- ...raphGetPropertiesResource.Serialization.cs | 6 +- .../GremlinGraphGetPropertiesResource.cs | 4 +- .../src/Generated/Models/IndexingMode.cs | 12 +- .../ManagedServiceIdentity.Serialization.cs | 85 ++ .../Models/ManagedServiceIdentity.cs | 44 + ...ionCreateUpdateParameters.Serialization.cs | 16 +- ...MongoDBCollectionCreateUpdateParameters.cs | 10 +- ...tionGetPropertiesResource.Serialization.cs | 6 +- .../MongoDBCollectionGetPropertiesResource.cs | 4 +- ...aseCreateUpdateParameters.Serialization.cs | 16 +- .../MongoDBDatabaseCreateUpdateParameters.cs | 10 +- ...baseGetPropertiesResource.Serialization.cs | 6 +- .../MongoDBDatabaseGetPropertiesResource.cs | 4 +- .../Models/NetworkAclBypass.Serialization.cs | 28 + .../src/Generated/Models/NetworkAclBypass.cs | 18 + .../src/Generated/Models/OperationType.cs | 57 ++ .../src/Generated/Models/PartitionKind.cs | 5 +- .../PeriodicModeBackupPolicy.Serialization.cs | 69 ++ .../Models/PeriodicModeBackupPolicy.cs | 32 + .../PeriodicModeProperties.Serialization.cs | 61 ++ .../Models/PeriodicModeProperties.cs | 32 + .../Models/Permission.Serialization.cs | 82 ++ .../src/Generated/Models/Permission.cs | 37 + ...PrivateEndpointConnection.Serialization.cs | 24 +- .../Models/PrivateEndpointConnection.cs | 14 +- ...ntConnectionAutoGenerated.Serialization.cs | 116 --- .../PrivateEndpointConnectionAutoGenerated.cs | 43 - ...pointConnectionListResult.Serialization.cs | 6 +- .../PrivateEndpointConnectionListResult.cs | 6 +- ...ceConnectionStateProperty.Serialization.cs | 13 +- ...ivateLinkServiceConnectionStateProperty.cs | 6 +- ...tatePropertyAutoGenerated.Serialization.cs | 57 -- ...iceConnectionStatePropertyAutoGenerated.cs | 36 - .../src/Generated/Models/ProxyResource.cs | 6 +- .../src/Generated/Models/Resource.cs | 10 +- .../ResourceIdentityType.Serialization.cs | 32 + .../Generated/Models/ResourceIdentityType.cs | 22 + ...eDatabaseAccountGetResult.Serialization.cs | 116 +++ .../RestorableDatabaseAccountGetResult.cs | 65 ++ ...atabaseAccountsListResult.Serialization.cs | 40 + .../RestorableDatabaseAccountsListResult.cs | 32 + ...estorableLocationResource.Serialization.cs | 58 ++ .../Models/RestorableLocationResource.cs | 42 + ...ongodbCollectionGetResult.Serialization.cs | 64 ++ .../RestorableMongodbCollectionGetResult.cs | 40 + ...lectionPropertiesResource.Serialization.cs | 58 ++ ...ableMongodbCollectionPropertiesResource.cs | 44 + ...godbCollectionsListResult.Serialization.cs | 40 + .../RestorableMongodbCollectionsListResult.cs | 32 + ...eMongodbDatabaseGetResult.Serialization.cs | 64 ++ .../RestorableMongodbDatabaseGetResult.cs | 40 + ...atabasePropertiesResource.Serialization.cs | 58 ++ ...orableMongodbDatabasePropertiesResource.cs | 44 + ...ongodbDatabasesListResult.Serialization.cs | 40 + .../RestorableMongodbDatabasesListResult.cs | 32 + ...ongodbResourcesListResult.Serialization.cs | 40 + .../RestorableMongodbResourcesListResult.cs | 32 + ...ableSqlContainerGetResult.Serialization.cs | 64 ++ .../Models/RestorableSqlContainerGetResult.cs | 40 + ...ntainerPropertiesResource.Serialization.cs | 69 ++ ...estorableSqlContainerPropertiesResource.cs | 48 + ...opertiesResourceContainer.Serialization.cs | 162 +++ ...SqlContainerPropertiesResourceContainer.cs | 55 ++ ...leSqlContainersListResult.Serialization.cs | 40 + .../RestorableSqlContainersListResult.cs | 32 + ...rableSqlDatabaseGetResult.Serialization.cs | 64 ++ .../Models/RestorableSqlDatabaseGetResult.cs | 40 + ...atabasePropertiesResource.Serialization.cs | 69 ++ ...RestorableSqlDatabasePropertiesResource.cs | 48 + ...ropertiesResourceDatabase.Serialization.cs | 78 ++ ...leSqlDatabasePropertiesResourceDatabase.cs | 63 ++ ...bleSqlDatabasesListResult.Serialization.cs | 40 + .../RestorableSqlDatabasesListResult.cs | 32 + ...bleSqlResourcesListResult.Serialization.cs | 40 + .../RestorableSqlResourcesListResult.cs | 32 + .../src/Generated/Models/RestoreMode.cs | 48 + .../Models/RestoreParameters.Serialization.cs | 100 ++ .../src/Generated/Models/RestoreParameters.cs | 45 + .../RoleDefinitionType.Serialization.cs | 28 + .../Generated/Models/RoleDefinitionType.cs | 18 + .../src/Generated/Models/ServerVersion.cs | 3 + ...nerCreateUpdateParameters.Serialization.cs | 16 +- .../SqlContainerCreateUpdateParameters.cs | 10 +- ...inerGetPropertiesResource.Serialization.cs | 6 +- .../SqlContainerGetPropertiesResource.cs | 4 +- ...aseCreateUpdateParameters.Serialization.cs | 16 +- .../SqlDatabaseCreateUpdateParameters.cs | 10 +- ...baseGetPropertiesResource.Serialization.cs | 6 +- .../SqlDatabaseGetPropertiesResource.cs | 4 +- ...entCreateUpdateParameters.Serialization.cs | 39 + ...SqlRoleAssignmentCreateUpdateParameters.cs | 25 + ...lRoleAssignmentGetResults.Serialization.cs | 95 ++ .../Models/SqlRoleAssignmentGetResults.cs | 39 + ...lRoleAssignmentListResult.Serialization.cs | 40 + .../Models/SqlRoleAssignmentListResult.cs | 32 + ...ionCreateUpdateParameters.Serialization.cs | 54 + ...SqlRoleDefinitionCreateUpdateParameters.cs | 32 + ...lRoleDefinitionGetResults.Serialization.cs | 142 +++ .../Models/SqlRoleDefinitionGetResults.cs | 48 + ...lRoleDefinitionListResult.Serialization.cs | 40 + .../Models/SqlRoleDefinitionListResult.cs | 32 + ...ureCreateUpdateParameters.Serialization.cs | 16 +- ...qlStoredProcedureCreateUpdateParameters.cs | 10 +- ...dureGetPropertiesResource.Serialization.cs | 6 +- ...SqlStoredProcedureGetPropertiesResource.cs | 4 +- ...gerCreateUpdateParameters.Serialization.cs | 16 +- .../SqlTriggerCreateUpdateParameters.cs | 10 +- ...ggerGetPropertiesResource.Serialization.cs | 6 +- .../Models/SqlTriggerGetPropertiesResource.cs | 4 +- ...ionCreateUpdateParameters.Serialization.cs | 16 +- ...erDefinedFunctionCreateUpdateParameters.cs | 10 +- ...tionGetPropertiesResource.Serialization.cs | 6 +- ...serDefinedFunctionGetPropertiesResource.cs | 4 +- .../Models/SystemData.Serialization.cs | 80 ++ .../src/Generated/Models/SystemData.cs | 50 + ...bleCreateUpdateParameters.Serialization.cs | 16 +- .../Models/TableCreateUpdateParameters.cs | 10 +- ...ableGetPropertiesResource.Serialization.cs | 6 +- .../Models/TableGetPropertiesResource.cs | 4 +- ...ingsGetPropertiesResource.Serialization.cs | 6 +- ...ThroughputSettingsGetPropertiesResource.cs | 4 +- .../Generated/MongoDBResourcesOperations.cs | 5 +- .../MongoDBResourcesRestOperations.cs | 43 +- .../Generated/NotebookWorkspacesOperations.cs | 5 +- .../NotebookWorkspacesRestOperations.cs | 25 +- .../src/Generated/Operations.cs | 5 +- .../PartitionKeyRangeIdOperations.cs | 5 +- .../PartitionKeyRangeIdRegionOperations.cs | 5 +- ...PartitionKeyRangeIdRegionRestOperations.cs | 13 +- .../PartitionKeyRangeIdRestOperations.cs | 13 +- .../src/Generated/PercentileOperations.cs | 5 +- .../src/Generated/PercentileRestOperations.cs | 13 +- .../PercentileSourceTargetOperations.cs | 5 +- .../PercentileSourceTargetRestOperations.cs | 13 +- .../Generated/PercentileTargetOperations.cs | 5 +- .../PercentileTargetRestOperations.cs | 13 +- ...pointConnectionsCreateOrUpdateOperation.cs | 20 +- .../PrivateEndpointConnectionsOperations.cs | 25 +- ...rivateEndpointConnectionsRestOperations.cs | 41 +- .../PrivateLinkResourcesOperations.cs | 5 +- .../PrivateLinkResourcesRestOperations.cs | 15 +- .../src/Generated/RestOperations.cs | 12 +- .../RestorableDatabaseAccountsOperations.cs | 183 ++++ ...estorableDatabaseAccountsRestOperations.cs | 264 +++++ .../RestorableMongodbCollectionsOperations.cs | 113 +++ ...torableMongodbCollectionsRestOperations.cs | 143 +++ .../RestorableMongodbDatabasesOperations.cs | 111 +++ ...estorableMongodbDatabasesRestOperations.cs | 137 +++ .../RestorableMongodbResourcesOperations.cs | 115 +++ ...estorableMongodbResourcesRestOperations.cs | 149 +++ .../RestorableSqlContainersOperations.cs | 117 +++ .../RestorableSqlContainersRestOperations.cs | 155 +++ .../RestorableSqlDatabasesOperations.cs | 111 +++ .../RestorableSqlDatabasesRestOperations.cs | 137 +++ .../RestorableSqlResourcesOperations.cs | 115 +++ .../RestorableSqlResourcesRestOperations.cs | 149 +++ ...sCreateUpdateSqlRoleAssignmentOperation.cs | 72 ++ ...sCreateUpdateSqlRoleDefinitionOperation.cs | 72 ++ ...sourcesDeleteSqlRoleAssignmentOperation.cs | 68 ++ ...sourcesDeleteSqlRoleDefinitionOperation.cs | 68 ++ .../src/Generated/SqlResourcesOperations.cs | 611 +++++++++++- .../Generated/SqlResourcesRestOperations.cs | 919 +++++++++++++++++- ...eveContinuousBackupInformationOperation.cs | 72 ++ .../src/Generated/TableResourcesOperations.cs | 5 +- .../Generated/TableResourcesRestOperations.cs | 27 +- .../src/autorest.md | 4 +- 236 files changed, 9741 insertions(+), 758 deletions(-) create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AnalyticalStorageConfiguration.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AnalyticalStorageConfiguration.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AnalyticalStorageSchemaType.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ApiType.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BackupInformation.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BackupInformation.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BackupPolicy.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BackupPolicy.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BackupPolicyMigrationState.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BackupPolicyMigrationState.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BackupPolicyMigrationStatus.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BackupPolicyType.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CloudError.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CloudError.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousBackupInformation.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousBackupInformation.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousBackupRestoreLocation.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousBackupRestoreLocation.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousModeBackupPolicy.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousModeBackupPolicy.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CreateMode.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CreatedByType.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseRestoreResource.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseRestoreResource.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ManagedServiceIdentity.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ManagedServiceIdentity.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkAclBypass.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkAclBypass.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/OperationType.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PeriodicModeBackupPolicy.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PeriodicModeBackupPolicy.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PeriodicModeProperties.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PeriodicModeProperties.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Permission.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Permission.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateEndpointConnectionAutoGenerated.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateEndpointConnectionAutoGenerated.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateLinkServiceConnectionStatePropertyAutoGenerated.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateLinkServiceConnectionStatePropertyAutoGenerated.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceIdentityType.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceIdentityType.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableDatabaseAccountGetResult.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableDatabaseAccountGetResult.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableDatabaseAccountsListResult.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableDatabaseAccountsListResult.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableLocationResource.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableLocationResource.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbCollectionGetResult.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbCollectionGetResult.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbCollectionPropertiesResource.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbCollectionPropertiesResource.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbCollectionsListResult.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbCollectionsListResult.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbDatabaseGetResult.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbDatabaseGetResult.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbDatabasePropertiesResource.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbDatabasePropertiesResource.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbDatabasesListResult.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbDatabasesListResult.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbResourcesListResult.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbResourcesListResult.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerGetResult.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerGetResult.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResource.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResource.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainersListResult.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainersListResult.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabaseGetResult.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabaseGetResult.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabasePropertiesResource.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabasePropertiesResource.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabasePropertiesResourceDatabase.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabasePropertiesResourceDatabase.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabasesListResult.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabasesListResult.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlResourcesListResult.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlResourcesListResult.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestoreMode.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestoreParameters.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestoreParameters.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RoleDefinitionType.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RoleDefinitionType.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleAssignmentCreateUpdateParameters.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleAssignmentCreateUpdateParameters.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleAssignmentGetResults.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleAssignmentGetResults.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleAssignmentListResult.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleAssignmentListResult.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleDefinitionCreateUpdateParameters.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleDefinitionCreateUpdateParameters.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleDefinitionGetResults.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleDefinitionGetResults.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleDefinitionListResult.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleDefinitionListResult.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SystemData.Serialization.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SystemData.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableDatabaseAccountsOperations.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableDatabaseAccountsRestOperations.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableMongodbCollectionsOperations.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableMongodbCollectionsRestOperations.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableMongodbDatabasesOperations.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableMongodbDatabasesRestOperations.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableMongodbResourcesOperations.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableMongodbResourcesRestOperations.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableSqlContainersOperations.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableSqlContainersRestOperations.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableSqlDatabasesOperations.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableSqlDatabasesRestOperations.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableSqlResourcesOperations.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableSqlResourcesRestOperations.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/SqlResourcesCreateUpdateSqlRoleAssignmentOperation.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/SqlResourcesCreateUpdateSqlRoleDefinitionOperation.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/SqlResourcesDeleteSqlRoleAssignmentOperation.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/SqlResourcesDeleteSqlRoleDefinitionOperation.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/SqlResourcesRetrieveContinuousBackupInformationOperation.cs diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraResourcesOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraResourcesOperations.cs index 8d3bff87cefc1..bf7cbed8731e4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraResourcesOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraResourcesOperations.cs @@ -32,9 +32,10 @@ protected CassandraResourcesOperations() /// The HTTP pipeline for sending and receiving REST requests and responses. /// The ID of the target subscription. /// server parameter. - internal CassandraResourcesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null) + /// Api Version. + internal CassandraResourcesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") { - RestClient = new CassandraResourcesRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint); + RestClient = new CassandraResourcesRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion); _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraResourcesRestOperations.cs index 65affea08a539..e63e8200d523f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraResourcesRestOperations.cs @@ -20,6 +20,7 @@ internal partial class CassandraResourcesRestOperations { private string subscriptionId; private Uri endpoint; + private string apiVersion; private ClientDiagnostics _clientDiagnostics; private HttpPipeline _pipeline; @@ -28,17 +29,23 @@ internal partial class CassandraResourcesRestOperations /// The HTTP pipeline for sending and receiving REST requests and responses. /// The ID of the target subscription. /// server parameter. - /// is null. - public CassandraResourcesRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null) + /// Api Version. + /// or is null. + public CassandraResourcesRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") { if (subscriptionId == null) { throw new ArgumentNullException(nameof(subscriptionId)); } endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } this.subscriptionId = subscriptionId; this.endpoint = endpoint; + this.apiVersion = apiVersion; _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } @@ -57,7 +64,7 @@ internal HttpMessage CreateListCassandraKeyspacesRequest(string resourceGroupNam uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); uri.AppendPath(accountName, true); uri.AppendPath("/cassandraKeyspaces", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -142,7 +149,7 @@ internal HttpMessage CreateGetCassandraKeyspaceRequest(string resourceGroupName, uri.AppendPath(accountName, true); uri.AppendPath("/cassandraKeyspaces/", false); uri.AppendPath(keyspaceName, true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -237,7 +244,7 @@ internal HttpMessage CreateCreateUpdateCassandraKeyspaceRequest(string resourceG uri.AppendPath(accountName, true); uri.AppendPath("/cassandraKeyspaces/", false); uri.AppendPath(keyspaceName, true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); @@ -338,7 +345,7 @@ internal HttpMessage CreateDeleteCassandraKeyspaceRequest(string resourceGroupNa uri.AppendPath(accountName, true); uri.AppendPath("/cassandraKeyspaces/", false); uri.AppendPath(keyspaceName, true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; return message; } @@ -425,7 +432,7 @@ internal HttpMessage CreateGetCassandraKeyspaceThroughputRequest(string resource uri.AppendPath("/cassandraKeyspaces/", false); uri.AppendPath(keyspaceName, true); uri.AppendPath("/throughputSettings/default", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -521,7 +528,7 @@ internal HttpMessage CreateUpdateCassandraKeyspaceThroughputRequest(string resou uri.AppendPath("/cassandraKeyspaces/", false); uri.AppendPath(keyspaceName, true); uri.AppendPath("/throughputSettings/default", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); @@ -623,7 +630,7 @@ internal HttpMessage CreateMigrateCassandraKeyspaceToAutoscaleRequest(string res uri.AppendPath("/cassandraKeyspaces/", false); uri.AppendPath(keyspaceName, true); uri.AppendPath("/throughputSettings/default/migrateToAutoscale", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -711,7 +718,7 @@ internal HttpMessage CreateMigrateCassandraKeyspaceToManualThroughputRequest(str uri.AppendPath("/cassandraKeyspaces/", false); uri.AppendPath(keyspaceName, true); uri.AppendPath("/throughputSettings/default/migrateToManualThroughput", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -799,7 +806,7 @@ internal HttpMessage CreateListCassandraTablesRequest(string resourceGroupName, uri.AppendPath("/cassandraKeyspaces/", false); uri.AppendPath(keyspaceName, true); uri.AppendPath("/tables", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -896,7 +903,7 @@ internal HttpMessage CreateGetCassandraTableRequest(string resourceGroupName, st uri.AppendPath(keyspaceName, true); uri.AppendPath("/tables/", false); uri.AppendPath(tableName, true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -1003,7 +1010,7 @@ internal HttpMessage CreateCreateUpdateCassandraTableRequest(string resourceGrou uri.AppendPath(keyspaceName, true); uri.AppendPath("/tables/", false); uri.AppendPath(tableName, true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); @@ -1116,7 +1123,7 @@ internal HttpMessage CreateDeleteCassandraTableRequest(string resourceGroupName, uri.AppendPath(keyspaceName, true); uri.AppendPath("/tables/", false); uri.AppendPath(tableName, true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; return message; } @@ -1215,7 +1222,7 @@ internal HttpMessage CreateGetCassandraTableThroughputRequest(string resourceGro uri.AppendPath("/tables/", false); uri.AppendPath(tableName, true); uri.AppendPath("/throughputSettings/default", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -1323,7 +1330,7 @@ internal HttpMessage CreateUpdateCassandraTableThroughputRequest(string resource uri.AppendPath("/tables/", false); uri.AppendPath(tableName, true); uri.AppendPath("/throughputSettings/default", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); @@ -1437,7 +1444,7 @@ internal HttpMessage CreateMigrateCassandraTableToAutoscaleRequest(string resour uri.AppendPath("/tables/", false); uri.AppendPath(tableName, true); uri.AppendPath("/throughputSettings/default/migrateToAutoscale", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -1537,7 +1544,7 @@ internal HttpMessage CreateMigrateCassandraTableToManualThroughputRequest(string uri.AppendPath("/tables/", false); uri.AppendPath(tableName, true); uri.AppendPath("/throughputSettings/default/migrateToManualThroughput", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionOperations.cs index 852c76cebd5a4..7e6ae563c7c81 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionOperations.cs @@ -32,9 +32,10 @@ protected CollectionOperations() /// The HTTP pipeline for sending and receiving REST requests and responses. /// The ID of the target subscription. /// server parameter. - internal CollectionOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null) + /// Api Version. + internal CollectionOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") { - RestClient = new CollectionRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint); + RestClient = new CollectionRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion); _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionPartitionOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionPartitionOperations.cs index 916163a39db52..e819ad3612e2a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionPartitionOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionPartitionOperations.cs @@ -32,9 +32,10 @@ protected CollectionPartitionOperations() /// The HTTP pipeline for sending and receiving REST requests and responses. /// The ID of the target subscription. /// server parameter. - internal CollectionPartitionOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null) + /// Api Version. + internal CollectionPartitionOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") { - RestClient = new CollectionPartitionRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint); + RestClient = new CollectionPartitionRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion); _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionPartitionRegionOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionPartitionRegionOperations.cs index 10e3190819f7a..c09d9fc567297 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionPartitionRegionOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionPartitionRegionOperations.cs @@ -32,9 +32,10 @@ protected CollectionPartitionRegionOperations() /// The HTTP pipeline for sending and receiving REST requests and responses. /// The ID of the target subscription. /// server parameter. - internal CollectionPartitionRegionOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null) + /// Api Version. + internal CollectionPartitionRegionOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") { - RestClient = new CollectionPartitionRegionRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint); + RestClient = new CollectionPartitionRegionRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion); _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionPartitionRegionRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionPartitionRegionRestOperations.cs index 5fdd6957566d6..6864e14e6fae7 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionPartitionRegionRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionPartitionRegionRestOperations.cs @@ -20,6 +20,7 @@ internal partial class CollectionPartitionRegionRestOperations { private string subscriptionId; private Uri endpoint; + private string apiVersion; private ClientDiagnostics _clientDiagnostics; private HttpPipeline _pipeline; @@ -28,17 +29,23 @@ internal partial class CollectionPartitionRegionRestOperations /// The HTTP pipeline for sending and receiving REST requests and responses. /// The ID of the target subscription. /// server parameter. - /// is null. - public CollectionPartitionRegionRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null) + /// Api Version. + /// or is null. + public CollectionPartitionRegionRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") { if (subscriptionId == null) { throw new ArgumentNullException(nameof(subscriptionId)); } endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } this.subscriptionId = subscriptionId; this.endpoint = endpoint; + this.apiVersion = apiVersion; _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } @@ -63,7 +70,7 @@ internal HttpMessage CreateListMetricsRequest(string resourceGroupName, string a uri.AppendPath("/collections/", false); uri.AppendPath(collectionRid, true); uri.AppendPath("/partitions/metrics", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); uri.AppendQuery("$filter", filter, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionPartitionRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionPartitionRestOperations.cs index 366fb293e0d5a..17802cbb232ce 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionPartitionRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionPartitionRestOperations.cs @@ -20,6 +20,7 @@ internal partial class CollectionPartitionRestOperations { private string subscriptionId; private Uri endpoint; + private string apiVersion; private ClientDiagnostics _clientDiagnostics; private HttpPipeline _pipeline; @@ -28,17 +29,23 @@ internal partial class CollectionPartitionRestOperations /// The HTTP pipeline for sending and receiving REST requests and responses. /// The ID of the target subscription. /// server parameter. - /// is null. - public CollectionPartitionRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null) + /// Api Version. + /// or is null. + public CollectionPartitionRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") { if (subscriptionId == null) { throw new ArgumentNullException(nameof(subscriptionId)); } endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } this.subscriptionId = subscriptionId; this.endpoint = endpoint; + this.apiVersion = apiVersion; _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } @@ -61,7 +68,7 @@ internal HttpMessage CreateListMetricsRequest(string resourceGroupName, string a uri.AppendPath("/collections/", false); uri.AppendPath(collectionRid, true); uri.AppendPath("/partitions/metrics", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); uri.AppendQuery("$filter", filter, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -180,7 +187,7 @@ internal HttpMessage CreateListUsagesRequest(string resourceGroupName, string ac uri.AppendPath("/collections/", false); uri.AppendPath(collectionRid, true); uri.AppendPath("/partitions/usages", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); if (filter != null) { uri.AppendQuery("$filter", filter, true); diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionRegionOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionRegionOperations.cs index d913d7992cc6c..15ede6c7eef2a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionRegionOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionRegionOperations.cs @@ -32,9 +32,10 @@ protected CollectionRegionOperations() /// The HTTP pipeline for sending and receiving REST requests and responses. /// The ID of the target subscription. /// server parameter. - internal CollectionRegionOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null) + /// Api Version. + internal CollectionRegionOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") { - RestClient = new CollectionRegionRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint); + RestClient = new CollectionRegionRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion); _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionRegionRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionRegionRestOperations.cs index c7d5f05ffaf8c..4996b7dbe0fe6 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionRegionRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionRegionRestOperations.cs @@ -20,6 +20,7 @@ internal partial class CollectionRegionRestOperations { private string subscriptionId; private Uri endpoint; + private string apiVersion; private ClientDiagnostics _clientDiagnostics; private HttpPipeline _pipeline; @@ -28,17 +29,23 @@ internal partial class CollectionRegionRestOperations /// The HTTP pipeline for sending and receiving REST requests and responses. /// The ID of the target subscription. /// server parameter. - /// is null. - public CollectionRegionRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null) + /// Api Version. + /// or is null. + public CollectionRegionRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") { if (subscriptionId == null) { throw new ArgumentNullException(nameof(subscriptionId)); } endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } this.subscriptionId = subscriptionId; this.endpoint = endpoint; + this.apiVersion = apiVersion; _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } @@ -63,7 +70,7 @@ internal HttpMessage CreateListMetricsRequest(string resourceGroupName, string a uri.AppendPath("/collections/", false); uri.AppendPath(collectionRid, true); uri.AppendPath("/metrics", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); uri.AppendQuery("$filter", filter, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionRestOperations.cs index b72bb74763d1c..431d2579cb3a5 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionRestOperations.cs @@ -20,6 +20,7 @@ internal partial class CollectionRestOperations { private string subscriptionId; private Uri endpoint; + private string apiVersion; private ClientDiagnostics _clientDiagnostics; private HttpPipeline _pipeline; @@ -28,17 +29,23 @@ internal partial class CollectionRestOperations /// The HTTP pipeline for sending and receiving REST requests and responses. /// The ID of the target subscription. /// server parameter. - /// is null. - public CollectionRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null) + /// Api Version. + /// or is null. + public CollectionRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") { if (subscriptionId == null) { throw new ArgumentNullException(nameof(subscriptionId)); } endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } this.subscriptionId = subscriptionId; this.endpoint = endpoint; + this.apiVersion = apiVersion; _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } @@ -61,7 +68,7 @@ internal HttpMessage CreateListMetricsRequest(string resourceGroupName, string a uri.AppendPath("/collections/", false); uri.AppendPath(collectionRid, true); uri.AppendPath("/metrics", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); uri.AppendQuery("$filter", filter, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -180,7 +187,7 @@ internal HttpMessage CreateListUsagesRequest(string resourceGroupName, string ac uri.AppendPath("/collections/", false); uri.AppendPath(collectionRid, true); uri.AppendPath("/usages", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); if (filter != null) { uri.AppendQuery("$filter", filter, true); @@ -294,7 +301,7 @@ internal HttpMessage CreateListMetricDefinitionsRequest(string resourceGroupName uri.AppendPath("/collections/", false); uri.AppendPath(collectionRid, true); uri.AppendPath("/metricDefinitions", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBManagementClient.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBManagementClient.cs index af5d2ec3251d0..249ad629c5867 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBManagementClient.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBManagementClient.cs @@ -110,10 +110,31 @@ public CosmosDBManagementClient(string subscriptionId, Uri endpoint, TokenCreden /// Returns an instance of NotebookWorkspacesOperations. public virtual NotebookWorkspacesOperations NotebookWorkspaces => new NotebookWorkspacesOperations(_clientDiagnostics, _pipeline, _subscriptionId, _endpoint); + /// Returns an instance of PrivateEndpointConnectionsOperations. + public virtual PrivateEndpointConnectionsOperations PrivateEndpointConnections => new PrivateEndpointConnectionsOperations(_clientDiagnostics, _pipeline, _subscriptionId, _endpoint); + /// Returns an instance of PrivateLinkResourcesOperations. public virtual PrivateLinkResourcesOperations PrivateLinkResources => new PrivateLinkResourcesOperations(_clientDiagnostics, _pipeline, _subscriptionId, _endpoint); - /// Returns an instance of PrivateEndpointConnectionsOperations. - public virtual PrivateEndpointConnectionsOperations PrivateEndpointConnections => new PrivateEndpointConnectionsOperations(_clientDiagnostics, _pipeline, _subscriptionId, _endpoint); + /// Returns an instance of RestorableDatabaseAccountsOperations. + public virtual RestorableDatabaseAccountsOperations RestorableDatabaseAccounts => new RestorableDatabaseAccountsOperations(_clientDiagnostics, _pipeline, _subscriptionId, _endpoint); + + /// Returns an instance of RestorableSqlDatabasesOperations. + public virtual RestorableSqlDatabasesOperations RestorableSqlDatabases => new RestorableSqlDatabasesOperations(_clientDiagnostics, _pipeline, _subscriptionId, _endpoint); + + /// Returns an instance of RestorableSqlContainersOperations. + public virtual RestorableSqlContainersOperations RestorableSqlContainers => new RestorableSqlContainersOperations(_clientDiagnostics, _pipeline, _subscriptionId, _endpoint); + + /// Returns an instance of RestorableSqlResourcesOperations. + public virtual RestorableSqlResourcesOperations RestorableSqlResources => new RestorableSqlResourcesOperations(_clientDiagnostics, _pipeline, _subscriptionId, _endpoint); + + /// Returns an instance of RestorableMongodbDatabasesOperations. + public virtual RestorableMongodbDatabasesOperations RestorableMongodbDatabases => new RestorableMongodbDatabasesOperations(_clientDiagnostics, _pipeline, _subscriptionId, _endpoint); + + /// Returns an instance of RestorableMongodbCollectionsOperations. + public virtual RestorableMongodbCollectionsOperations RestorableMongodbCollections => new RestorableMongodbCollectionsOperations(_clientDiagnostics, _pipeline, _subscriptionId, _endpoint); + + /// Returns an instance of RestorableMongodbResourcesOperations. + public virtual RestorableMongodbResourcesOperations RestorableMongodbResources => new RestorableMongodbResourcesOperations(_clientDiagnostics, _pipeline, _subscriptionId, _endpoint); } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseAccountRegionOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseAccountRegionOperations.cs index 44b309c59e0a2..0407c842ea6d8 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseAccountRegionOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseAccountRegionOperations.cs @@ -32,9 +32,10 @@ protected DatabaseAccountRegionOperations() /// The HTTP pipeline for sending and receiving REST requests and responses. /// The ID of the target subscription. /// server parameter. - internal DatabaseAccountRegionOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null) + /// Api Version. + internal DatabaseAccountRegionOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") { - RestClient = new DatabaseAccountRegionRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint); + RestClient = new DatabaseAccountRegionRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion); _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseAccountRegionRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseAccountRegionRestOperations.cs index 3cb832ca8215b..6f5ddf4227168 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseAccountRegionRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseAccountRegionRestOperations.cs @@ -20,6 +20,7 @@ internal partial class DatabaseAccountRegionRestOperations { private string subscriptionId; private Uri endpoint; + private string apiVersion; private ClientDiagnostics _clientDiagnostics; private HttpPipeline _pipeline; @@ -28,17 +29,23 @@ internal partial class DatabaseAccountRegionRestOperations /// The HTTP pipeline for sending and receiving REST requests and responses. /// The ID of the target subscription. /// server parameter. - /// is null. - public DatabaseAccountRegionRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null) + /// Api Version. + /// or is null. + public DatabaseAccountRegionRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") { if (subscriptionId == null) { throw new ArgumentNullException(nameof(subscriptionId)); } endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } this.subscriptionId = subscriptionId; this.endpoint = endpoint; + this.apiVersion = apiVersion; _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } @@ -59,7 +66,7 @@ internal HttpMessage CreateListMetricsRequest(string resourceGroupName, string a uri.AppendPath("/region/", false); uri.AppendPath(region, true); uri.AppendPath("/metrics", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); uri.AppendQuery("$filter", filter, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseAccountsOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseAccountsOperations.cs index 038b9b87d7dea..2d2b5576e6ece 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseAccountsOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseAccountsOperations.cs @@ -32,9 +32,10 @@ protected DatabaseAccountsOperations() /// The HTTP pipeline for sending and receiving REST requests and responses. /// The ID of the target subscription. /// server parameter. - internal DatabaseAccountsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null) + /// Api Version. + internal DatabaseAccountsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") { - RestClient = new DatabaseAccountsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint); + RestClient = new DatabaseAccountsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion); _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseAccountsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseAccountsRestOperations.cs index a6edc34e0c45e..78777efdd4950 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseAccountsRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseAccountsRestOperations.cs @@ -20,6 +20,7 @@ internal partial class DatabaseAccountsRestOperations { private string subscriptionId; private Uri endpoint; + private string apiVersion; private ClientDiagnostics _clientDiagnostics; private HttpPipeline _pipeline; @@ -28,17 +29,23 @@ internal partial class DatabaseAccountsRestOperations /// The HTTP pipeline for sending and receiving REST requests and responses. /// The ID of the target subscription. /// server parameter. - /// is null. - public DatabaseAccountsRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null) + /// Api Version. + /// or is null. + public DatabaseAccountsRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") { if (subscriptionId == null) { throw new ArgumentNullException(nameof(subscriptionId)); } endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } this.subscriptionId = subscriptionId; this.endpoint = endpoint; + this.apiVersion = apiVersion; _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } @@ -56,7 +63,7 @@ internal HttpMessage CreateGetRequest(string resourceGroupName, string accountNa uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); uri.AppendPath(accountName, true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -139,7 +146,7 @@ internal HttpMessage CreateUpdateRequest(string resourceGroupName, string accoun uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); uri.AppendPath(accountName, true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); @@ -226,7 +233,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, strin uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); uri.AppendPath(accountName, true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); @@ -313,7 +320,7 @@ internal HttpMessage CreateDeleteRequest(string resourceGroupName, string accoun uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); uri.AppendPath(accountName, true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; return message; } @@ -388,7 +395,7 @@ internal HttpMessage CreateFailoverPriorityChangeRequest(string resourceGroupNam uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); uri.AppendPath(accountName, true); uri.AppendPath("/failoverPriorityChange", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Content-Type", "application/json"); var content = new Utf8JsonRequestContent(); @@ -473,7 +480,7 @@ internal HttpMessage CreateListRequest() uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -531,7 +538,7 @@ internal HttpMessage CreateListByResourceGroupRequest(string resourceGroupName) uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -605,7 +612,7 @@ internal HttpMessage CreateListKeysRequest(string resourceGroupName, string acco uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); uri.AppendPath(accountName, true); uri.AppendPath("/listKeys", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -689,7 +696,7 @@ internal HttpMessage CreateListConnectionStringsRequest(string resourceGroupName uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); uri.AppendPath(accountName, true); uri.AppendPath("/listConnectionStrings", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -773,7 +780,7 @@ internal HttpMessage CreateOfflineRegionRequest(string resourceGroupName, string uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); uri.AppendPath(accountName, true); uri.AppendPath("/offlineRegion", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); @@ -863,7 +870,7 @@ internal HttpMessage CreateOnlineRegionRequest(string resourceGroupName, string uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); uri.AppendPath(accountName, true); uri.AppendPath("/onlineRegion", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); @@ -953,7 +960,7 @@ internal HttpMessage CreateGetReadOnlyKeysRequest(string resourceGroupName, stri uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); uri.AppendPath(accountName, true); uri.AppendPath("/readonlykeys", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -1037,7 +1044,7 @@ internal HttpMessage CreateListReadOnlyKeysRequest(string resourceGroupName, str uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); uri.AppendPath(accountName, true); uri.AppendPath("/readonlykeys", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -1121,7 +1128,7 @@ internal HttpMessage CreateRegenerateKeyRequest(string resourceGroupName, string uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); uri.AppendPath(accountName, true); uri.AppendPath("/regenerateKey", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Content-Type", "application/json"); var content = new Utf8JsonRequestContent(); @@ -1205,7 +1212,7 @@ internal HttpMessage CreateCheckNameExistsRequest(string accountName) uri.Reset(endpoint); uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccountNames/", false); uri.AppendPath(accountName, true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; return message; } @@ -1284,7 +1291,7 @@ internal HttpMessage CreateListMetricsRequest(string resourceGroupName, string a uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); uri.AppendPath(accountName, true); uri.AppendPath("/metrics", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); uri.AppendQuery("$filter", filter, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -1379,7 +1386,7 @@ internal HttpMessage CreateListUsagesRequest(string resourceGroupName, string ac uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); uri.AppendPath(accountName, true); uri.AppendPath("/usages", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); if (filter != null) { uri.AppendQuery("$filter", filter, true); @@ -1469,7 +1476,7 @@ internal HttpMessage CreateListMetricDefinitionsRequest(string resourceGroupName uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); uri.AppendPath(accountName, true); uri.AppendPath("/metricDefinitions", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseOperations.cs index b903935f3b70b..da4d63783a936 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseOperations.cs @@ -32,9 +32,10 @@ protected DatabaseOperations() /// The HTTP pipeline for sending and receiving REST requests and responses. /// The ID of the target subscription. /// server parameter. - internal DatabaseOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null) + /// Api Version. + internal DatabaseOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") { - RestClient = new DatabaseRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint); + RestClient = new DatabaseRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion); _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseRestOperations.cs index 555673f2c5d15..dea449d3a0d38 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseRestOperations.cs @@ -20,6 +20,7 @@ internal partial class DatabaseRestOperations { private string subscriptionId; private Uri endpoint; + private string apiVersion; private ClientDiagnostics _clientDiagnostics; private HttpPipeline _pipeline; @@ -28,17 +29,23 @@ internal partial class DatabaseRestOperations /// The HTTP pipeline for sending and receiving REST requests and responses. /// The ID of the target subscription. /// server parameter. - /// is null. - public DatabaseRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null) + /// Api Version. + /// or is null. + public DatabaseRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") { if (subscriptionId == null) { throw new ArgumentNullException(nameof(subscriptionId)); } endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } this.subscriptionId = subscriptionId; this.endpoint = endpoint; + this.apiVersion = apiVersion; _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } @@ -59,7 +66,7 @@ internal HttpMessage CreateListMetricsRequest(string resourceGroupName, string a uri.AppendPath("/databases/", false); uri.AppendPath(databaseRid, true); uri.AppendPath("/metrics", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); uri.AppendQuery("$filter", filter, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -166,7 +173,7 @@ internal HttpMessage CreateListUsagesRequest(string resourceGroupName, string ac uri.AppendPath("/databases/", false); uri.AppendPath(databaseRid, true); uri.AppendPath("/usages", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); if (filter != null) { uri.AppendQuery("$filter", filter, true); @@ -268,7 +275,7 @@ internal HttpMessage CreateListMetricDefinitionsRequest(string resourceGroupName uri.AppendPath("/databases/", false); uri.AppendPath(databaseRid, true); uri.AppendPath("/metricDefinitions", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinResourcesOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinResourcesOperations.cs index 0e382d0ebe0c0..8627f6aefd59a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinResourcesOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinResourcesOperations.cs @@ -32,9 +32,10 @@ protected GremlinResourcesOperations() /// The HTTP pipeline for sending and receiving REST requests and responses. /// The ID of the target subscription. /// server parameter. - internal GremlinResourcesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null) + /// Api Version. + internal GremlinResourcesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") { - RestClient = new GremlinResourcesRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint); + RestClient = new GremlinResourcesRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion); _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinResourcesRestOperations.cs index 1ac354e16c055..97f47a4e00788 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinResourcesRestOperations.cs @@ -20,6 +20,7 @@ internal partial class GremlinResourcesRestOperations { private string subscriptionId; private Uri endpoint; + private string apiVersion; private ClientDiagnostics _clientDiagnostics; private HttpPipeline _pipeline; @@ -28,17 +29,23 @@ internal partial class GremlinResourcesRestOperations /// The HTTP pipeline for sending and receiving REST requests and responses. /// The ID of the target subscription. /// server parameter. - /// is null. - public GremlinResourcesRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null) + /// Api Version. + /// or is null. + public GremlinResourcesRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") { if (subscriptionId == null) { throw new ArgumentNullException(nameof(subscriptionId)); } endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } this.subscriptionId = subscriptionId; this.endpoint = endpoint; + this.apiVersion = apiVersion; _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } @@ -57,7 +64,7 @@ internal HttpMessage CreateListGremlinDatabasesRequest(string resourceGroupName, uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); uri.AppendPath(accountName, true); uri.AppendPath("/gremlinDatabases", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -142,7 +149,7 @@ internal HttpMessage CreateGetGremlinDatabaseRequest(string resourceGroupName, s uri.AppendPath(accountName, true); uri.AppendPath("/gremlinDatabases/", false); uri.AppendPath(databaseName, true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -237,7 +244,7 @@ internal HttpMessage CreateCreateUpdateGremlinDatabaseRequest(string resourceGro uri.AppendPath(accountName, true); uri.AppendPath("/gremlinDatabases/", false); uri.AppendPath(databaseName, true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); @@ -338,7 +345,7 @@ internal HttpMessage CreateDeleteGremlinDatabaseRequest(string resourceGroupName uri.AppendPath(accountName, true); uri.AppendPath("/gremlinDatabases/", false); uri.AppendPath(databaseName, true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; return message; } @@ -425,7 +432,7 @@ internal HttpMessage CreateGetGremlinDatabaseThroughputRequest(string resourceGr uri.AppendPath("/gremlinDatabases/", false); uri.AppendPath(databaseName, true); uri.AppendPath("/throughputSettings/default", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -521,7 +528,7 @@ internal HttpMessage CreateUpdateGremlinDatabaseThroughputRequest(string resourc uri.AppendPath("/gremlinDatabases/", false); uri.AppendPath(databaseName, true); uri.AppendPath("/throughputSettings/default", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); @@ -623,7 +630,7 @@ internal HttpMessage CreateMigrateGremlinDatabaseToAutoscaleRequest(string resou uri.AppendPath("/gremlinDatabases/", false); uri.AppendPath(databaseName, true); uri.AppendPath("/throughputSettings/default/migrateToAutoscale", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -711,7 +718,7 @@ internal HttpMessage CreateMigrateGremlinDatabaseToManualThroughputRequest(strin uri.AppendPath("/gremlinDatabases/", false); uri.AppendPath(databaseName, true); uri.AppendPath("/throughputSettings/default/migrateToManualThroughput", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -799,7 +806,7 @@ internal HttpMessage CreateListGremlinGraphsRequest(string resourceGroupName, st uri.AppendPath("/gremlinDatabases/", false); uri.AppendPath(databaseName, true); uri.AppendPath("/graphs", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -896,7 +903,7 @@ internal HttpMessage CreateGetGremlinGraphRequest(string resourceGroupName, stri uri.AppendPath(databaseName, true); uri.AppendPath("/graphs/", false); uri.AppendPath(graphName, true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -1003,7 +1010,7 @@ internal HttpMessage CreateCreateUpdateGremlinGraphRequest(string resourceGroupN uri.AppendPath(databaseName, true); uri.AppendPath("/graphs/", false); uri.AppendPath(graphName, true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); @@ -1116,7 +1123,7 @@ internal HttpMessage CreateDeleteGremlinGraphRequest(string resourceGroupName, s uri.AppendPath(databaseName, true); uri.AppendPath("/graphs/", false); uri.AppendPath(graphName, true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; return message; } @@ -1215,7 +1222,7 @@ internal HttpMessage CreateGetGremlinGraphThroughputRequest(string resourceGroup uri.AppendPath("/graphs/", false); uri.AppendPath(graphName, true); uri.AppendPath("/throughputSettings/default", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -1323,7 +1330,7 @@ internal HttpMessage CreateUpdateGremlinGraphThroughputRequest(string resourceGr uri.AppendPath("/graphs/", false); uri.AppendPath(graphName, true); uri.AppendPath("/throughputSettings/default", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); @@ -1437,7 +1444,7 @@ internal HttpMessage CreateMigrateGremlinGraphToAutoscaleRequest(string resource uri.AppendPath("/graphs/", false); uri.AppendPath(graphName, true); uri.AppendPath("/throughputSettings/default/migrateToAutoscale", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -1537,7 +1544,7 @@ internal HttpMessage CreateMigrateGremlinGraphToManualThroughputRequest(string r uri.AppendPath("/graphs/", false); uri.AppendPath(graphName, true); uri.AppendPath("/throughputSettings/default/migrateToManualThroughput", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AnalyticalStorageConfiguration.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AnalyticalStorageConfiguration.Serialization.cs new file mode 100644 index 0000000000000..6c3efac0ffd1e --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AnalyticalStorageConfiguration.Serialization.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class AnalyticalStorageConfiguration : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(SchemaType)) + { + writer.WritePropertyName("schemaType"); + writer.WriteStringValue(SchemaType.Value.ToString()); + } + writer.WriteEndObject(); + } + + internal static AnalyticalStorageConfiguration DeserializeAnalyticalStorageConfiguration(JsonElement element) + { + Optional schemaType = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("schemaType")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + schemaType = new AnalyticalStorageSchemaType(property.Value.GetString()); + continue; + } + } + return new AnalyticalStorageConfiguration(Optional.ToNullable(schemaType)); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AnalyticalStorageConfiguration.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AnalyticalStorageConfiguration.cs new file mode 100644 index 0000000000000..849b159fa6eed --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AnalyticalStorageConfiguration.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// Analytical storage specific properties. + public partial class AnalyticalStorageConfiguration + { + /// Initializes a new instance of AnalyticalStorageConfiguration. + public AnalyticalStorageConfiguration() + { + } + + /// Initializes a new instance of AnalyticalStorageConfiguration. + /// Describes the types of schema for analytical storage. + internal AnalyticalStorageConfiguration(AnalyticalStorageSchemaType? schemaType) + { + SchemaType = schemaType; + } + + /// Describes the types of schema for analytical storage. + public AnalyticalStorageSchemaType? SchemaType { get; set; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AnalyticalStorageSchemaType.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AnalyticalStorageSchemaType.cs new file mode 100644 index 0000000000000..064913eb22308 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AnalyticalStorageSchemaType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// Describes the types of schema for analytical storage. + public readonly partial struct AnalyticalStorageSchemaType : IEquatable + { + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public AnalyticalStorageSchemaType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string WellDefinedValue = "WellDefined"; + private const string FullFidelityValue = "FullFidelity"; + + /// WellDefined. + public static AnalyticalStorageSchemaType WellDefined { get; } = new AnalyticalStorageSchemaType(WellDefinedValue); + /// FullFidelity. + public static AnalyticalStorageSchemaType FullFidelity { get; } = new AnalyticalStorageSchemaType(FullFidelityValue); + /// Determines if two values are the same. + public static bool operator ==(AnalyticalStorageSchemaType left, AnalyticalStorageSchemaType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AnalyticalStorageSchemaType left, AnalyticalStorageSchemaType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator AnalyticalStorageSchemaType(string value) => new AnalyticalStorageSchemaType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AnalyticalStorageSchemaType other && Equals(other); + /// + public bool Equals(AnalyticalStorageSchemaType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ApiType.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ApiType.cs new file mode 100644 index 0000000000000..459df83fd36a4 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ApiType.cs @@ -0,0 +1,63 @@ +// 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 the API type of the restorable database account. + public readonly partial struct ApiType : IEquatable + { + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public ApiType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string MongoDBValue = "MongoDB"; + private const string GremlinValue = "Gremlin"; + private const string CassandraValue = "Cassandra"; + private const string TableValue = "Table"; + private const string SqlValue = "Sql"; + private const string GremlinV2Value = "GremlinV2"; + + /// MongoDB. + public static ApiType MongoDB { get; } = new ApiType(MongoDBValue); + /// Gremlin. + public static ApiType Gremlin { get; } = new ApiType(GremlinValue); + /// Cassandra. + public static ApiType Cassandra { get; } = new ApiType(CassandraValue); + /// Table. + public static ApiType Table { get; } = new ApiType(TableValue); + /// Sql. + public static ApiType Sql { get; } = new ApiType(SqlValue); + /// GremlinV2. + public static ApiType GremlinV2 { get; } = new ApiType(GremlinV2Value); + /// Determines if two values are the same. + public static bool operator ==(ApiType left, ApiType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ApiType left, ApiType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ApiType(string value) => new ApiType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ApiType other && Equals(other); + /// + public bool Equals(ApiType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BackupInformation.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BackupInformation.Serialization.cs new file mode 100644 index 0000000000000..e8de59cd7371c --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BackupInformation.Serialization.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class BackupInformation + { + internal static BackupInformation DeserializeBackupInformation(JsonElement element) + { + Optional continuousBackupInformation = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("continuousBackupInformation")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + continuousBackupInformation = ContinuousBackupInformation.DeserializeContinuousBackupInformation(property.Value); + continue; + } + } + return new BackupInformation(continuousBackupInformation.Value); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BackupInformation.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BackupInformation.cs new file mode 100644 index 0000000000000..6ac0e4f7c71a2 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BackupInformation.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// Backup information of a resource. + public partial class BackupInformation + { + /// Initializes a new instance of BackupInformation. + internal BackupInformation() + { + } + + /// Initializes a new instance of BackupInformation. + /// Information about the status of continuous backups. + internal BackupInformation(ContinuousBackupInformation continuousBackupInformation) + { + ContinuousBackupInformation = continuousBackupInformation; + } + + /// Information about the status of continuous backups. + public ContinuousBackupInformation ContinuousBackupInformation { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BackupPolicy.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BackupPolicy.Serialization.cs new file mode 100644 index 0000000000000..aa60f1beb12dd --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BackupPolicy.Serialization.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class BackupPolicy : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("type"); + writer.WriteStringValue(Type.ToString()); + if (Optional.IsDefined(MigrationState)) + { + writer.WritePropertyName("migrationState"); + writer.WriteObjectValue(MigrationState); + } + writer.WriteEndObject(); + } + + internal static BackupPolicy DeserializeBackupPolicy(JsonElement element) + { + if (element.TryGetProperty("type", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "Continuous": return ContinuousModeBackupPolicy.DeserializeContinuousModeBackupPolicy(element); + case "Periodic": return PeriodicModeBackupPolicy.DeserializePeriodicModeBackupPolicy(element); + } + } + BackupPolicyType type = default; + Optional migrationState = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type")) + { + type = new BackupPolicyType(property.Value.GetString()); + continue; + } + if (property.NameEquals("migrationState")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + migrationState = BackupPolicyMigrationState.DeserializeBackupPolicyMigrationState(property.Value); + continue; + } + } + return new BackupPolicy(type, migrationState.Value); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BackupPolicy.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BackupPolicy.cs new file mode 100644 index 0000000000000..2d356dcbc3c9f --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BackupPolicy.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The object representing the policy for taking backups on an account. + public partial class BackupPolicy + { + /// Initializes a new instance of BackupPolicy. + public BackupPolicy() + { + } + + /// Initializes a new instance of BackupPolicy. + /// Describes the mode of backups. + /// The object representing the state of the migration between the backup policies. + internal BackupPolicy(BackupPolicyType type, BackupPolicyMigrationState migrationState) + { + Type = type; + MigrationState = migrationState; + } + + /// Describes the mode of backups. + internal BackupPolicyType Type { get; set; } + /// The object representing the state of the migration between the backup policies. + public BackupPolicyMigrationState MigrationState { get; set; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BackupPolicyMigrationState.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BackupPolicyMigrationState.Serialization.cs new file mode 100644 index 0000000000000..b0c4d01981c43 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BackupPolicyMigrationState.Serialization.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class BackupPolicyMigrationState : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"); + writer.WriteStringValue(Status.Value.ToString()); + } + if (Optional.IsDefined(TargetType)) + { + writer.WritePropertyName("targetType"); + writer.WriteStringValue(TargetType.Value.ToString()); + } + if (Optional.IsDefined(StartTime)) + { + writer.WritePropertyName("startTime"); + writer.WriteStringValue(StartTime.Value, "O"); + } + writer.WriteEndObject(); + } + + internal static BackupPolicyMigrationState DeserializeBackupPolicyMigrationState(JsonElement element) + { + Optional status = default; + Optional targetType = default; + Optional startTime = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("status")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + status = new BackupPolicyMigrationStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetType")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + targetType = new BackupPolicyType(property.Value.GetString()); + continue; + } + if (property.NameEquals("startTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + } + return new BackupPolicyMigrationState(Optional.ToNullable(status), Optional.ToNullable(targetType), Optional.ToNullable(startTime)); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BackupPolicyMigrationState.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BackupPolicyMigrationState.cs new file mode 100644 index 0000000000000..41896bd4b70b0 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BackupPolicyMigrationState.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The object representing the state of the migration between the backup policies. + public partial class BackupPolicyMigrationState + { + /// Initializes a new instance of BackupPolicyMigrationState. + public BackupPolicyMigrationState() + { + } + + /// Initializes a new instance of BackupPolicyMigrationState. + /// Describes the status of migration between backup policy types. + /// Describes the target backup policy type of the backup policy migration. + /// Time at which the backup policy migration started (ISO-8601 format). + internal BackupPolicyMigrationState(BackupPolicyMigrationStatus? status, BackupPolicyType? targetType, DateTimeOffset? startTime) + { + Status = status; + TargetType = targetType; + StartTime = startTime; + } + + /// Describes the status of migration between backup policy types. + public BackupPolicyMigrationStatus? Status { get; set; } + /// Describes the target backup policy type of the backup policy migration. + public BackupPolicyType? TargetType { get; set; } + /// Time at which the backup policy migration started (ISO-8601 format). + public DateTimeOffset? StartTime { get; set; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BackupPolicyMigrationStatus.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BackupPolicyMigrationStatus.cs new file mode 100644 index 0000000000000..2854a78ea13bd --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BackupPolicyMigrationStatus.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// Describes the status of migration between backup policy types. + public readonly partial struct BackupPolicyMigrationStatus : IEquatable + { + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public BackupPolicyMigrationStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InvalidValue = "Invalid"; + private const string InProgressValue = "InProgress"; + private const string CompletedValue = "Completed"; + private const string FailedValue = "Failed"; + + /// Invalid. + public static BackupPolicyMigrationStatus Invalid { get; } = new BackupPolicyMigrationStatus(InvalidValue); + /// InProgress. + public static BackupPolicyMigrationStatus InProgress { get; } = new BackupPolicyMigrationStatus(InProgressValue); + /// Completed. + public static BackupPolicyMigrationStatus Completed { get; } = new BackupPolicyMigrationStatus(CompletedValue); + /// Failed. + public static BackupPolicyMigrationStatus Failed { get; } = new BackupPolicyMigrationStatus(FailedValue); + /// Determines if two values are the same. + public static bool operator ==(BackupPolicyMigrationStatus left, BackupPolicyMigrationStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(BackupPolicyMigrationStatus left, BackupPolicyMigrationStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator BackupPolicyMigrationStatus(string value) => new BackupPolicyMigrationStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is BackupPolicyMigrationStatus other && Equals(other); + /// + public bool Equals(BackupPolicyMigrationStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BackupPolicyType.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BackupPolicyType.cs new file mode 100644 index 0000000000000..7c6e827707be7 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BackupPolicyType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// Describes the mode of backups. + public readonly partial struct BackupPolicyType : IEquatable + { + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public BackupPolicyType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PeriodicValue = "Periodic"; + private const string ContinuousValue = "Continuous"; + + /// Periodic. + public static BackupPolicyType Periodic { get; } = new BackupPolicyType(PeriodicValue); + /// Continuous. + public static BackupPolicyType Continuous { get; } = new BackupPolicyType(ContinuousValue); + /// Determines if two values are the same. + public static bool operator ==(BackupPolicyType left, BackupPolicyType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(BackupPolicyType left, BackupPolicyType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator BackupPolicyType(string value) => new BackupPolicyType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is BackupPolicyType other && Equals(other); + /// + public bool Equals(BackupPolicyType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceCreateUpdateParameters.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceCreateUpdateParameters.Serialization.cs index b786a3e2ebd58..8917c256c8088 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceCreateUpdateParameters.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceCreateUpdateParameters.Serialization.cs @@ -36,8 +36,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStartObject(); writer.WritePropertyName("resource"); writer.WriteObjectValue(Resource); - writer.WritePropertyName("options"); - writer.WriteObjectValue(Options); + if (Optional.IsDefined(Options)) + { + writer.WritePropertyName("options"); + writer.WriteObjectValue(Options); + } writer.WriteEndObject(); writer.WriteEndObject(); } @@ -50,7 +53,7 @@ internal static CassandraKeyspaceCreateUpdateParameters DeserializeCassandraKeys Optional location = default; Optional> tags = default; CassandraKeyspaceResource resource = default; - CreateUpdateOptions options = default; + Optional options = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("id")) @@ -104,6 +107,11 @@ internal static CassandraKeyspaceCreateUpdateParameters DeserializeCassandraKeys } if (property0.NameEquals("options")) { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } options = CreateUpdateOptions.DeserializeCreateUpdateOptions(property0.Value); continue; } @@ -111,7 +119,7 @@ internal static CassandraKeyspaceCreateUpdateParameters DeserializeCassandraKeys continue; } } - return new CassandraKeyspaceCreateUpdateParameters(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), resource, options); + return new CassandraKeyspaceCreateUpdateParameters(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), resource, options.Value); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceCreateUpdateParameters.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceCreateUpdateParameters.cs index 1bbda50440fe3..9ffef12b55160 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceCreateUpdateParameters.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceCreateUpdateParameters.cs @@ -15,21 +15,15 @@ public partial class CassandraKeyspaceCreateUpdateParameters : ARMResourceProper { /// Initializes a new instance of CassandraKeyspaceCreateUpdateParameters. /// 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. - /// or is null. - public CassandraKeyspaceCreateUpdateParameters(CassandraKeyspaceResource resource, CreateUpdateOptions options) + /// is null. + public CassandraKeyspaceCreateUpdateParameters(CassandraKeyspaceResource resource) { if (resource == null) { throw new ArgumentNullException(nameof(resource)); } - if (options == null) - { - throw new ArgumentNullException(nameof(options)); - } Resource = resource; - Options = options; } /// Initializes a new instance of CassandraKeyspaceCreateUpdateParameters. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceGetPropertiesResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceGetPropertiesResource.Serialization.cs index d9f9c8656f0c7..70ff118c67801 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceGetPropertiesResource.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceGetPropertiesResource.Serialization.cs @@ -23,7 +23,7 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) internal static CassandraKeyspaceGetPropertiesResource DeserializeCassandraKeyspaceGetPropertiesResource(JsonElement element) { Optional Rid = default; - Optional Ts = default; + Optional Ts = default; Optional Etag = default; string id = default; foreach (var property in element.EnumerateObject()) @@ -40,7 +40,7 @@ internal static CassandraKeyspaceGetPropertiesResource DeserializeCassandraKeysp property.ThrowNonNullablePropertyIsNull(); continue; } - Ts = property.Value.GetObject(); + Ts = property.Value.GetSingle(); continue; } if (property.NameEquals("_etag")) @@ -54,7 +54,7 @@ internal static CassandraKeyspaceGetPropertiesResource DeserializeCassandraKeysp continue; } } - return new CassandraKeyspaceGetPropertiesResource(id, Rid.Value, Ts.Value, Etag.Value); + return new CassandraKeyspaceGetPropertiesResource(id, Rid.Value, Optional.ToNullable(Ts), Etag.Value); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceGetPropertiesResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceGetPropertiesResource.cs index 45e2c3d9a9019..096d5a258a888 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceGetPropertiesResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceGetPropertiesResource.cs @@ -29,7 +29,7 @@ public CassandraKeyspaceGetPropertiesResource(string id) : base(id) /// 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. /// is null. - internal CassandraKeyspaceGetPropertiesResource(string id, string rid, object ts, string etag) : base(id) + internal CassandraKeyspaceGetPropertiesResource(string id, string rid, float? ts, string etag) : base(id) { if (id == null) { @@ -44,7 +44,7 @@ internal CassandraKeyspaceGetPropertiesResource(string id, string rid, object ts /// A system generated property. A unique identifier. public string Rid { get; } /// A system generated property that denotes the last updated timestamp of the resource. - public object Ts { get; } + public float? Ts { get; } /// A system generated property representing the resource etag required for optimistic concurrency control. public string Etag { get; } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableCreateUpdateParameters.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableCreateUpdateParameters.Serialization.cs index b24131334f8cf..55dfaf58681c8 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableCreateUpdateParameters.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableCreateUpdateParameters.Serialization.cs @@ -36,8 +36,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStartObject(); writer.WritePropertyName("resource"); writer.WriteObjectValue(Resource); - writer.WritePropertyName("options"); - writer.WriteObjectValue(Options); + if (Optional.IsDefined(Options)) + { + writer.WritePropertyName("options"); + writer.WriteObjectValue(Options); + } writer.WriteEndObject(); writer.WriteEndObject(); } @@ -50,7 +53,7 @@ internal static CassandraTableCreateUpdateParameters DeserializeCassandraTableCr Optional location = default; Optional> tags = default; CassandraTableResource resource = default; - CreateUpdateOptions options = default; + Optional options = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("id")) @@ -104,6 +107,11 @@ internal static CassandraTableCreateUpdateParameters DeserializeCassandraTableCr } if (property0.NameEquals("options")) { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } options = CreateUpdateOptions.DeserializeCreateUpdateOptions(property0.Value); continue; } @@ -111,7 +119,7 @@ internal static CassandraTableCreateUpdateParameters DeserializeCassandraTableCr continue; } } - return new CassandraTableCreateUpdateParameters(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), resource, options); + return new CassandraTableCreateUpdateParameters(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), resource, options.Value); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableCreateUpdateParameters.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableCreateUpdateParameters.cs index b7eaa5f12c2a0..db2c88c46761f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableCreateUpdateParameters.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableCreateUpdateParameters.cs @@ -15,21 +15,15 @@ public partial class CassandraTableCreateUpdateParameters : ARMResourcePropertie { /// Initializes a new instance of CassandraTableCreateUpdateParameters. /// 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. - /// or is null. - public CassandraTableCreateUpdateParameters(CassandraTableResource resource, CreateUpdateOptions options) + /// is null. + public CassandraTableCreateUpdateParameters(CassandraTableResource resource) { if (resource == null) { throw new ArgumentNullException(nameof(resource)); } - if (options == null) - { - throw new ArgumentNullException(nameof(options)); - } Resource = resource; - Options = options; } /// Initializes a new instance of CassandraTableCreateUpdateParameters. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableGetPropertiesResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableGetPropertiesResource.Serialization.cs index 06bfcfb2a5d0f..b03466b3cd314 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableGetPropertiesResource.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableGetPropertiesResource.Serialization.cs @@ -38,7 +38,7 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) internal static CassandraTableGetPropertiesResource DeserializeCassandraTableGetPropertiesResource(JsonElement element) { Optional Rid = default; - Optional Ts = default; + Optional Ts = default; Optional Etag = default; string id = default; Optional defaultTtl = default; @@ -58,7 +58,7 @@ internal static CassandraTableGetPropertiesResource DeserializeCassandraTableGet property.ThrowNonNullablePropertyIsNull(); continue; } - Ts = property.Value.GetObject(); + Ts = property.Value.GetSingle(); continue; } if (property.NameEquals("_etag")) @@ -102,7 +102,7 @@ internal static CassandraTableGetPropertiesResource DeserializeCassandraTableGet continue; } } - return new CassandraTableGetPropertiesResource(id, Optional.ToNullable(defaultTtl), schema.Value, Optional.ToNullable(analyticalStorageTtl), Rid.Value, Ts.Value, Etag.Value); + return new CassandraTableGetPropertiesResource(id, Optional.ToNullable(defaultTtl), schema.Value, Optional.ToNullable(analyticalStorageTtl), Rid.Value, Optional.ToNullable(Ts), Etag.Value); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableGetPropertiesResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableGetPropertiesResource.cs index 1836d9c92ea04..dc43cb5f4b0a4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableGetPropertiesResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableGetPropertiesResource.cs @@ -31,7 +31,7 @@ public CassandraTableGetPropertiesResource(string id) : base(id) /// 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 CassandraTableGetPropertiesResource(string id, int? defaultTtl, CassandraSchema schema, int? analyticalStorageTtl, string rid, object ts, string etag) : base(id, defaultTtl, schema, analyticalStorageTtl) + internal CassandraTableGetPropertiesResource(string id, int? defaultTtl, CassandraSchema schema, int? analyticalStorageTtl, string rid, float? ts, string etag) : base(id, defaultTtl, schema, analyticalStorageTtl) { Rid = rid; Ts = ts; @@ -41,7 +41,7 @@ internal CassandraTableGetPropertiesResource(string id, int? defaultTtl, Cassand /// A system generated property. A unique identifier. public string Rid { get; } /// A system generated property that denotes the last updated timestamp of the resource. - public object Ts { get; } + public float? Ts { get; } /// A system generated property representing the resource etag required for optimistic concurrency control. public string Etag { get; } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CloudError.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CloudError.Serialization.cs new file mode 100644 index 0000000000000..961653adbdfc0 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CloudError.Serialization.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + internal partial class CloudError + { + internal static CloudError DeserializeCloudError(JsonElement element) + { + Optional error = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("error")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + error = ErrorResponse.DeserializeErrorResponse(property.Value); + continue; + } + } + return new CloudError(error.Value); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CloudError.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CloudError.cs new file mode 100644 index 0000000000000..f806058d748db --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CloudError.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// An error response from the service. + internal partial class CloudError + { + /// Initializes a new instance of CloudError. + internal CloudError() + { + } + + /// Initializes a new instance of CloudError. + /// Error Response. + internal CloudError(ErrorResponse error) + { + Error = error; + } + + /// Error Response. + public ErrorResponse Error { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties.Serialization.cs new file mode 100644 index 0000000000000..39a0d454daa8f --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } + + internal static Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties DeserializeComponents1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties(JsonElement element) + { + Optional principalId = default; + Optional clientId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("principalId")) + { + principalId = property.Value.GetString(); + continue; + } + if (property.NameEquals("clientId")) + { + clientId = property.Value.GetString(); + continue; + } + } + return new Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties(principalId.Value, clientId.Value); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties.cs new file mode 100644 index 0000000000000..b376d2878613b --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties. + public partial class Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties + { + /// Initializes a new instance of Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties. + public Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties() + { + } + + /// Initializes a new instance of Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties. + /// The principal id of user assigned identity. + /// The client id of user assigned identity. + internal Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties(string principalId, string clientId) + { + PrincipalId = principalId; + ClientId = clientId; + } + + /// The principal id of user assigned identity. + public string PrincipalId { get; } + /// The client id of user assigned identity. + public string ClientId { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CompositePathSortOrder.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CompositePathSortOrder.cs index 32a704c697ea2..fed0fc4de6bf4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CompositePathSortOrder.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CompositePathSortOrder.cs @@ -22,12 +22,12 @@ public CompositePathSortOrder(string value) _value = value ?? throw new ArgumentNullException(nameof(value)); } - private const string AscendingValue = "Ascending"; - private const string DescendingValue = "Descending"; + private const string AscendingValue = "ascending"; + private const string DescendingValue = "descending"; - /// Ascending. + /// ascending. public static CompositePathSortOrder Ascending { get; } = new CompositePathSortOrder(AscendingValue); - /// Descending. + /// descending. public static CompositePathSortOrder Descending { get; } = new CompositePathSortOrder(DescendingValue); /// Determines if two values are the same. public static bool operator ==(CompositePathSortOrder left, CompositePathSortOrder right) => left.Equals(right); diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContainerPartitionKey.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContainerPartitionKey.Serialization.cs index 53a7b630dd934..5aeacdb0580f7 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContainerPartitionKey.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContainerPartitionKey.Serialization.cs @@ -44,6 +44,7 @@ internal static ContainerPartitionKey DeserializeContainerPartitionKey(JsonEleme Optional> paths = default; Optional kind = default; Optional version = default; + Optional systemKey = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("paths")) @@ -81,8 +82,18 @@ internal static ContainerPartitionKey DeserializeContainerPartitionKey(JsonEleme version = property.Value.GetInt32(); continue; } + if (property.NameEquals("systemKey")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + systemKey = property.Value.GetBoolean(); + continue; + } } - return new ContainerPartitionKey(Optional.ToList(paths), Optional.ToNullable(kind), Optional.ToNullable(version)); + return new ContainerPartitionKey(Optional.ToList(paths), Optional.ToNullable(kind), Optional.ToNullable(version), Optional.ToNullable(systemKey)); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContainerPartitionKey.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContainerPartitionKey.cs index 1065a196f4c7b..ea0650ac9bd2a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContainerPartitionKey.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContainerPartitionKey.cs @@ -21,20 +21,24 @@ public ContainerPartitionKey() /// Initializes a new instance of ContainerPartitionKey. /// List of paths using which data within the container can be partitioned. - /// Indicates the kind of algorithm used for partitioning. + /// Indicates the kind of algorithm used for partitioning. For MultiHash, multiple partition keys (upto three maximum) are supported for container create. /// Indicates the version of the partition key definition. - internal ContainerPartitionKey(IList paths, PartitionKind? kind, int? version) + /// Indicates if the container is using a system generated partition key. + internal ContainerPartitionKey(IList paths, PartitionKind? kind, int? version, bool? systemKey) { Paths = paths; Kind = kind; Version = version; + SystemKey = systemKey; } /// List of paths using which data within the container can be partitioned. public IList Paths { get; } - /// Indicates the kind of algorithm used for partitioning. + /// Indicates the kind of algorithm used for partitioning. For MultiHash, multiple partition keys (upto three maximum) are supported for container create. public PartitionKind? Kind { get; set; } /// Indicates the version of the partition key definition. public int? Version { get; set; } + /// Indicates if the container is using a system generated partition key. + public bool? SystemKey { get; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousBackupInformation.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousBackupInformation.Serialization.cs new file mode 100644 index 0000000000000..5a037bcc7d521 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousBackupInformation.Serialization.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class ContinuousBackupInformation + { + internal static ContinuousBackupInformation DeserializeContinuousBackupInformation(JsonElement element) + { + Optional latestRestorableTimestamp = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("latestRestorableTimestamp")) + { + latestRestorableTimestamp = property.Value.GetString(); + continue; + } + } + return new ContinuousBackupInformation(latestRestorableTimestamp.Value); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousBackupInformation.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousBackupInformation.cs new file mode 100644 index 0000000000000..62ac0a964f17a --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousBackupInformation.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// Information about the status of continuous backups. + public partial class ContinuousBackupInformation + { + /// Initializes a new instance of ContinuousBackupInformation. + internal ContinuousBackupInformation() + { + } + + /// Initializes a new instance of ContinuousBackupInformation. + /// The latest restorable timestamp for a resource. + internal ContinuousBackupInformation(string latestRestorableTimestamp) + { + LatestRestorableTimestamp = latestRestorableTimestamp; + } + + /// The latest restorable timestamp for a resource. + public string LatestRestorableTimestamp { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousBackupRestoreLocation.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousBackupRestoreLocation.Serialization.cs new file mode 100644 index 0000000000000..3cb9cde2aab45 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousBackupRestoreLocation.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class ContinuousBackupRestoreLocation : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"); + writer.WriteStringValue(Location); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousBackupRestoreLocation.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousBackupRestoreLocation.cs new file mode 100644 index 0000000000000..6b97c204053bb --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousBackupRestoreLocation.cs @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// Properties of the regional restorable account. + public partial class ContinuousBackupRestoreLocation + { + /// Initializes a new instance of ContinuousBackupRestoreLocation. + public ContinuousBackupRestoreLocation() + { + } + + /// The name of the continuous backup restore location. + public string Location { get; set; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousModeBackupPolicy.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousModeBackupPolicy.Serialization.cs new file mode 100644 index 0000000000000..7622d8e23bc71 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousModeBackupPolicy.Serialization.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class ContinuousModeBackupPolicy : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("type"); + writer.WriteStringValue(Type.ToString()); + if (Optional.IsDefined(MigrationState)) + { + writer.WritePropertyName("migrationState"); + writer.WriteObjectValue(MigrationState); + } + writer.WriteEndObject(); + } + + internal static ContinuousModeBackupPolicy DeserializeContinuousModeBackupPolicy(JsonElement element) + { + BackupPolicyType type = default; + Optional migrationState = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type")) + { + type = new BackupPolicyType(property.Value.GetString()); + continue; + } + if (property.NameEquals("migrationState")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + migrationState = BackupPolicyMigrationState.DeserializeBackupPolicyMigrationState(property.Value); + continue; + } + } + return new ContinuousModeBackupPolicy(type, migrationState.Value); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousModeBackupPolicy.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousModeBackupPolicy.cs new file mode 100644 index 0000000000000..6e2ab2122c3c1 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousModeBackupPolicy.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The object representing continuous mode backup policy. + public partial class ContinuousModeBackupPolicy : BackupPolicy + { + /// Initializes a new instance of ContinuousModeBackupPolicy. + public ContinuousModeBackupPolicy() + { + Type = BackupPolicyType.Continuous; + } + + /// Initializes a new instance of ContinuousModeBackupPolicy. + /// Describes the mode of backups. + /// The object representing the state of the migration between the backup policies. + internal ContinuousModeBackupPolicy(BackupPolicyType type, BackupPolicyMigrationState migrationState) : base(type, migrationState) + { + Type = type; + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CreateMode.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CreateMode.cs new file mode 100644 index 0000000000000..a1fed9d56d4e6 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CreateMode.cs @@ -0,0 +1,51 @@ +// 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 the mode of account creation. + public readonly partial struct CreateMode : IEquatable + { + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public CreateMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DefaultValue = "Default"; + private const string RestoreValue = "Restore"; + + /// Default. + public static CreateMode Default { get; } = new CreateMode(DefaultValue); + /// Restore. + public static CreateMode Restore { get; } = new CreateMode(RestoreValue); + /// Determines if two values are the same. + public static bool operator ==(CreateMode left, CreateMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CreateMode left, CreateMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator CreateMode(string value) => new CreateMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CreateMode other && Equals(other); + /// + public bool Equals(CreateMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CreatedByType.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CreatedByType.cs new file mode 100644 index 0000000000000..f84ad52f36028 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CreatedByType.cs @@ -0,0 +1,57 @@ +// 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 type of identity that created the resource. + public readonly partial struct CreatedByType : IEquatable + { + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public CreatedByType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UserValue = "User"; + private const string ApplicationValue = "Application"; + private const string ManagedIdentityValue = "ManagedIdentity"; + private const string KeyValue = "Key"; + + /// User. + public static CreatedByType User { get; } = new CreatedByType(UserValue); + /// Application. + public static CreatedByType Application { get; } = new CreatedByType(ApplicationValue); + /// ManagedIdentity. + public static CreatedByType ManagedIdentity { get; } = new CreatedByType(ManagedIdentityValue); + /// Key. + public static CreatedByType Key { get; } = new CreatedByType(KeyValue); + /// Determines if two values are the same. + public static bool operator ==(CreatedByType left, CreatedByType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CreatedByType left, CreatedByType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator CreatedByType(string value) => new CreatedByType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CreatedByType other && Equals(other); + /// + public bool Equals(CreatedByType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseAccountCreateUpdateParameters.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseAccountCreateUpdateParameters.Serialization.cs index 4c0cc5fe350de..d5de17fb11779 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseAccountCreateUpdateParameters.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseAccountCreateUpdateParameters.Serialization.cs @@ -21,6 +21,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("kind"); writer.WriteStringValue(Kind.Value.ToString()); } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"); + writer.WriteObjectValue(Identity); + } if (Optional.IsDefined(Location)) { writer.WritePropertyName("location"); @@ -118,6 +123,16 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("keyVaultKeyUri"); writer.WriteStringValue(KeyVaultKeyUri); } + if (Optional.IsDefined(DefaultIdentity)) + { + writer.WritePropertyName("defaultIdentity"); + writer.WriteStringValue(DefaultIdentity); + } + if (Optional.IsDefined(PublicNetworkAccess)) + { + writer.WritePropertyName("publicNetworkAccess"); + writer.WriteStringValue(PublicNetworkAccess.Value.ToString()); + } if (Optional.IsDefined(EnableFreeTier)) { writer.WritePropertyName("enableFreeTier"); @@ -133,6 +148,21 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("enableAnalyticalStorage"); writer.WriteBooleanValue(EnableAnalyticalStorage.Value); } + if (Optional.IsDefined(AnalyticalStorageConfiguration)) + { + writer.WritePropertyName("analyticalStorageConfiguration"); + writer.WriteObjectValue(AnalyticalStorageConfiguration); + } + if (Optional.IsDefined(CreateMode)) + { + writer.WritePropertyName("createMode"); + writer.WriteStringValue(CreateMode.Value.ToString()); + } + if (Optional.IsDefined(BackupPolicy)) + { + writer.WritePropertyName("backupPolicy"); + writer.WriteObjectValue(BackupPolicy); + } if (Optional.IsCollectionDefined(Cors)) { writer.WritePropertyName("cors"); @@ -143,6 +173,31 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } writer.WriteEndArray(); } + if (Optional.IsDefined(NetworkAclBypass)) + { + writer.WritePropertyName("networkAclBypass"); + writer.WriteStringValue(NetworkAclBypass.Value.ToSerialString()); + } + if (Optional.IsCollectionDefined(NetworkAclBypassResourceIds)) + { + writer.WritePropertyName("networkAclBypassResourceIds"); + writer.WriteStartArray(); + foreach (var item in NetworkAclBypassResourceIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(DisableLocalAuth)) + { + writer.WritePropertyName("disableLocalAuth"); + writer.WriteBooleanValue(DisableLocalAuth.Value); + } + if (Optional.IsDefined(RestoreParameters)) + { + writer.WritePropertyName("restoreParameters"); + writer.WriteObjectValue(RestoreParameters); + } writer.WriteEndObject(); writer.WriteEndObject(); } @@ -150,6 +205,7 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) internal static DatabaseAccountCreateUpdateParameters DeserializeDatabaseAccountCreateUpdateParameters(JsonElement element) { Optional kind = default; + Optional identity = default; Optional id = default; Optional name = default; Optional type = default; @@ -168,11 +224,19 @@ internal static DatabaseAccountCreateUpdateParameters DeserializeDatabaseAccount Optional connectorOffer = default; Optional disableKeyBasedMetadataWriteAccess = default; Optional keyVaultKeyUri = default; + Optional defaultIdentity = default; Optional publicNetworkAccess = default; Optional enableFreeTier = default; Optional apiProperties = default; Optional enableAnalyticalStorage = default; + Optional analyticalStorageConfiguration = default; + Optional createMode = default; + Optional backupPolicy = default; Optional> cors = default; + Optional networkAclBypass = default; + Optional> networkAclBypassResourceIds = default; + Optional disableLocalAuth = default; + Optional restoreParameters = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("kind")) @@ -185,6 +249,16 @@ internal static DatabaseAccountCreateUpdateParameters DeserializeDatabaseAccount kind = new DatabaseAccountKind(property.Value.GetString()); continue; } + if (property.NameEquals("identity")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + identity = ManagedServiceIdentity.DeserializeManagedServiceIdentity(property.Value); + continue; + } if (property.NameEquals("id")) { id = property.Value.GetString(); @@ -364,6 +438,11 @@ internal static DatabaseAccountCreateUpdateParameters DeserializeDatabaseAccount keyVaultKeyUri = property0.Value.GetString(); continue; } + if (property0.NameEquals("defaultIdentity")) + { + defaultIdentity = property0.Value.GetString(); + continue; + } if (property0.NameEquals("publicNetworkAccess")) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -404,6 +483,36 @@ internal static DatabaseAccountCreateUpdateParameters DeserializeDatabaseAccount enableAnalyticalStorage = property0.Value.GetBoolean(); continue; } + if (property0.NameEquals("analyticalStorageConfiguration")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + analyticalStorageConfiguration = AnalyticalStorageConfiguration.DeserializeAnalyticalStorageConfiguration(property0.Value); + continue; + } + if (property0.NameEquals("createMode")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + createMode = new CreateMode(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("backupPolicy")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + backupPolicy = BackupPolicy.DeserializeBackupPolicy(property0.Value); + continue; + } if (property0.NameEquals("cors")) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -419,11 +528,56 @@ internal static DatabaseAccountCreateUpdateParameters DeserializeDatabaseAccount cors = array; continue; } + if (property0.NameEquals("networkAclBypass")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + networkAclBypass = property0.Value.GetString().ToNetworkAclBypass(); + continue; + } + if (property0.NameEquals("networkAclBypassResourceIds")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + networkAclBypassResourceIds = array; + continue; + } + if (property0.NameEquals("disableLocalAuth")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + disableLocalAuth = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("restoreParameters")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + restoreParameters = RestoreParameters.DeserializeRestoreParameters(property0.Value); + continue; + } } continue; } } - return new DatabaseAccountCreateUpdateParameters(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), Optional.ToNullable(kind), consistencyPolicy.Value, locations, databaseAccountOfferType, Optional.ToList(ipRules), Optional.ToNullable(isVirtualNetworkFilterEnabled), Optional.ToNullable(enableAutomaticFailover), Optional.ToList(capabilities), Optional.ToList(virtualNetworkRules), Optional.ToNullable(enableMultipleWriteLocations), Optional.ToNullable(enableCassandraConnector), Optional.ToNullable(connectorOffer), Optional.ToNullable(disableKeyBasedMetadataWriteAccess), keyVaultKeyUri.Value, Optional.ToNullable(publicNetworkAccess), Optional.ToNullable(enableFreeTier), apiProperties.Value, Optional.ToNullable(enableAnalyticalStorage), Optional.ToList(cors)); + return new DatabaseAccountCreateUpdateParameters(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), Optional.ToNullable(kind), identity.Value, consistencyPolicy.Value, locations, databaseAccountOfferType, Optional.ToList(ipRules), Optional.ToNullable(isVirtualNetworkFilterEnabled), Optional.ToNullable(enableAutomaticFailover), Optional.ToList(capabilities), Optional.ToList(virtualNetworkRules), Optional.ToNullable(enableMultipleWriteLocations), Optional.ToNullable(enableCassandraConnector), Optional.ToNullable(connectorOffer), Optional.ToNullable(disableKeyBasedMetadataWriteAccess), keyVaultKeyUri.Value, defaultIdentity.Value, Optional.ToNullable(publicNetworkAccess), Optional.ToNullable(enableFreeTier), apiProperties.Value, Optional.ToNullable(enableAnalyticalStorage), analyticalStorageConfiguration.Value, Optional.ToNullable(createMode), backupPolicy.Value, Optional.ToList(cors), Optional.ToNullable(networkAclBypass), Optional.ToList(networkAclBypassResourceIds), Optional.ToNullable(disableLocalAuth), restoreParameters.Value); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseAccountCreateUpdateParameters.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseAccountCreateUpdateParameters.cs index f1a1cdf2cb399..8d4fc095cb2e2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseAccountCreateUpdateParameters.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseAccountCreateUpdateParameters.cs @@ -31,6 +31,7 @@ public DatabaseAccountCreateUpdateParameters(IEnumerable locations) Capabilities = new ChangeTrackingList(); VirtualNetworkRules = new ChangeTrackingList(); Cors = new ChangeTrackingList(); + NetworkAclBypassResourceIds = new ChangeTrackingList(); } /// Initializes a new instance of DatabaseAccountCreateUpdateParameters. @@ -40,6 +41,7 @@ public DatabaseAccountCreateUpdateParameters(IEnumerable locations) /// The location of the resource group to which the resource belongs. /// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example, the default experience for a template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". /// 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. @@ -53,14 +55,23 @@ public DatabaseAccountCreateUpdateParameters(IEnumerable locations) /// The cassandra connector offer type for the Cosmos DB database C* account. /// Disable write operations on metadata resources (databases, containers, throughput) via account keys. /// The URI of the key vault. + /// The default identity for accessing key vault used in features like customer managed keys. The default identity needs to be explicitly set by the users. It can be "FirstPartyIdentity", "SystemAssignedIdentity" and more. /// Whether requests from Public Network are allowed. /// Flag to indicate whether Free Tier is enabled. /// API specific properties. Currently, supported only for MongoDB API. /// Flag to indicate whether to enable storage analytics. + /// Analytical storage specific properties. + /// Enum to indicate the mode of account creation. + /// The object representing the policy for taking backups on an account. /// The CORS policy for the Cosmos DB database account. - internal DatabaseAccountCreateUpdateParameters(string id, string name, string type, string location, IDictionary tags, DatabaseAccountKind? kind, ConsistencyPolicy consistencyPolicy, IList locations, string databaseAccountOfferType, IList ipRules, bool? isVirtualNetworkFilterEnabled, bool? enableAutomaticFailover, IList capabilities, IList virtualNetworkRules, bool? enableMultipleWriteLocations, bool? enableCassandraConnector, ConnectorOffer? connectorOffer, bool? disableKeyBasedMetadataWriteAccess, string keyVaultKeyUri, PublicNetworkAccess? publicNetworkAccess, bool? enableFreeTier, ApiProperties apiProperties, bool? enableAnalyticalStorage, IList cors) : base(id, name, type, location, tags) + /// 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. + /// 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. + internal DatabaseAccountCreateUpdateParameters(string id, string name, string type, string location, IDictionary tags, DatabaseAccountKind? kind, ManagedServiceIdentity identity, ConsistencyPolicy consistencyPolicy, IList locations, string databaseAccountOfferType, IList ipRules, bool? isVirtualNetworkFilterEnabled, bool? enableAutomaticFailover, IList capabilities, IList virtualNetworkRules, bool? enableMultipleWriteLocations, bool? enableCassandraConnector, ConnectorOffer? connectorOffer, bool? disableKeyBasedMetadataWriteAccess, string keyVaultKeyUri, string defaultIdentity, PublicNetworkAccess? publicNetworkAccess, bool? enableFreeTier, ApiProperties apiProperties, bool? enableAnalyticalStorage, AnalyticalStorageConfiguration analyticalStorageConfiguration, CreateMode? createMode, BackupPolicy backupPolicy, IList cors, NetworkAclBypass? networkAclBypass, IList networkAclBypassResourceIds, bool? disableLocalAuth, RestoreParameters restoreParameters) : base(id, name, type, location, tags) { Kind = kind; + Identity = identity; ConsistencyPolicy = consistencyPolicy; Locations = locations; DatabaseAccountOfferType = databaseAccountOfferType; @@ -74,15 +85,25 @@ internal DatabaseAccountCreateUpdateParameters(string id, string name, string ty ConnectorOffer = connectorOffer; DisableKeyBasedMetadataWriteAccess = disableKeyBasedMetadataWriteAccess; KeyVaultKeyUri = keyVaultKeyUri; + DefaultIdentity = defaultIdentity; PublicNetworkAccess = publicNetworkAccess; EnableFreeTier = enableFreeTier; ApiProperties = apiProperties; EnableAnalyticalStorage = enableAnalyticalStorage; + AnalyticalStorageConfiguration = analyticalStorageConfiguration; + CreateMode = createMode; + BackupPolicy = backupPolicy; Cors = cors; + NetworkAclBypass = networkAclBypass; + NetworkAclBypassResourceIds = networkAclBypassResourceIds; + DisableLocalAuth = disableLocalAuth; + RestoreParameters = restoreParameters; } /// Indicates the type of database account. This can only be set at database account creation. public DatabaseAccountKind? Kind { get; set; } + /// Identity for the resource. + public ManagedServiceIdentity Identity { get; set; } /// The consistency policy for the Cosmos DB account. public ConsistencyPolicy ConsistencyPolicy { get; set; } /// An array that contains the georeplication locations enabled for the Cosmos DB account. @@ -109,15 +130,31 @@ internal DatabaseAccountCreateUpdateParameters(string id, string name, string ty public bool? DisableKeyBasedMetadataWriteAccess { get; set; } /// The URI of the key vault. public string KeyVaultKeyUri { get; set; } + /// The default identity for accessing key vault used in features like customer managed keys. The default identity needs to be explicitly set by the users. It can be "FirstPartyIdentity", "SystemAssignedIdentity" and more. + public string DefaultIdentity { get; set; } /// Whether requests from Public Network are allowed. - public PublicNetworkAccess? PublicNetworkAccess { get; } + public PublicNetworkAccess? PublicNetworkAccess { get; set; } /// Flag to indicate whether Free Tier is enabled. public bool? EnableFreeTier { get; set; } /// API specific properties. Currently, supported only for MongoDB API. public ApiProperties ApiProperties { get; set; } /// Flag to indicate whether to enable storage analytics. public bool? EnableAnalyticalStorage { get; set; } + /// Analytical storage specific properties. + public AnalyticalStorageConfiguration AnalyticalStorageConfiguration { get; set; } + /// Enum to indicate the mode of account creation. + public CreateMode? CreateMode { get; set; } + /// The object representing the policy for taking backups on an account. + public BackupPolicy BackupPolicy { get; set; } /// The CORS policy for the Cosmos DB database account. public IList Cors { get; } + /// Indicates what services are allowed to bypass firewall checks. + public NetworkAclBypass? NetworkAclBypass { get; set; } + /// An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. + public IList NetworkAclBypassResourceIds { get; } + /// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. + public bool? DisableLocalAuth { get; set; } + /// Parameters to indicate the information about the restore. + public RestoreParameters RestoreParameters { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseAccountGetResults.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseAccountGetResults.Serialization.cs index 010158e419074..1b8c1cabd690e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseAccountGetResults.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseAccountGetResults.Serialization.cs @@ -21,6 +21,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("kind"); writer.WriteStringValue(Kind.Value.ToString()); } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"); + writer.WriteObjectValue(Identity); + } if (Optional.IsDefined(Location)) { writer.WritePropertyName("location"); @@ -109,6 +114,16 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("keyVaultKeyUri"); writer.WriteStringValue(KeyVaultKeyUri); } + if (Optional.IsDefined(DefaultIdentity)) + { + writer.WritePropertyName("defaultIdentity"); + writer.WriteStringValue(DefaultIdentity); + } + if (Optional.IsDefined(PublicNetworkAccess)) + { + writer.WritePropertyName("publicNetworkAccess"); + writer.WriteStringValue(PublicNetworkAccess.Value.ToString()); + } if (Optional.IsDefined(EnableFreeTier)) { writer.WritePropertyName("enableFreeTier"); @@ -124,6 +139,26 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("enableAnalyticalStorage"); writer.WriteBooleanValue(EnableAnalyticalStorage.Value); } + if (Optional.IsDefined(AnalyticalStorageConfiguration)) + { + writer.WritePropertyName("analyticalStorageConfiguration"); + writer.WriteObjectValue(AnalyticalStorageConfiguration); + } + if (Optional.IsDefined(CreateMode)) + { + writer.WritePropertyName("createMode"); + writer.WriteStringValue(CreateMode.Value.ToString()); + } + if (Optional.IsDefined(RestoreParameters)) + { + writer.WritePropertyName("restoreParameters"); + writer.WriteObjectValue(RestoreParameters); + } + if (Optional.IsDefined(BackupPolicy)) + { + writer.WritePropertyName("backupPolicy"); + writer.WriteObjectValue(BackupPolicy); + } if (Optional.IsCollectionDefined(Cors)) { writer.WritePropertyName("cors"); @@ -134,6 +169,26 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } writer.WriteEndArray(); } + if (Optional.IsDefined(NetworkAclBypass)) + { + writer.WritePropertyName("networkAclBypass"); + writer.WriteStringValue(NetworkAclBypass.Value.ToSerialString()); + } + if (Optional.IsCollectionDefined(NetworkAclBypassResourceIds)) + { + writer.WritePropertyName("networkAclBypassResourceIds"); + writer.WriteStartArray(); + foreach (var item in NetworkAclBypassResourceIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(DisableLocalAuth)) + { + writer.WritePropertyName("disableLocalAuth"); + writer.WriteBooleanValue(DisableLocalAuth.Value); + } writer.WriteEndObject(); writer.WriteEndObject(); } @@ -141,6 +196,8 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) internal static DatabaseAccountGetResults DeserializeDatabaseAccountGetResults(JsonElement element) { Optional kind = default; + Optional identity = default; + Optional systemData = default; Optional id = default; Optional name = default; Optional type = default; @@ -165,11 +222,20 @@ internal static DatabaseAccountGetResults DeserializeDatabaseAccountGetResults(J Optional connectorOffer = default; Optional disableKeyBasedMetadataWriteAccess = default; Optional keyVaultKeyUri = default; + Optional defaultIdentity = default; Optional publicNetworkAccess = default; Optional enableFreeTier = default; Optional apiProperties = default; Optional enableAnalyticalStorage = default; + Optional analyticalStorageConfiguration = default; + Optional instanceId = default; + Optional createMode = default; + Optional restoreParameters = default; + Optional backupPolicy = default; Optional> cors = default; + Optional networkAclBypass = default; + Optional> networkAclBypassResourceIds = default; + Optional disableLocalAuth = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("kind")) @@ -182,6 +248,26 @@ internal static DatabaseAccountGetResults DeserializeDatabaseAccountGetResults(J kind = new DatabaseAccountKind(property.Value.GetString()); continue; } + if (property.NameEquals("identity")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + identity = ManagedServiceIdentity.DeserializeManagedServiceIdentity(property.Value); + continue; + } + if (property.NameEquals("systemData")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + systemData = SystemData.DeserializeSystemData(property.Value); + continue; + } if (property.NameEquals("id")) { id = property.Value.GetString(); @@ -436,6 +522,11 @@ internal static DatabaseAccountGetResults DeserializeDatabaseAccountGetResults(J keyVaultKeyUri = property0.Value.GetString(); continue; } + if (property0.NameEquals("defaultIdentity")) + { + defaultIdentity = property0.Value.GetString(); + continue; + } if (property0.NameEquals("publicNetworkAccess")) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -476,6 +567,51 @@ internal static DatabaseAccountGetResults DeserializeDatabaseAccountGetResults(J enableAnalyticalStorage = property0.Value.GetBoolean(); continue; } + if (property0.NameEquals("analyticalStorageConfiguration")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + analyticalStorageConfiguration = AnalyticalStorageConfiguration.DeserializeAnalyticalStorageConfiguration(property0.Value); + continue; + } + if (property0.NameEquals("instanceId")) + { + instanceId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("createMode")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + createMode = new CreateMode(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("restoreParameters")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + restoreParameters = RestoreParameters.DeserializeRestoreParameters(property0.Value); + continue; + } + if (property0.NameEquals("backupPolicy")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + backupPolicy = BackupPolicy.DeserializeBackupPolicy(property0.Value); + continue; + } if (property0.NameEquals("cors")) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -491,11 +627,46 @@ internal static DatabaseAccountGetResults DeserializeDatabaseAccountGetResults(J cors = array; continue; } + if (property0.NameEquals("networkAclBypass")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + networkAclBypass = property0.Value.GetString().ToNetworkAclBypass(); + continue; + } + if (property0.NameEquals("networkAclBypassResourceIds")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + networkAclBypassResourceIds = array; + continue; + } + if (property0.NameEquals("disableLocalAuth")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + disableLocalAuth = property0.Value.GetBoolean(); + continue; + } } continue; } } - return new DatabaseAccountGetResults(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), Optional.ToNullable(kind), provisioningState.Value, documentEndpoint.Value, databaseAccountOfferType.Value, Optional.ToList(ipRules), Optional.ToNullable(isVirtualNetworkFilterEnabled), Optional.ToNullable(enableAutomaticFailover), consistencyPolicy.Value, Optional.ToList(capabilities), Optional.ToList(writeLocations), Optional.ToList(readLocations), Optional.ToList(locations), Optional.ToList(failoverPolicies), Optional.ToList(virtualNetworkRules), Optional.ToList(privateEndpointConnections), Optional.ToNullable(enableMultipleWriteLocations), Optional.ToNullable(enableCassandraConnector), Optional.ToNullable(connectorOffer), Optional.ToNullable(disableKeyBasedMetadataWriteAccess), keyVaultKeyUri.Value, Optional.ToNullable(publicNetworkAccess), Optional.ToNullable(enableFreeTier), apiProperties.Value, Optional.ToNullable(enableAnalyticalStorage), Optional.ToList(cors)); + return new DatabaseAccountGetResults(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), Optional.ToNullable(kind), identity.Value, systemData.Value, provisioningState.Value, documentEndpoint.Value, databaseAccountOfferType.Value, Optional.ToList(ipRules), Optional.ToNullable(isVirtualNetworkFilterEnabled), Optional.ToNullable(enableAutomaticFailover), consistencyPolicy.Value, Optional.ToList(capabilities), Optional.ToList(writeLocations), Optional.ToList(readLocations), Optional.ToList(locations), Optional.ToList(failoverPolicies), Optional.ToList(virtualNetworkRules), Optional.ToList(privateEndpointConnections), Optional.ToNullable(enableMultipleWriteLocations), Optional.ToNullable(enableCassandraConnector), Optional.ToNullable(connectorOffer), Optional.ToNullable(disableKeyBasedMetadataWriteAccess), keyVaultKeyUri.Value, defaultIdentity.Value, Optional.ToNullable(publicNetworkAccess), Optional.ToNullable(enableFreeTier), apiProperties.Value, Optional.ToNullable(enableAnalyticalStorage), analyticalStorageConfiguration.Value, instanceId.Value, Optional.ToNullable(createMode), restoreParameters.Value, backupPolicy.Value, Optional.ToList(cors), Optional.ToNullable(networkAclBypass), Optional.ToList(networkAclBypassResourceIds), Optional.ToNullable(disableLocalAuth)); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseAccountGetResults.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseAccountGetResults.cs index a0db189203ed0..1e1f3ee948a05 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseAccountGetResults.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseAccountGetResults.cs @@ -26,6 +26,7 @@ public DatabaseAccountGetResults() VirtualNetworkRules = new ChangeTrackingList(); PrivateEndpointConnections = new ChangeTrackingList(); Cors = new ChangeTrackingList(); + NetworkAclBypassResourceIds = new ChangeTrackingList(); } /// Initializes a new instance of DatabaseAccountGetResults. @@ -35,6 +36,8 @@ public DatabaseAccountGetResults() /// The location of the resource group to which the resource belongs. /// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example, the default experience for a template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". /// Indicates the type of database account. This can only be set at database account creation. + /// Identity for the resource. + /// The system meta data relating to this 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. @@ -54,14 +57,25 @@ public DatabaseAccountGetResults() /// The cassandra connector offer type for the Cosmos DB database C* account. /// Disable write operations on metadata resources (databases, containers, throughput) via account keys. /// The URI of the key vault. + /// The default identity for accessing key vault used in features like customer managed keys. The default identity needs to be explicitly set by the users. It can be "FirstPartyIdentity", "SystemAssignedIdentity" and more. /// Whether requests from Public Network are allowed. /// Flag to indicate whether Free Tier is enabled. /// API specific properties. /// Flag to indicate whether to enable storage analytics. + /// Analytical storage specific properties. + /// A unique identifier assigned to the database account. + /// Enum to indicate the mode of account creation. + /// Parameters to indicate the information about the restore. + /// The object representing the policy for taking backups on an account. /// The CORS policy for the Cosmos DB database account. - internal DatabaseAccountGetResults(string id, string name, string type, string location, IDictionary tags, DatabaseAccountKind? kind, string provisioningState, string documentEndpoint, string 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, string keyVaultKeyUri, PublicNetworkAccess? publicNetworkAccess, bool? enableFreeTier, ApiProperties apiProperties, bool? enableAnalyticalStorage, IList cors) : base(id, name, type, location, tags) + /// 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. + /// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. + internal DatabaseAccountGetResults(string id, string name, string type, string location, IDictionary tags, DatabaseAccountKind? kind, ManagedServiceIdentity identity, SystemData systemData, string provisioningState, string documentEndpoint, string 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, string keyVaultKeyUri, string defaultIdentity, PublicNetworkAccess? publicNetworkAccess, bool? enableFreeTier, ApiProperties apiProperties, bool? enableAnalyticalStorage, AnalyticalStorageConfiguration analyticalStorageConfiguration, string instanceId, CreateMode? createMode, RestoreParameters restoreParameters, BackupPolicy backupPolicy, IList cors, NetworkAclBypass? networkAclBypass, IList networkAclBypassResourceIds, bool? disableLocalAuth) : base(id, name, type, location, tags) { Kind = kind; + Identity = identity; + SystemData = systemData; ProvisioningState = provisioningState; DocumentEndpoint = documentEndpoint; DatabaseAccountOfferType = databaseAccountOfferType; @@ -81,15 +95,28 @@ internal DatabaseAccountGetResults(string id, string name, string type, string l ConnectorOffer = connectorOffer; DisableKeyBasedMetadataWriteAccess = disableKeyBasedMetadataWriteAccess; KeyVaultKeyUri = keyVaultKeyUri; + DefaultIdentity = defaultIdentity; PublicNetworkAccess = publicNetworkAccess; EnableFreeTier = enableFreeTier; ApiProperties = apiProperties; EnableAnalyticalStorage = enableAnalyticalStorage; + AnalyticalStorageConfiguration = analyticalStorageConfiguration; + InstanceId = instanceId; + CreateMode = createMode; + RestoreParameters = restoreParameters; + BackupPolicy = backupPolicy; Cors = cors; + NetworkAclBypass = networkAclBypass; + NetworkAclBypassResourceIds = networkAclBypassResourceIds; + DisableLocalAuth = disableLocalAuth; } /// Indicates the type of database account. This can only be set at database account creation. public DatabaseAccountKind? Kind { get; set; } + /// Identity for the resource. + public ManagedServiceIdentity Identity { get; set; } + /// The system meta data relating to this resource. + public SystemData SystemData { get; } /// 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. public string ProvisioningState { get; } /// The connection endpoint for the Cosmos DB database account. @@ -128,15 +155,33 @@ internal DatabaseAccountGetResults(string id, string name, string type, string l public bool? DisableKeyBasedMetadataWriteAccess { get; set; } /// The URI of the key vault. public string KeyVaultKeyUri { get; set; } + /// The default identity for accessing key vault used in features like customer managed keys. The default identity needs to be explicitly set by the users. It can be "FirstPartyIdentity", "SystemAssignedIdentity" and more. + public string DefaultIdentity { get; set; } /// Whether requests from Public Network are allowed. - public PublicNetworkAccess? PublicNetworkAccess { get; } + public PublicNetworkAccess? PublicNetworkAccess { get; set; } /// Flag to indicate whether Free Tier is enabled. public bool? EnableFreeTier { get; set; } /// API specific properties. public ApiProperties ApiProperties { get; set; } /// Flag to indicate whether to enable storage analytics. public bool? EnableAnalyticalStorage { get; set; } + /// Analytical storage specific properties. + public AnalyticalStorageConfiguration AnalyticalStorageConfiguration { get; set; } + /// A unique identifier assigned to the database account. + public string InstanceId { get; } + /// Enum to indicate the mode of account creation. + public CreateMode? CreateMode { get; set; } + /// Parameters to indicate the information about the restore. + public RestoreParameters RestoreParameters { get; set; } + /// The object representing the policy for taking backups on an account. + public BackupPolicy BackupPolicy { get; set; } /// The CORS policy for the Cosmos DB database account. public IList Cors { get; } + /// Indicates what services are allowed to bypass firewall checks. + public NetworkAclBypass? NetworkAclBypass { get; set; } + /// An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. + public IList NetworkAclBypassResourceIds { get; } + /// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. + public bool? DisableLocalAuth { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseAccountUpdateParameters.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseAccountUpdateParameters.Serialization.cs index a5d8cee46b21b..f8a1241c37a02 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseAccountUpdateParameters.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseAccountUpdateParameters.Serialization.cs @@ -31,6 +31,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("location"); writer.WriteStringValue(Location); } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"); + writer.WriteObjectValue(Identity); + } writer.WritePropertyName("properties"); writer.WriteStartObject(); if (Optional.IsDefined(ConsistencyPolicy)) @@ -113,6 +118,16 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("keyVaultKeyUri"); writer.WriteStringValue(KeyVaultKeyUri); } + if (Optional.IsDefined(DefaultIdentity)) + { + writer.WritePropertyName("defaultIdentity"); + writer.WriteStringValue(DefaultIdentity); + } + if (Optional.IsDefined(PublicNetworkAccess)) + { + writer.WritePropertyName("publicNetworkAccess"); + writer.WriteStringValue(PublicNetworkAccess.Value.ToString()); + } if (Optional.IsDefined(EnableFreeTier)) { writer.WritePropertyName("enableFreeTier"); @@ -128,6 +143,16 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("enableAnalyticalStorage"); writer.WriteBooleanValue(EnableAnalyticalStorage.Value); } + if (Optional.IsDefined(AnalyticalStorageConfiguration)) + { + writer.WritePropertyName("analyticalStorageConfiguration"); + writer.WriteObjectValue(AnalyticalStorageConfiguration); + } + if (Optional.IsDefined(BackupPolicy)) + { + writer.WritePropertyName("backupPolicy"); + writer.WriteObjectValue(BackupPolicy); + } if (Optional.IsCollectionDefined(Cors)) { writer.WritePropertyName("cors"); @@ -138,6 +163,26 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } writer.WriteEndArray(); } + if (Optional.IsDefined(NetworkAclBypass)) + { + writer.WritePropertyName("networkAclBypass"); + writer.WriteStringValue(NetworkAclBypass.Value.ToSerialString()); + } + if (Optional.IsCollectionDefined(NetworkAclBypassResourceIds)) + { + writer.WritePropertyName("networkAclBypassResourceIds"); + writer.WriteStartArray(); + foreach (var item in NetworkAclBypassResourceIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(DisableLocalAuth)) + { + writer.WritePropertyName("disableLocalAuth"); + writer.WriteBooleanValue(DisableLocalAuth.Value); + } writer.WriteEndObject(); writer.WriteEndObject(); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseAccountUpdateParameters.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseAccountUpdateParameters.cs index 5d24ee0823c39..ba3b8ee0e44bc 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseAccountUpdateParameters.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseAccountUpdateParameters.cs @@ -22,12 +22,15 @@ public DatabaseAccountUpdateParameters() Capabilities = new ChangeTrackingList(); VirtualNetworkRules = new ChangeTrackingList(); Cors = new ChangeTrackingList(); + NetworkAclBypassResourceIds = new ChangeTrackingList(); } /// Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example, the default experience for a template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". public IDictionary Tags { get; } /// The location of the resource group to which the resource belongs. public string Location { get; set; } + /// Identity for the resource. + public ManagedServiceIdentity Identity { get; set; } /// The consistency policy for the Cosmos DB account. public ConsistencyPolicy ConsistencyPolicy { get; set; } /// An array that contains the georeplication locations enabled for the Cosmos DB account. @@ -52,15 +55,27 @@ public DatabaseAccountUpdateParameters() public bool? DisableKeyBasedMetadataWriteAccess { get; set; } /// The URI of the key vault. public string KeyVaultKeyUri { get; set; } + /// The default identity for accessing key vault used in features like customer managed keys. The default identity needs to be explicitly set by the users. It can be "FirstPartyIdentity", "SystemAssignedIdentity" and more. + public string DefaultIdentity { get; set; } /// Whether requests from Public Network are allowed. - public PublicNetworkAccess? PublicNetworkAccess { get; } + public PublicNetworkAccess? PublicNetworkAccess { get; set; } /// Flag to indicate whether Free Tier is enabled. public bool? EnableFreeTier { get; set; } /// API specific properties. Currently, supported only for MongoDB API. public ApiProperties ApiProperties { get; set; } /// Flag to indicate whether to enable storage analytics. public bool? EnableAnalyticalStorage { get; set; } + /// Analytical storage specific properties. + public AnalyticalStorageConfiguration AnalyticalStorageConfiguration { get; set; } + /// The object representing the policy for taking backups on an account. + public BackupPolicy BackupPolicy { get; set; } /// The CORS policy for the Cosmos DB database account. public IList Cors { get; } + /// Indicates what services are allowed to bypass firewall checks. + public NetworkAclBypass? NetworkAclBypass { get; set; } + /// An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. + public IList NetworkAclBypassResourceIds { get; } + /// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. + public bool? DisableLocalAuth { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseRestoreResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseRestoreResource.Serialization.cs new file mode 100644 index 0000000000000..f667bf7d564c2 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseRestoreResource.Serialization.cs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class DatabaseRestoreResource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(DatabaseName)) + { + writer.WritePropertyName("databaseName"); + writer.WriteStringValue(DatabaseName); + } + if (Optional.IsCollectionDefined(CollectionNames)) + { + writer.WritePropertyName("collectionNames"); + writer.WriteStartArray(); + foreach (var item in CollectionNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static DatabaseRestoreResource DeserializeDatabaseRestoreResource(JsonElement element) + { + Optional databaseName = default; + Optional> collectionNames = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("databaseName")) + { + databaseName = property.Value.GetString(); + continue; + } + if (property.NameEquals("collectionNames")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + collectionNames = array; + continue; + } + } + return new DatabaseRestoreResource(databaseName.Value, Optional.ToList(collectionNames)); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseRestoreResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseRestoreResource.cs new file mode 100644 index 0000000000000..f59670d41ef64 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseRestoreResource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// Specific Databases to restore. + public partial class DatabaseRestoreResource + { + /// Initializes a new instance of DatabaseRestoreResource. + public DatabaseRestoreResource() + { + CollectionNames = new ChangeTrackingList(); + } + + /// Initializes a new instance of DatabaseRestoreResource. + /// The name of the database available for restore. + /// The names of the collections available for restore. + internal DatabaseRestoreResource(string databaseName, IList collectionNames) + { + DatabaseName = databaseName; + CollectionNames = collectionNames; + } + + /// The name of the database available for restore. + public string DatabaseName { get; set; } + /// The names of the collections available for restore. + public IList CollectionNames { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedResourceProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedResourceProperties.Serialization.cs index 6054fe6535791..e29e623896a6e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedResourceProperties.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedResourceProperties.Serialization.cs @@ -21,7 +21,7 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) internal static ExtendedResourceProperties DeserializeExtendedResourceProperties(JsonElement element) { Optional Rid = default; - Optional Ts = default; + Optional Ts = default; Optional Etag = default; foreach (var property in element.EnumerateObject()) { @@ -37,7 +37,7 @@ internal static ExtendedResourceProperties DeserializeExtendedResourceProperties property.ThrowNonNullablePropertyIsNull(); continue; } - Ts = property.Value.GetObject(); + Ts = property.Value.GetSingle(); continue; } if (property.NameEquals("_etag")) @@ -46,7 +46,7 @@ internal static ExtendedResourceProperties DeserializeExtendedResourceProperties continue; } } - return new ExtendedResourceProperties(Rid.Value, Ts.Value, Etag.Value); + return new ExtendedResourceProperties(Rid.Value, Optional.ToNullable(Ts), Etag.Value); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedResourceProperties.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedResourceProperties.cs index 4eff6559532bf..ba25be86ee411 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedResourceProperties.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedResourceProperties.cs @@ -19,7 +19,7 @@ public ExtendedResourceProperties() /// 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 ExtendedResourceProperties(string rid, object ts, string etag) + internal ExtendedResourceProperties(string rid, float? ts, string etag) { Rid = rid; Ts = ts; @@ -29,7 +29,7 @@ internal ExtendedResourceProperties(string rid, object ts, string etag) /// A system generated property. A unique identifier. public string Rid { get; } /// A system generated property that denotes the last updated timestamp of the resource. - public object Ts { get; } + public float? Ts { get; } /// A system generated property representing the resource etag required for optimistic concurrency control. public string Etag { get; } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseCreateUpdateParameters.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseCreateUpdateParameters.Serialization.cs index 41954710e5550..0065500ba2a89 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseCreateUpdateParameters.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseCreateUpdateParameters.Serialization.cs @@ -36,8 +36,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStartObject(); writer.WritePropertyName("resource"); writer.WriteObjectValue(Resource); - writer.WritePropertyName("options"); - writer.WriteObjectValue(Options); + if (Optional.IsDefined(Options)) + { + writer.WritePropertyName("options"); + writer.WriteObjectValue(Options); + } writer.WriteEndObject(); writer.WriteEndObject(); } @@ -50,7 +53,7 @@ internal static GremlinDatabaseCreateUpdateParameters DeserializeGremlinDatabase Optional location = default; Optional> tags = default; GremlinDatabaseResource resource = default; - CreateUpdateOptions options = default; + Optional options = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("id")) @@ -104,6 +107,11 @@ internal static GremlinDatabaseCreateUpdateParameters DeserializeGremlinDatabase } if (property0.NameEquals("options")) { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } options = CreateUpdateOptions.DeserializeCreateUpdateOptions(property0.Value); continue; } @@ -111,7 +119,7 @@ internal static GremlinDatabaseCreateUpdateParameters DeserializeGremlinDatabase continue; } } - return new GremlinDatabaseCreateUpdateParameters(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), resource, options); + return new GremlinDatabaseCreateUpdateParameters(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), resource, options.Value); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseCreateUpdateParameters.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseCreateUpdateParameters.cs index c4e3232b17626..727197c8e89b1 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseCreateUpdateParameters.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseCreateUpdateParameters.cs @@ -15,21 +15,15 @@ public partial class GremlinDatabaseCreateUpdateParameters : ARMResourceProperti { /// Initializes a new instance of GremlinDatabaseCreateUpdateParameters. /// 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. - /// or is null. - public GremlinDatabaseCreateUpdateParameters(GremlinDatabaseResource resource, CreateUpdateOptions options) + /// is null. + public GremlinDatabaseCreateUpdateParameters(GremlinDatabaseResource resource) { if (resource == null) { throw new ArgumentNullException(nameof(resource)); } - if (options == null) - { - throw new ArgumentNullException(nameof(options)); - } Resource = resource; - Options = options; } /// Initializes a new instance of GremlinDatabaseCreateUpdateParameters. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseGetPropertiesResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseGetPropertiesResource.Serialization.cs index fa8eb06568b01..ced58dc1efcca 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseGetPropertiesResource.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseGetPropertiesResource.Serialization.cs @@ -23,7 +23,7 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) internal static GremlinDatabaseGetPropertiesResource DeserializeGremlinDatabaseGetPropertiesResource(JsonElement element) { Optional Rid = default; - Optional Ts = default; + Optional Ts = default; Optional Etag = default; string id = default; foreach (var property in element.EnumerateObject()) @@ -40,7 +40,7 @@ internal static GremlinDatabaseGetPropertiesResource DeserializeGremlinDatabaseG property.ThrowNonNullablePropertyIsNull(); continue; } - Ts = property.Value.GetObject(); + Ts = property.Value.GetSingle(); continue; } if (property.NameEquals("_etag")) @@ -54,7 +54,7 @@ internal static GremlinDatabaseGetPropertiesResource DeserializeGremlinDatabaseG continue; } } - return new GremlinDatabaseGetPropertiesResource(id, Rid.Value, Ts.Value, Etag.Value); + return new GremlinDatabaseGetPropertiesResource(id, Rid.Value, Optional.ToNullable(Ts), Etag.Value); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseGetPropertiesResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseGetPropertiesResource.cs index a473d082cf52e..3f858c7ac9aa8 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseGetPropertiesResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseGetPropertiesResource.cs @@ -29,7 +29,7 @@ public GremlinDatabaseGetPropertiesResource(string id) : base(id) /// 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. /// is null. - internal GremlinDatabaseGetPropertiesResource(string id, string rid, object ts, string etag) : base(id) + internal GremlinDatabaseGetPropertiesResource(string id, string rid, float? ts, string etag) : base(id) { if (id == null) { @@ -44,7 +44,7 @@ internal GremlinDatabaseGetPropertiesResource(string id, string rid, object ts, /// A system generated property. A unique identifier. public string Rid { get; } /// A system generated property that denotes the last updated timestamp of the resource. - public object Ts { get; } + public float? Ts { get; } /// A system generated property representing the resource etag required for optimistic concurrency control. public string Etag { get; } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphCreateUpdateParameters.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphCreateUpdateParameters.Serialization.cs index f9366da482825..fa5dc18e6dbaa 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphCreateUpdateParameters.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphCreateUpdateParameters.Serialization.cs @@ -36,8 +36,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStartObject(); writer.WritePropertyName("resource"); writer.WriteObjectValue(Resource); - writer.WritePropertyName("options"); - writer.WriteObjectValue(Options); + if (Optional.IsDefined(Options)) + { + writer.WritePropertyName("options"); + writer.WriteObjectValue(Options); + } writer.WriteEndObject(); writer.WriteEndObject(); } @@ -50,7 +53,7 @@ internal static GremlinGraphCreateUpdateParameters DeserializeGremlinGraphCreate Optional location = default; Optional> tags = default; GremlinGraphResource resource = default; - CreateUpdateOptions options = default; + Optional options = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("id")) @@ -104,6 +107,11 @@ internal static GremlinGraphCreateUpdateParameters DeserializeGremlinGraphCreate } if (property0.NameEquals("options")) { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } options = CreateUpdateOptions.DeserializeCreateUpdateOptions(property0.Value); continue; } @@ -111,7 +119,7 @@ internal static GremlinGraphCreateUpdateParameters DeserializeGremlinGraphCreate continue; } } - return new GremlinGraphCreateUpdateParameters(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), resource, options); + return new GremlinGraphCreateUpdateParameters(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), resource, options.Value); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphCreateUpdateParameters.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphCreateUpdateParameters.cs index c7e490aafdb33..c8087da667008 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphCreateUpdateParameters.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphCreateUpdateParameters.cs @@ -15,21 +15,15 @@ public partial class GremlinGraphCreateUpdateParameters : ARMResourceProperties { /// Initializes a new instance of GremlinGraphCreateUpdateParameters. /// 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. - /// or is null. - public GremlinGraphCreateUpdateParameters(GremlinGraphResource resource, CreateUpdateOptions options) + /// is null. + public GremlinGraphCreateUpdateParameters(GremlinGraphResource resource) { if (resource == null) { throw new ArgumentNullException(nameof(resource)); } - if (options == null) - { - throw new ArgumentNullException(nameof(options)); - } Resource = resource; - Options = options; } /// Initializes a new instance of GremlinGraphCreateUpdateParameters. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphGetPropertiesResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphGetPropertiesResource.Serialization.cs index 2397bc0ce644d..1031d0b146af6 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphGetPropertiesResource.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphGetPropertiesResource.Serialization.cs @@ -48,7 +48,7 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) internal static GremlinGraphGetPropertiesResource DeserializeGremlinGraphGetPropertiesResource(JsonElement element) { Optional Rid = default; - Optional Ts = default; + Optional Ts = default; Optional Etag = default; string id = default; Optional indexingPolicy = default; @@ -70,7 +70,7 @@ internal static GremlinGraphGetPropertiesResource DeserializeGremlinGraphGetProp property.ThrowNonNullablePropertyIsNull(); continue; } - Ts = property.Value.GetObject(); + Ts = property.Value.GetSingle(); continue; } if (property.NameEquals("_etag")) @@ -134,7 +134,7 @@ internal static GremlinGraphGetPropertiesResource DeserializeGremlinGraphGetProp continue; } } - return new GremlinGraphGetPropertiesResource(id, indexingPolicy.Value, partitionKey.Value, Optional.ToNullable(defaultTtl), uniqueKeyPolicy.Value, conflictResolutionPolicy.Value, Rid.Value, Ts.Value, Etag.Value); + return new GremlinGraphGetPropertiesResource(id, indexingPolicy.Value, partitionKey.Value, Optional.ToNullable(defaultTtl), uniqueKeyPolicy.Value, conflictResolutionPolicy.Value, Rid.Value, Optional.ToNullable(Ts), Etag.Value); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphGetPropertiesResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphGetPropertiesResource.cs index 86fedb392bfec..f1d6a26d5d664 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphGetPropertiesResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphGetPropertiesResource.cs @@ -33,7 +33,7 @@ public GremlinGraphGetPropertiesResource(string id) : base(id) /// 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 GremlinGraphGetPropertiesResource(string id, IndexingPolicy indexingPolicy, ContainerPartitionKey partitionKey, int? defaultTtl, UniqueKeyPolicy uniqueKeyPolicy, ConflictResolutionPolicy conflictResolutionPolicy, string rid, object ts, string etag) : base(id, indexingPolicy, partitionKey, defaultTtl, uniqueKeyPolicy, conflictResolutionPolicy) + internal GremlinGraphGetPropertiesResource(string id, IndexingPolicy indexingPolicy, ContainerPartitionKey partitionKey, int? defaultTtl, UniqueKeyPolicy uniqueKeyPolicy, ConflictResolutionPolicy conflictResolutionPolicy, string rid, float? ts, string etag) : base(id, indexingPolicy, partitionKey, defaultTtl, uniqueKeyPolicy, conflictResolutionPolicy) { Rid = rid; Ts = ts; @@ -43,7 +43,7 @@ internal GremlinGraphGetPropertiesResource(string id, IndexingPolicy indexingPol /// A system generated property. A unique identifier. public string Rid { get; } /// A system generated property that denotes the last updated timestamp of the resource. - public object Ts { get; } + public float? Ts { get; } /// A system generated property representing the resource etag required for optimistic concurrency control. public string Etag { get; } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/IndexingMode.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/IndexingMode.cs index 8a13d561f11b0..b59776600156b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/IndexingMode.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/IndexingMode.cs @@ -22,15 +22,15 @@ public IndexingMode(string value) _value = value ?? throw new ArgumentNullException(nameof(value)); } - private const string ConsistentValue = "Consistent"; - private const string LazyValue = "Lazy"; - private const string NoneValue = "None"; + private const string ConsistentValue = "consistent"; + private const string LazyValue = "lazy"; + private const string NoneValue = "none"; - /// Consistent. + /// consistent. public static IndexingMode Consistent { get; } = new IndexingMode(ConsistentValue); - /// Lazy. + /// lazy. public static IndexingMode Lazy { get; } = new IndexingMode(LazyValue); - /// None. + /// none. public static IndexingMode None { get; } = new IndexingMode(NoneValue); /// Determines if two values are the same. public static bool operator ==(IndexingMode left, IndexingMode right) => left.Equals(right); diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ManagedServiceIdentity.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ManagedServiceIdentity.Serialization.cs new file mode 100644 index 0000000000000..195a8b4477b11 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ManagedServiceIdentity.Serialization.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class ManagedServiceIdentity : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"); + writer.WriteStringValue(Type.Value.ToSerialString()); + } + if (Optional.IsCollectionDefined(UserAssignedIdentities)) + { + writer.WritePropertyName("userAssignedIdentities"); + writer.WriteStartObject(); + foreach (var item in UserAssignedIdentities) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WriteEndObject(); + } + + internal static ManagedServiceIdentity DeserializeManagedServiceIdentity(JsonElement element) + { + Optional principalId = default; + Optional tenantId = default; + Optional type = default; + Optional> userAssignedIdentities = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("principalId")) + { + principalId = property.Value.GetString(); + continue; + } + if (property.NameEquals("tenantId")) + { + tenantId = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + type = property.Value.GetString().ToResourceIdentityType(); + continue; + } + if (property.NameEquals("userAssignedIdentities")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties.DeserializeComponents1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties(property0.Value)); + } + userAssignedIdentities = dictionary; + continue; + } + } + return new ManagedServiceIdentity(principalId.Value, tenantId.Value, Optional.ToNullable(type), Optional.ToDictionary(userAssignedIdentities)); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ManagedServiceIdentity.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ManagedServiceIdentity.cs new file mode 100644 index 0000000000000..bbade7edf7101 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ManagedServiceIdentity.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// Identity for the resource. + public partial class ManagedServiceIdentity + { + /// Initializes a new instance of ManagedServiceIdentity. + public ManagedServiceIdentity() + { + UserAssignedIdentities = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of ManagedServiceIdentity. + /// The principal id of the system assigned identity. This property will only be provided for a system assigned identity. + /// The tenant id of the system assigned identity. This property will only be provided for a system assigned identity. + /// The type of identity used for the resource. The type 'SystemAssigned,UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service. + /// The list of user identities associated with resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + internal ManagedServiceIdentity(string principalId, string tenantId, ResourceIdentityType? type, IDictionary userAssignedIdentities) + { + PrincipalId = principalId; + TenantId = tenantId; + Type = type; + UserAssignedIdentities = userAssignedIdentities; + } + + /// The principal id of the system assigned identity. This property will only be provided for a system assigned identity. + public string PrincipalId { get; } + /// The tenant id of the system assigned identity. This property will only be provided for a system assigned identity. + public string TenantId { get; } + /// The type of identity used for the resource. The type 'SystemAssigned,UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service. + public ResourceIdentityType? Type { get; set; } + /// The list of user identities associated with resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + public IDictionary UserAssignedIdentities { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionCreateUpdateParameters.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionCreateUpdateParameters.Serialization.cs index 73b5c0b0e80ab..058399b926a5d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionCreateUpdateParameters.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionCreateUpdateParameters.Serialization.cs @@ -36,8 +36,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStartObject(); writer.WritePropertyName("resource"); writer.WriteObjectValue(Resource); - writer.WritePropertyName("options"); - writer.WriteObjectValue(Options); + if (Optional.IsDefined(Options)) + { + writer.WritePropertyName("options"); + writer.WriteObjectValue(Options); + } writer.WriteEndObject(); writer.WriteEndObject(); } @@ -50,7 +53,7 @@ internal static MongoDBCollectionCreateUpdateParameters DeserializeMongoDBCollec Optional location = default; Optional> tags = default; MongoDBCollectionResource resource = default; - CreateUpdateOptions options = default; + Optional options = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("id")) @@ -104,6 +107,11 @@ internal static MongoDBCollectionCreateUpdateParameters DeserializeMongoDBCollec } if (property0.NameEquals("options")) { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } options = CreateUpdateOptions.DeserializeCreateUpdateOptions(property0.Value); continue; } @@ -111,7 +119,7 @@ internal static MongoDBCollectionCreateUpdateParameters DeserializeMongoDBCollec continue; } } - return new MongoDBCollectionCreateUpdateParameters(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), resource, options); + return new MongoDBCollectionCreateUpdateParameters(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), resource, options.Value); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionCreateUpdateParameters.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionCreateUpdateParameters.cs index a90e34e126805..7d135a13ca863 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionCreateUpdateParameters.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionCreateUpdateParameters.cs @@ -15,21 +15,15 @@ public partial class MongoDBCollectionCreateUpdateParameters : ARMResourceProper { /// Initializes a new instance of MongoDBCollectionCreateUpdateParameters. /// 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. - /// or is null. - public MongoDBCollectionCreateUpdateParameters(MongoDBCollectionResource resource, CreateUpdateOptions options) + /// is null. + public MongoDBCollectionCreateUpdateParameters(MongoDBCollectionResource resource) { if (resource == null) { throw new ArgumentNullException(nameof(resource)); } - if (options == null) - { - throw new ArgumentNullException(nameof(options)); - } Resource = resource; - Options = options; } /// Initializes a new instance of MongoDBCollectionCreateUpdateParameters. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionGetPropertiesResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionGetPropertiesResource.Serialization.cs index 1fa772f22930a..abdcdfeabc9e1 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionGetPropertiesResource.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionGetPropertiesResource.Serialization.cs @@ -50,7 +50,7 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) internal static MongoDBCollectionGetPropertiesResource DeserializeMongoDBCollectionGetPropertiesResource(JsonElement element) { Optional Rid = default; - Optional Ts = default; + Optional Ts = default; Optional Etag = default; string id = default; Optional> shardKey = default; @@ -70,7 +70,7 @@ internal static MongoDBCollectionGetPropertiesResource DeserializeMongoDBCollect property.ThrowNonNullablePropertyIsNull(); continue; } - Ts = property.Value.GetObject(); + Ts = property.Value.GetSingle(); continue; } if (property.NameEquals("_etag")) @@ -124,7 +124,7 @@ internal static MongoDBCollectionGetPropertiesResource DeserializeMongoDBCollect continue; } } - return new MongoDBCollectionGetPropertiesResource(id, Optional.ToDictionary(shardKey), Optional.ToList(indexes), Optional.ToNullable(analyticalStorageTtl), Rid.Value, Ts.Value, Etag.Value); + return new MongoDBCollectionGetPropertiesResource(id, Optional.ToDictionary(shardKey), Optional.ToList(indexes), Optional.ToNullable(analyticalStorageTtl), Rid.Value, Optional.ToNullable(Ts), Etag.Value); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionGetPropertiesResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionGetPropertiesResource.cs index 2a9a7929bbc28..177064799a7e2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionGetPropertiesResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionGetPropertiesResource.cs @@ -32,7 +32,7 @@ public MongoDBCollectionGetPropertiesResource(string id) : base(id) /// 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 MongoDBCollectionGetPropertiesResource(string id, IDictionary shardKey, IList indexes, int? analyticalStorageTtl, string rid, object ts, string etag) : base(id, shardKey, indexes, analyticalStorageTtl) + internal MongoDBCollectionGetPropertiesResource(string id, IDictionary shardKey, IList indexes, int? analyticalStorageTtl, string rid, float? ts, string etag) : base(id, shardKey, indexes, analyticalStorageTtl) { Rid = rid; Ts = ts; @@ -42,7 +42,7 @@ internal MongoDBCollectionGetPropertiesResource(string id, IDictionary A system generated property. A unique identifier. public string Rid { get; } /// A system generated property that denotes the last updated timestamp of the resource. - public object Ts { get; } + public float? Ts { get; } /// A system generated property representing the resource etag required for optimistic concurrency control. public string Etag { get; } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseCreateUpdateParameters.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseCreateUpdateParameters.Serialization.cs index 7f37bab0dda24..66246d5fa2546 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseCreateUpdateParameters.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseCreateUpdateParameters.Serialization.cs @@ -36,8 +36,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStartObject(); writer.WritePropertyName("resource"); writer.WriteObjectValue(Resource); - writer.WritePropertyName("options"); - writer.WriteObjectValue(Options); + if (Optional.IsDefined(Options)) + { + writer.WritePropertyName("options"); + writer.WriteObjectValue(Options); + } writer.WriteEndObject(); writer.WriteEndObject(); } @@ -50,7 +53,7 @@ internal static MongoDBDatabaseCreateUpdateParameters DeserializeMongoDBDatabase Optional location = default; Optional> tags = default; MongoDBDatabaseResource resource = default; - CreateUpdateOptions options = default; + Optional options = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("id")) @@ -104,6 +107,11 @@ internal static MongoDBDatabaseCreateUpdateParameters DeserializeMongoDBDatabase } if (property0.NameEquals("options")) { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } options = CreateUpdateOptions.DeserializeCreateUpdateOptions(property0.Value); continue; } @@ -111,7 +119,7 @@ internal static MongoDBDatabaseCreateUpdateParameters DeserializeMongoDBDatabase continue; } } - return new MongoDBDatabaseCreateUpdateParameters(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), resource, options); + return new MongoDBDatabaseCreateUpdateParameters(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), resource, options.Value); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseCreateUpdateParameters.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseCreateUpdateParameters.cs index 6a5b9699331a2..7e41e79fbe139 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseCreateUpdateParameters.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseCreateUpdateParameters.cs @@ -15,21 +15,15 @@ public partial class MongoDBDatabaseCreateUpdateParameters : ARMResourceProperti { /// Initializes a new instance of MongoDBDatabaseCreateUpdateParameters. /// 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. - /// or is null. - public MongoDBDatabaseCreateUpdateParameters(MongoDBDatabaseResource resource, CreateUpdateOptions options) + /// is null. + public MongoDBDatabaseCreateUpdateParameters(MongoDBDatabaseResource resource) { if (resource == null) { throw new ArgumentNullException(nameof(resource)); } - if (options == null) - { - throw new ArgumentNullException(nameof(options)); - } Resource = resource; - Options = options; } /// Initializes a new instance of MongoDBDatabaseCreateUpdateParameters. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseGetPropertiesResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseGetPropertiesResource.Serialization.cs index 1041482fc78e8..7a704ad6b2650 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseGetPropertiesResource.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseGetPropertiesResource.Serialization.cs @@ -23,7 +23,7 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) internal static MongoDBDatabaseGetPropertiesResource DeserializeMongoDBDatabaseGetPropertiesResource(JsonElement element) { Optional Rid = default; - Optional Ts = default; + Optional Ts = default; Optional Etag = default; string id = default; foreach (var property in element.EnumerateObject()) @@ -40,7 +40,7 @@ internal static MongoDBDatabaseGetPropertiesResource DeserializeMongoDBDatabaseG property.ThrowNonNullablePropertyIsNull(); continue; } - Ts = property.Value.GetObject(); + Ts = property.Value.GetSingle(); continue; } if (property.NameEquals("_etag")) @@ -54,7 +54,7 @@ internal static MongoDBDatabaseGetPropertiesResource DeserializeMongoDBDatabaseG continue; } } - return new MongoDBDatabaseGetPropertiesResource(id, Rid.Value, Ts.Value, Etag.Value); + return new MongoDBDatabaseGetPropertiesResource(id, Rid.Value, Optional.ToNullable(Ts), Etag.Value); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseGetPropertiesResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseGetPropertiesResource.cs index 7d5cd689ca2da..c1463e3058475 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseGetPropertiesResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseGetPropertiesResource.cs @@ -29,7 +29,7 @@ public MongoDBDatabaseGetPropertiesResource(string id) : base(id) /// 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. /// is null. - internal MongoDBDatabaseGetPropertiesResource(string id, string rid, object ts, string etag) : base(id) + internal MongoDBDatabaseGetPropertiesResource(string id, string rid, float? ts, string etag) : base(id) { if (id == null) { @@ -44,7 +44,7 @@ internal MongoDBDatabaseGetPropertiesResource(string id, string rid, object ts, /// A system generated property. A unique identifier. public string Rid { get; } /// A system generated property that denotes the last updated timestamp of the resource. - public object Ts { get; } + public float? Ts { get; } /// A system generated property representing the resource etag required for optimistic concurrency control. public string Etag { get; } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkAclBypass.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkAclBypass.Serialization.cs new file mode 100644 index 0000000000000..a450e60059489 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkAclBypass.Serialization.cs @@ -0,0 +1,28 @@ +// 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 NetworkAclBypassExtensions + { + public static string ToSerialString(this NetworkAclBypass value) => value switch + { + NetworkAclBypass.None => "None", + NetworkAclBypass.AzureServices => "AzureServices", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown NetworkAclBypass value.") + }; + + public static NetworkAclBypass ToNetworkAclBypass(this string value) + { + if (string.Equals(value, "None", StringComparison.InvariantCultureIgnoreCase)) return NetworkAclBypass.None; + if (string.Equals(value, "AzureServices", StringComparison.InvariantCultureIgnoreCase)) return NetworkAclBypass.AzureServices; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown NetworkAclBypass value."); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkAclBypass.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkAclBypass.cs new file mode 100644 index 0000000000000..d337f5ecfb5e1 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkAclBypass.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// Indicates what services are allowed to bypass firewall checks. + public enum NetworkAclBypass + { + /// None. + None, + /// AzureServices. + AzureServices + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/OperationType.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/OperationType.cs new file mode 100644 index 0000000000000..3104fdaf20072 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/OperationType.cs @@ -0,0 +1,57 @@ +// 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 the operation type of the event. + public readonly partial struct OperationType : IEquatable + { + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public OperationType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CreateValue = "Create"; + private const string ReplaceValue = "Replace"; + private const string DeleteValue = "Delete"; + private const string SystemOperationValue = "SystemOperation"; + + /// Create. + public static OperationType Create { get; } = new OperationType(CreateValue); + /// Replace. + public static OperationType Replace { get; } = new OperationType(ReplaceValue); + /// Delete. + public static OperationType Delete { get; } = new OperationType(DeleteValue); + /// SystemOperation. + public static OperationType SystemOperation { get; } = new OperationType(SystemOperationValue); + /// Determines if two values are the same. + public static bool operator ==(OperationType left, OperationType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(OperationType left, OperationType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator OperationType(string value) => new OperationType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is OperationType other && Equals(other); + /// + public bool Equals(OperationType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PartitionKind.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PartitionKind.cs index 7b7f428085d0c..9b3fcb4f7f24f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PartitionKind.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PartitionKind.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.CosmosDB.Models { - /// Indicates the kind of algorithm used for partitioning. + /// Indicates the kind of algorithm used for partitioning. For MultiHash, multiple partition keys (upto three maximum) are supported for container create. public readonly partial struct PartitionKind : IEquatable { private readonly string _value; @@ -24,11 +24,14 @@ public PartitionKind(string value) private const string HashValue = "Hash"; private const string RangeValue = "Range"; + private const string MultiHashValue = "MultiHash"; /// Hash. public static PartitionKind Hash { get; } = new PartitionKind(HashValue); /// Range. public static PartitionKind Range { get; } = new PartitionKind(RangeValue); + /// MultiHash. + public static PartitionKind MultiHash { get; } = new PartitionKind(MultiHashValue); /// Determines if two values are the same. public static bool operator ==(PartitionKind left, PartitionKind right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PeriodicModeBackupPolicy.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PeriodicModeBackupPolicy.Serialization.cs new file mode 100644 index 0000000000000..257fa9086a808 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PeriodicModeBackupPolicy.Serialization.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class PeriodicModeBackupPolicy : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(PeriodicModeProperties)) + { + writer.WritePropertyName("periodicModeProperties"); + writer.WriteObjectValue(PeriodicModeProperties); + } + writer.WritePropertyName("type"); + writer.WriteStringValue(Type.ToString()); + if (Optional.IsDefined(MigrationState)) + { + writer.WritePropertyName("migrationState"); + writer.WriteObjectValue(MigrationState); + } + writer.WriteEndObject(); + } + + internal static PeriodicModeBackupPolicy DeserializePeriodicModeBackupPolicy(JsonElement element) + { + Optional periodicModeProperties = default; + BackupPolicyType type = default; + Optional migrationState = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("periodicModeProperties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + periodicModeProperties = PeriodicModeProperties.DeserializePeriodicModeProperties(property.Value); + continue; + } + if (property.NameEquals("type")) + { + type = new BackupPolicyType(property.Value.GetString()); + continue; + } + if (property.NameEquals("migrationState")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + migrationState = BackupPolicyMigrationState.DeserializeBackupPolicyMigrationState(property.Value); + continue; + } + } + return new PeriodicModeBackupPolicy(type, migrationState.Value, periodicModeProperties.Value); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PeriodicModeBackupPolicy.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PeriodicModeBackupPolicy.cs new file mode 100644 index 0000000000000..f2273096ff2d3 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PeriodicModeBackupPolicy.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The object representing periodic mode backup policy. + public partial class PeriodicModeBackupPolicy : BackupPolicy + { + /// Initializes a new instance of PeriodicModeBackupPolicy. + public PeriodicModeBackupPolicy() + { + Type = BackupPolicyType.Periodic; + } + + /// Initializes a new instance of PeriodicModeBackupPolicy. + /// Describes the mode of backups. + /// The object representing the state of the migration between the backup policies. + /// Configuration values for periodic mode backup. + internal PeriodicModeBackupPolicy(BackupPolicyType type, BackupPolicyMigrationState migrationState, PeriodicModeProperties periodicModeProperties) : base(type, migrationState) + { + PeriodicModeProperties = periodicModeProperties; + Type = type; + } + + /// Configuration values for periodic mode backup. + public PeriodicModeProperties PeriodicModeProperties { get; set; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PeriodicModeProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PeriodicModeProperties.Serialization.cs new file mode 100644 index 0000000000000..d9390c4379946 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PeriodicModeProperties.Serialization.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class PeriodicModeProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(BackupIntervalInMinutes)) + { + writer.WritePropertyName("backupIntervalInMinutes"); + writer.WriteNumberValue(BackupIntervalInMinutes.Value); + } + if (Optional.IsDefined(BackupRetentionIntervalInHours)) + { + writer.WritePropertyName("backupRetentionIntervalInHours"); + writer.WriteNumberValue(BackupRetentionIntervalInHours.Value); + } + writer.WriteEndObject(); + } + + internal static PeriodicModeProperties DeserializePeriodicModeProperties(JsonElement element) + { + Optional backupIntervalInMinutes = default; + Optional backupRetentionIntervalInHours = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("backupIntervalInMinutes")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + backupIntervalInMinutes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("backupRetentionIntervalInHours")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + backupRetentionIntervalInHours = property.Value.GetInt32(); + continue; + } + } + return new PeriodicModeProperties(Optional.ToNullable(backupIntervalInMinutes), Optional.ToNullable(backupRetentionIntervalInHours)); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PeriodicModeProperties.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PeriodicModeProperties.cs new file mode 100644 index 0000000000000..65017d1785f3b --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PeriodicModeProperties.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// Configuration values for periodic mode backup. + public partial class PeriodicModeProperties + { + /// Initializes a new instance of PeriodicModeProperties. + public PeriodicModeProperties() + { + } + + /// Initializes a new instance of PeriodicModeProperties. + /// An integer representing the interval in minutes between two backups. + /// An integer representing the time (in hours) that each backup is retained. + internal PeriodicModeProperties(int? backupIntervalInMinutes, int? backupRetentionIntervalInHours) + { + BackupIntervalInMinutes = backupIntervalInMinutes; + BackupRetentionIntervalInHours = backupRetentionIntervalInHours; + } + + /// An integer representing the interval in minutes between two backups. + public int? BackupIntervalInMinutes { get; set; } + /// An integer representing the time (in hours) that each backup is retained. + public int? BackupRetentionIntervalInHours { get; set; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Permission.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Permission.Serialization.cs new file mode 100644 index 0000000000000..17ed38d0673fc --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Permission.Serialization.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class Permission : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(DataActions)) + { + writer.WritePropertyName("dataActions"); + writer.WriteStartArray(); + foreach (var item in DataActions) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(NotDataActions)) + { + writer.WritePropertyName("notDataActions"); + writer.WriteStartArray(); + foreach (var item in NotDataActions) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static Permission DeserializePermission(JsonElement element) + { + Optional> dataActions = default; + Optional> notDataActions = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("dataActions")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + dataActions = array; + continue; + } + if (property.NameEquals("notDataActions")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + notDataActions = array; + continue; + } + } + return new Permission(Optional.ToList(dataActions), Optional.ToList(notDataActions)); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Permission.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Permission.cs new file mode 100644 index 0000000000000..7d0240ea65c5a --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Permission.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The set of data plane operations permitted through this Role Definition. + public partial class Permission + { + /// Initializes a new instance of Permission. + public Permission() + { + DataActions = new ChangeTrackingList(); + NotDataActions = new ChangeTrackingList(); + } + + /// Initializes a new instance of Permission. + /// An array of data actions that are allowed. + /// An array of data actions that are denied. + internal Permission(IList dataActions, IList notDataActions) + { + DataActions = dataActions; + NotDataActions = notDataActions; + } + + /// An array of data actions that are allowed. + public IList DataActions { get; } + /// An array of data actions that are denied. + public IList NotDataActions { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateEndpointConnection.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateEndpointConnection.Serialization.cs index 5e81e767f56dc..23f38b983d362 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateEndpointConnection.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateEndpointConnection.Serialization.cs @@ -27,6 +27,16 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("privateLinkServiceConnectionState"); writer.WriteObjectValue(PrivateLinkServiceConnectionState); } + if (Optional.IsDefined(GroupId)) + { + writer.WritePropertyName("groupId"); + writer.WriteStringValue(GroupId); + } + if (Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"); + writer.WriteStringValue(ProvisioningState); + } writer.WriteEndObject(); writer.WriteEndObject(); } @@ -38,6 +48,8 @@ internal static PrivateEndpointConnection DeserializePrivateEndpointConnection(J Optional type = default; Optional privateEndpoint = default; Optional privateLinkServiceConnectionState = default; + Optional groupId = default; + Optional provisioningState = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("id")) @@ -84,11 +96,21 @@ internal static PrivateEndpointConnection DeserializePrivateEndpointConnection(J privateLinkServiceConnectionState = PrivateLinkServiceConnectionStateProperty.DeserializePrivateLinkServiceConnectionStateProperty(property0.Value); continue; } + if (property0.NameEquals("groupId")) + { + groupId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("provisioningState")) + { + provisioningState = property0.Value.GetString(); + continue; + } } continue; } } - return new PrivateEndpointConnection(id.Value, name.Value, type.Value, privateEndpoint.Value, privateLinkServiceConnectionState.Value); + return new PrivateEndpointConnection(id.Value, name.Value, type.Value, privateEndpoint.Value, privateLinkServiceConnectionState.Value, groupId.Value, provisioningState.Value); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateEndpointConnection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateEndpointConnection.cs index 72f157fcec64a..8182fb40ead98 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateEndpointConnection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateEndpointConnection.cs @@ -16,20 +16,28 @@ public PrivateEndpointConnection() } /// Initializes a new instance of PrivateEndpointConnection. - /// Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. /// The name of the resource. - /// The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". /// Private endpoint which the connection belongs to. /// Connection State of the Private Endpoint Connection. - internal PrivateEndpointConnection(string id, string name, string type, PrivateEndpointProperty privateEndpoint, PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState) : base(id, name, type) + /// Group id of the private endpoint. + /// Provisioning state of the private endpoint. + internal PrivateEndpointConnection(string id, string name, string type, PrivateEndpointProperty privateEndpoint, PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState, string groupId, string provisioningState) : base(id, name, type) { PrivateEndpoint = privateEndpoint; PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; + GroupId = groupId; + ProvisioningState = provisioningState; } /// Private endpoint which the connection belongs to. public PrivateEndpointProperty PrivateEndpoint { get; set; } /// Connection State of the Private Endpoint Connection. public PrivateLinkServiceConnectionStateProperty PrivateLinkServiceConnectionState { get; set; } + /// Group id of the private endpoint. + public string GroupId { get; set; } + /// Provisioning state of the private endpoint. + public string ProvisioningState { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateEndpointConnectionAutoGenerated.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateEndpointConnectionAutoGenerated.Serialization.cs deleted file mode 100644 index 698b916a8dc34..0000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateEndpointConnectionAutoGenerated.Serialization.cs +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class PrivateEndpointConnectionAutoGenerated : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(PrivateEndpoint)) - { - writer.WritePropertyName("privateEndpoint"); - writer.WriteObjectValue(PrivateEndpoint); - } - if (Optional.IsDefined(PrivateLinkServiceConnectionState)) - { - writer.WritePropertyName("privateLinkServiceConnectionState"); - writer.WriteObjectValue(PrivateLinkServiceConnectionState); - } - if (Optional.IsDefined(GroupId)) - { - writer.WritePropertyName("groupId"); - writer.WriteStringValue(GroupId); - } - if (Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"); - writer.WriteStringValue(ProvisioningState); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static PrivateEndpointConnectionAutoGenerated DeserializePrivateEndpointConnectionAutoGenerated(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional type = default; - Optional privateEndpoint = default; - Optional privateLinkServiceConnectionState = default; - Optional groupId = default; - Optional provisioningState = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("privateEndpoint")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - privateEndpoint = PrivateEndpointProperty.DeserializePrivateEndpointProperty(property0.Value); - continue; - } - if (property0.NameEquals("privateLinkServiceConnectionState")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - privateLinkServiceConnectionState = PrivateLinkServiceConnectionStatePropertyAutoGenerated.DeserializePrivateLinkServiceConnectionStatePropertyAutoGenerated(property0.Value); - continue; - } - if (property0.NameEquals("groupId")) - { - groupId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("provisioningState")) - { - provisioningState = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new PrivateEndpointConnectionAutoGenerated(id.Value, name.Value, type.Value, privateEndpoint.Value, privateLinkServiceConnectionState.Value, groupId.Value, provisioningState.Value); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateEndpointConnectionAutoGenerated.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateEndpointConnectionAutoGenerated.cs deleted file mode 100644 index 3e3ab75c7b72a..0000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateEndpointConnectionAutoGenerated.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// A private endpoint connection. - public partial class PrivateEndpointConnectionAutoGenerated : ProxyResource - { - /// Initializes a new instance of PrivateEndpointConnectionAutoGenerated. - public PrivateEndpointConnectionAutoGenerated() - { - } - - /// Initializes a new instance of PrivateEndpointConnectionAutoGenerated. - /// Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - /// The name of the resource. - /// The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - /// Private endpoint which the connection belongs to. - /// Connection State of the Private Endpoint Connection. - /// Group id of the private endpoint. - /// Provisioning state of the private endpoint. - internal PrivateEndpointConnectionAutoGenerated(string id, string name, string type, PrivateEndpointProperty privateEndpoint, PrivateLinkServiceConnectionStatePropertyAutoGenerated privateLinkServiceConnectionState, string groupId, string provisioningState) : base(id, name, type) - { - PrivateEndpoint = privateEndpoint; - PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; - GroupId = groupId; - ProvisioningState = provisioningState; - } - - /// Private endpoint which the connection belongs to. - public PrivateEndpointProperty PrivateEndpoint { get; set; } - /// Connection State of the Private Endpoint Connection. - public PrivateLinkServiceConnectionStatePropertyAutoGenerated PrivateLinkServiceConnectionState { get; set; } - /// Group id of the private endpoint. - public string GroupId { get; set; } - /// Provisioning state of the private endpoint. - public string ProvisioningState { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateEndpointConnectionListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateEndpointConnectionListResult.Serialization.cs index a939292bb87bf..60c7816c4a661 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateEndpointConnectionListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateEndpointConnectionListResult.Serialization.cs @@ -15,7 +15,7 @@ internal partial class PrivateEndpointConnectionListResult { internal static PrivateEndpointConnectionListResult DeserializePrivateEndpointConnectionListResult(JsonElement element) { - Optional> value = default; + Optional> value = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value")) @@ -25,10 +25,10 @@ internal static PrivateEndpointConnectionListResult DeserializePrivateEndpointCo property.ThrowNonNullablePropertyIsNull(); continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(PrivateEndpointConnectionAutoGenerated.DeserializePrivateEndpointConnectionAutoGenerated(item)); + array.Add(PrivateEndpointConnection.DeserializePrivateEndpointConnection(item)); } value = array; continue; diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateEndpointConnectionListResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateEndpointConnectionListResult.cs index 00915d328ad28..b1d039233b024 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateEndpointConnectionListResult.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateEndpointConnectionListResult.cs @@ -16,17 +16,17 @@ internal partial class PrivateEndpointConnectionListResult /// Initializes a new instance of PrivateEndpointConnectionListResult. internal PrivateEndpointConnectionListResult() { - Value = new ChangeTrackingList(); + Value = new ChangeTrackingList(); } /// Initializes a new instance of PrivateEndpointConnectionListResult. /// Array of private endpoint connections. - internal PrivateEndpointConnectionListResult(IReadOnlyList value) + internal PrivateEndpointConnectionListResult(IReadOnlyList value) { Value = value; } /// Array of private endpoint connections. - public IReadOnlyList Value { get; } + public IReadOnlyList Value { get; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateLinkServiceConnectionStateProperty.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateLinkServiceConnectionStateProperty.Serialization.cs index 4ba4d384e5bdc..061762d0b5d9b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateLinkServiceConnectionStateProperty.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateLinkServiceConnectionStateProperty.Serialization.cs @@ -20,12 +20,18 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("status"); writer.WriteStringValue(Status); } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(Description); + } writer.WriteEndObject(); } internal static PrivateLinkServiceConnectionStateProperty DeserializePrivateLinkServiceConnectionStateProperty(JsonElement element) { Optional status = default; + Optional description = default; Optional actionsRequired = default; foreach (var property in element.EnumerateObject()) { @@ -34,13 +40,18 @@ internal static PrivateLinkServiceConnectionStateProperty DeserializePrivateLink status = property.Value.GetString(); continue; } + if (property.NameEquals("description")) + { + description = property.Value.GetString(); + continue; + } if (property.NameEquals("actionsRequired")) { actionsRequired = property.Value.GetString(); continue; } } - return new PrivateLinkServiceConnectionStateProperty(status.Value, actionsRequired.Value); + return new PrivateLinkServiceConnectionStateProperty(status.Value, description.Value, actionsRequired.Value); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateLinkServiceConnectionStateProperty.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateLinkServiceConnectionStateProperty.cs index fa6662ae6f3d1..b226917029ee3 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateLinkServiceConnectionStateProperty.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateLinkServiceConnectionStateProperty.cs @@ -17,15 +17,19 @@ public PrivateLinkServiceConnectionStateProperty() /// Initializes a new instance of PrivateLinkServiceConnectionStateProperty. /// The private link service connection status. + /// The private link service connection description. /// Any action that is required beyond basic workflow (approve/ reject/ disconnect). - internal PrivateLinkServiceConnectionStateProperty(string status, string actionsRequired) + internal PrivateLinkServiceConnectionStateProperty(string status, string description, string actionsRequired) { Status = status; + Description = description; ActionsRequired = actionsRequired; } /// The private link service connection status. public string Status { get; set; } + /// The private link service connection description. + public string Description { get; set; } /// Any action that is required beyond basic workflow (approve/ reject/ disconnect). public string ActionsRequired { get; } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateLinkServiceConnectionStatePropertyAutoGenerated.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateLinkServiceConnectionStatePropertyAutoGenerated.Serialization.cs deleted file mode 100644 index 72fff8588b4a5..0000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateLinkServiceConnectionStatePropertyAutoGenerated.Serialization.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class PrivateLinkServiceConnectionStatePropertyAutoGenerated : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"); - writer.WriteStringValue(Status); - } - if (Optional.IsDefined(Description)) - { - writer.WritePropertyName("description"); - writer.WriteStringValue(Description); - } - writer.WriteEndObject(); - } - - internal static PrivateLinkServiceConnectionStatePropertyAutoGenerated DeserializePrivateLinkServiceConnectionStatePropertyAutoGenerated(JsonElement element) - { - Optional status = default; - Optional description = default; - Optional actionsRequired = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("status")) - { - status = property.Value.GetString(); - continue; - } - if (property.NameEquals("description")) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("actionsRequired")) - { - actionsRequired = property.Value.GetString(); - continue; - } - } - return new PrivateLinkServiceConnectionStatePropertyAutoGenerated(status.Value, description.Value, actionsRequired.Value); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateLinkServiceConnectionStatePropertyAutoGenerated.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateLinkServiceConnectionStatePropertyAutoGenerated.cs deleted file mode 100644 index bec93e5e28d17..0000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateLinkServiceConnectionStatePropertyAutoGenerated.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Connection State of the Private Endpoint Connection. - public partial class PrivateLinkServiceConnectionStatePropertyAutoGenerated - { - /// Initializes a new instance of PrivateLinkServiceConnectionStatePropertyAutoGenerated. - public PrivateLinkServiceConnectionStatePropertyAutoGenerated() - { - } - - /// Initializes a new instance of PrivateLinkServiceConnectionStatePropertyAutoGenerated. - /// The private link service connection status. - /// The private link service connection description. - /// Any action that is required beyond basic workflow (approve/ reject/ disconnect). - internal PrivateLinkServiceConnectionStatePropertyAutoGenerated(string status, string description, string actionsRequired) - { - Status = status; - Description = description; - ActionsRequired = actionsRequired; - } - - /// The private link service connection status. - public string Status { get; set; } - /// The private link service connection description. - public string Description { get; set; } - /// Any action that is required beyond basic workflow (approve/ reject/ disconnect). - public string ActionsRequired { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProxyResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProxyResource.cs index a26a3e3cde893..72206447f90a4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProxyResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProxyResource.cs @@ -7,7 +7,7 @@ namespace Azure.ResourceManager.CosmosDB.Models { - /// The resource model definition for a ARM proxy resource. It will have everything other than required location and tags. + /// The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. public partial class ProxyResource : Resource { /// Initializes a new instance of ProxyResource. @@ -16,9 +16,9 @@ public ProxyResource() } /// Initializes a new instance of ProxyResource. - /// Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. /// The name of the resource. - /// The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". internal ProxyResource(string id, string name, string type) : base(id, name, type) { } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Resource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Resource.cs index 51c36262af053..91d32ef93a5c1 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Resource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Resource.cs @@ -7,7 +7,7 @@ namespace Azure.ResourceManager.CosmosDB.Models { - /// The Resource. + /// Common fields that are returned in the response for all Azure Resource Manager resources. public partial class Resource { /// Initializes a new instance of Resource. @@ -16,9 +16,9 @@ public Resource() } /// Initializes a new instance of Resource. - /// Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. /// The name of the resource. - /// The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". internal Resource(string id, string name, string type) { Id = id; @@ -26,11 +26,11 @@ internal Resource(string id, string name, string type) Type = type; } - /// Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. public string Id { get; } /// The name of the resource. public string Name { get; } - /// The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". public string Type { get; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceIdentityType.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceIdentityType.Serialization.cs new file mode 100644 index 0000000000000..86c2eef1f53fa --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceIdentityType.Serialization.cs @@ -0,0 +1,32 @@ +// 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 ResourceIdentityTypeExtensions + { + public static string ToSerialString(this ResourceIdentityType value) => value switch + { + ResourceIdentityType.SystemAssigned => "SystemAssigned", + ResourceIdentityType.UserAssigned => "UserAssigned", + ResourceIdentityType.SystemAssignedUserAssigned => "SystemAssigned,UserAssigned", + ResourceIdentityType.None => "None", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ResourceIdentityType value.") + }; + + public static ResourceIdentityType ToResourceIdentityType(this string value) + { + if (string.Equals(value, "SystemAssigned", StringComparison.InvariantCultureIgnoreCase)) return ResourceIdentityType.SystemAssigned; + if (string.Equals(value, "UserAssigned", StringComparison.InvariantCultureIgnoreCase)) return ResourceIdentityType.UserAssigned; + if (string.Equals(value, "SystemAssigned,UserAssigned", StringComparison.InvariantCultureIgnoreCase)) return ResourceIdentityType.SystemAssignedUserAssigned; + if (string.Equals(value, "None", StringComparison.InvariantCultureIgnoreCase)) return ResourceIdentityType.None; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ResourceIdentityType value."); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceIdentityType.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceIdentityType.cs new file mode 100644 index 0000000000000..682db907c4ba4 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceIdentityType.cs @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The type of identity used for the resource. The type 'SystemAssigned,UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service. + public enum ResourceIdentityType + { + /// SystemAssigned. + SystemAssigned, + /// UserAssigned. + UserAssigned, + /// SystemAssigned,UserAssigned. + SystemAssignedUserAssigned, + /// None. + None + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableDatabaseAccountGetResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableDatabaseAccountGetResult.Serialization.cs new file mode 100644 index 0000000000000..4fe94e40283c1 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableDatabaseAccountGetResult.Serialization.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class RestorableDatabaseAccountGetResult + { + internal static RestorableDatabaseAccountGetResult DeserializeRestorableDatabaseAccountGetResult(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional type = default; + Optional location = default; + Optional accountName = default; + Optional creationTime = default; + Optional deletionTime = default; + Optional apiType = default; + Optional> restorableLocations = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("location")) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("accountName")) + { + accountName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("creationTime")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + creationTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("deletionTime")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + deletionTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("apiType")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + apiType = new ApiType(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("restorableLocations")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(RestorableLocationResource.DeserializeRestorableLocationResource(item)); + } + restorableLocations = array; + continue; + } + } + continue; + } + } + return new RestorableDatabaseAccountGetResult(id.Value, name.Value, type.Value, location.Value, accountName.Value, Optional.ToNullable(creationTime), Optional.ToNullable(deletionTime), Optional.ToNullable(apiType), Optional.ToList(restorableLocations)); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableDatabaseAccountGetResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableDatabaseAccountGetResult.cs new file mode 100644 index 0000000000000..fdf3cf566e582 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableDatabaseAccountGetResult.cs @@ -0,0 +1,65 @@ +// 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 +{ + /// A Azure Cosmos DB restorable database account. + public partial class RestorableDatabaseAccountGetResult + { + /// Initializes a new instance of RestorableDatabaseAccountGetResult. + internal RestorableDatabaseAccountGetResult() + { + RestorableLocations = new ChangeTrackingList(); + } + + /// Initializes a new instance of RestorableDatabaseAccountGetResult. + /// The unique resource identifier of the ARM resource. + /// The name of the ARM resource. + /// The type of Azure resource. + /// 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 time at which the restorable database account has been deleted (ISO-8601 format). + /// The API type of the restorable database account. + /// List of regions where the of the database account can be restored from. + internal RestorableDatabaseAccountGetResult(string id, string name, string type, string location, string accountName, DateTimeOffset? creationTime, DateTimeOffset? deletionTime, ApiType? apiType, IReadOnlyList restorableLocations) + { + Id = id; + Name = name; + Type = type; + Location = location; + AccountName = accountName; + CreationTime = creationTime; + DeletionTime = deletionTime; + ApiType = apiType; + RestorableLocations = restorableLocations; + } + + /// The unique resource identifier of the ARM resource. + public string Id { get; } + /// The name of the ARM resource. + public string Name { get; } + /// The type of Azure resource. + public string Type { get; } + /// The location of the resource group to which the resource belongs. + public string Location { get; } + /// The name of the global database account. + public string AccountName { get; } + /// The creation time of the restorable database account (ISO-8601 format). + public DateTimeOffset? CreationTime { get; } + /// The time at which the restorable database account has been deleted (ISO-8601 format). + public DateTimeOffset? DeletionTime { get; } + /// The API type of the restorable database account. + public ApiType? ApiType { get; } + /// List of regions where the of the database account can be restored from. + public IReadOnlyList RestorableLocations { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableDatabaseAccountsListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableDatabaseAccountsListResult.Serialization.cs new file mode 100644 index 0000000000000..c70bf33ad7755 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableDatabaseAccountsListResult.Serialization.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + internal partial class RestorableDatabaseAccountsListResult + { + internal static RestorableDatabaseAccountsListResult DeserializeRestorableDatabaseAccountsListResult(JsonElement element) + { + Optional> value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RestorableDatabaseAccountGetResult.DeserializeRestorableDatabaseAccountGetResult(item)); + } + value = array; + continue; + } + } + return new RestorableDatabaseAccountsListResult(Optional.ToList(value)); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableDatabaseAccountsListResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableDatabaseAccountsListResult.cs new file mode 100644 index 0000000000000..d424c87e61e22 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableDatabaseAccountsListResult.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The List operation response, that contains the restorable database accounts and their properties. + internal partial class RestorableDatabaseAccountsListResult + { + /// Initializes a new instance of RestorableDatabaseAccountsListResult. + internal RestorableDatabaseAccountsListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of RestorableDatabaseAccountsListResult. + /// List of restorable database accounts and their properties. + internal RestorableDatabaseAccountsListResult(IReadOnlyList value) + { + Value = value; + } + + /// List of restorable database accounts and their properties. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableLocationResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableLocationResource.Serialization.cs new file mode 100644 index 0000000000000..b8ee6bd451492 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableLocationResource.Serialization.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class RestorableLocationResource + { + internal static RestorableLocationResource DeserializeRestorableLocationResource(JsonElement element) + { + Optional locationName = default; + Optional regionalDatabaseAccountInstanceId = default; + Optional creationTime = default; + Optional deletionTime = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("locationName")) + { + locationName = property.Value.GetString(); + continue; + } + if (property.NameEquals("regionalDatabaseAccountInstanceId")) + { + regionalDatabaseAccountInstanceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("creationTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + creationTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("deletionTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + deletionTime = property.Value.GetDateTimeOffset("O"); + continue; + } + } + return new RestorableLocationResource(locationName.Value, regionalDatabaseAccountInstanceId.Value, Optional.ToNullable(creationTime), Optional.ToNullable(deletionTime)); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableLocationResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableLocationResource.cs new file mode 100644 index 0000000000000..2c8d621ebfd90 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableLocationResource.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// Properties of the regional restorable account. + public partial class RestorableLocationResource + { + /// Initializes a new instance of RestorableLocationResource. + internal RestorableLocationResource() + { + } + + /// Initializes a new instance of RestorableLocationResource. + /// The location of the regional restorable account. + /// The instance id of the regional restorable account. + /// The creation time of the regional restorable database account (ISO-8601 format). + /// The time at which the regional restorable database account has been deleted (ISO-8601 format). + internal RestorableLocationResource(string locationName, string regionalDatabaseAccountInstanceId, DateTimeOffset? creationTime, DateTimeOffset? deletionTime) + { + LocationName = locationName; + RegionalDatabaseAccountInstanceId = regionalDatabaseAccountInstanceId; + CreationTime = creationTime; + DeletionTime = deletionTime; + } + + /// The location of the regional restorable account. + public string LocationName { get; } + /// The instance id of the regional restorable account. + public string RegionalDatabaseAccountInstanceId { get; } + /// The creation time of the regional restorable database account (ISO-8601 format). + public DateTimeOffset? CreationTime { get; } + /// The time at which the regional restorable database account has been deleted (ISO-8601 format). + public DateTimeOffset? DeletionTime { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbCollectionGetResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbCollectionGetResult.Serialization.cs new file mode 100644 index 0000000000000..b995594185da7 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbCollectionGetResult.Serialization.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class RestorableMongodbCollectionGetResult + { + internal static RestorableMongodbCollectionGetResult DeserializeRestorableMongodbCollectionGetResult(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional type = default; + Optional resource = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("resource")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + resource = RestorableMongodbCollectionPropertiesResource.DeserializeRestorableMongodbCollectionPropertiesResource(property0.Value); + continue; + } + } + continue; + } + } + return new RestorableMongodbCollectionGetResult(id.Value, name.Value, type.Value, resource.Value); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbCollectionGetResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbCollectionGetResult.cs new file mode 100644 index 0000000000000..76431f616ece9 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbCollectionGetResult.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// An Azure Cosmos DB MongoDB collection event. + public partial class RestorableMongodbCollectionGetResult + { + /// Initializes a new instance of RestorableMongodbCollectionGetResult. + internal RestorableMongodbCollectionGetResult() + { + } + + /// Initializes a new instance of RestorableMongodbCollectionGetResult. + /// The unique resource Identifier of the ARM resource. + /// The name of the ARM resource. + /// The type of Azure resource. + /// The resource of an Azure Cosmos DB MongoDB collection event. + internal RestorableMongodbCollectionGetResult(string id, string name, string type, RestorableMongodbCollectionPropertiesResource resource) + { + Id = id; + Name = name; + Type = type; + Resource = resource; + } + + /// The unique resource Identifier of the ARM resource. + public string Id { get; } + /// The name of the ARM resource. + public string Name { get; } + /// The type of Azure resource. + public string Type { get; } + /// The resource of an Azure Cosmos DB MongoDB collection event. + public RestorableMongodbCollectionPropertiesResource Resource { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbCollectionPropertiesResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbCollectionPropertiesResource.Serialization.cs new file mode 100644 index 0000000000000..6a476db3eda02 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbCollectionPropertiesResource.Serialization.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class RestorableMongodbCollectionPropertiesResource + { + internal static RestorableMongodbCollectionPropertiesResource DeserializeRestorableMongodbCollectionPropertiesResource(JsonElement element) + { + Optional Rid = default; + Optional operationType = default; + Optional eventTimestamp = default; + Optional ownerId = default; + Optional ownerResourceId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("_rid")) + { + Rid = property.Value.GetString(); + continue; + } + if (property.NameEquals("operationType")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + operationType = new OperationType(property.Value.GetString()); + continue; + } + if (property.NameEquals("eventTimestamp")) + { + eventTimestamp = property.Value.GetString(); + continue; + } + if (property.NameEquals("ownerId")) + { + ownerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("ownerResourceId")) + { + ownerResourceId = property.Value.GetString(); + continue; + } + } + return new RestorableMongodbCollectionPropertiesResource(Rid.Value, Optional.ToNullable(operationType), eventTimestamp.Value, ownerId.Value, ownerResourceId.Value); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbCollectionPropertiesResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbCollectionPropertiesResource.cs new file mode 100644 index 0000000000000..e6f520e58764d --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbCollectionPropertiesResource.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The resource of an Azure Cosmos DB MongoDB collection event. + public partial class RestorableMongodbCollectionPropertiesResource + { + /// Initializes a new instance of RestorableMongodbCollectionPropertiesResource. + internal RestorableMongodbCollectionPropertiesResource() + { + } + + /// Initializes a new instance of RestorableMongodbCollectionPropertiesResource. + /// A system generated property. A unique identifier. + /// The operation type of this collection event. + /// The time when this collection event happened. + /// The name of this MongoDB collection. + /// The resource ID of this MongoDB collection. + internal RestorableMongodbCollectionPropertiesResource(string rid, OperationType? operationType, string eventTimestamp, string ownerId, string ownerResourceId) + { + Rid = rid; + OperationType = operationType; + EventTimestamp = eventTimestamp; + OwnerId = ownerId; + OwnerResourceId = ownerResourceId; + } + + /// A system generated property. A unique identifier. + public string Rid { get; } + /// The operation type of this collection event. + public OperationType? OperationType { get; } + /// The time when this collection event happened. + public string EventTimestamp { get; } + /// The name of this MongoDB collection. + public string OwnerId { get; } + /// The resource ID of this MongoDB collection. + public string OwnerResourceId { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbCollectionsListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbCollectionsListResult.Serialization.cs new file mode 100644 index 0000000000000..4e06fc250dfac --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbCollectionsListResult.Serialization.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + internal partial class RestorableMongodbCollectionsListResult + { + internal static RestorableMongodbCollectionsListResult DeserializeRestorableMongodbCollectionsListResult(JsonElement element) + { + Optional> value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RestorableMongodbCollectionGetResult.DeserializeRestorableMongodbCollectionGetResult(item)); + } + value = array; + continue; + } + } + return new RestorableMongodbCollectionsListResult(Optional.ToList(value)); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbCollectionsListResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbCollectionsListResult.cs new file mode 100644 index 0000000000000..4a948dc28e112 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbCollectionsListResult.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The List operation response, that contains the MongoDB collection events and their properties. + internal partial class RestorableMongodbCollectionsListResult + { + /// Initializes a new instance of RestorableMongodbCollectionsListResult. + internal RestorableMongodbCollectionsListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of RestorableMongodbCollectionsListResult. + /// List of MongoDB collection events and their properties. + internal RestorableMongodbCollectionsListResult(IReadOnlyList value) + { + Value = value; + } + + /// List of MongoDB collection events and their properties. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbDatabaseGetResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbDatabaseGetResult.Serialization.cs new file mode 100644 index 0000000000000..1457caa231eea --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbDatabaseGetResult.Serialization.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class RestorableMongodbDatabaseGetResult + { + internal static RestorableMongodbDatabaseGetResult DeserializeRestorableMongodbDatabaseGetResult(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional type = default; + Optional resource = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("resource")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + resource = RestorableMongodbDatabasePropertiesResource.DeserializeRestorableMongodbDatabasePropertiesResource(property0.Value); + continue; + } + } + continue; + } + } + return new RestorableMongodbDatabaseGetResult(id.Value, name.Value, type.Value, resource.Value); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbDatabaseGetResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbDatabaseGetResult.cs new file mode 100644 index 0000000000000..7703d73602fad --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbDatabaseGetResult.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// An Azure Cosmos DB MongoDB database event. + public partial class RestorableMongodbDatabaseGetResult + { + /// Initializes a new instance of RestorableMongodbDatabaseGetResult. + internal RestorableMongodbDatabaseGetResult() + { + } + + /// Initializes a new instance of RestorableMongodbDatabaseGetResult. + /// The unique resource Identifier of the ARM resource. + /// The name of the ARM resource. + /// The type of Azure resource. + /// The resource of an Azure Cosmos DB MongoDB database event. + internal RestorableMongodbDatabaseGetResult(string id, string name, string type, RestorableMongodbDatabasePropertiesResource resource) + { + Id = id; + Name = name; + Type = type; + Resource = resource; + } + + /// The unique resource Identifier of the ARM resource. + public string Id { get; } + /// The name of the ARM resource. + public string Name { get; } + /// The type of Azure resource. + public string Type { get; } + /// The resource of an Azure Cosmos DB MongoDB database event. + public RestorableMongodbDatabasePropertiesResource Resource { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbDatabasePropertiesResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbDatabasePropertiesResource.Serialization.cs new file mode 100644 index 0000000000000..e1a654eda9626 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbDatabasePropertiesResource.Serialization.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class RestorableMongodbDatabasePropertiesResource + { + internal static RestorableMongodbDatabasePropertiesResource DeserializeRestorableMongodbDatabasePropertiesResource(JsonElement element) + { + Optional Rid = default; + Optional operationType = default; + Optional eventTimestamp = default; + Optional ownerId = default; + Optional ownerResourceId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("_rid")) + { + Rid = property.Value.GetString(); + continue; + } + if (property.NameEquals("operationType")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + operationType = new OperationType(property.Value.GetString()); + continue; + } + if (property.NameEquals("eventTimestamp")) + { + eventTimestamp = property.Value.GetString(); + continue; + } + if (property.NameEquals("ownerId")) + { + ownerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("ownerResourceId")) + { + ownerResourceId = property.Value.GetString(); + continue; + } + } + return new RestorableMongodbDatabasePropertiesResource(Rid.Value, Optional.ToNullable(operationType), eventTimestamp.Value, ownerId.Value, ownerResourceId.Value); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbDatabasePropertiesResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbDatabasePropertiesResource.cs new file mode 100644 index 0000000000000..52c404c95ca8d --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbDatabasePropertiesResource.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The resource of an Azure Cosmos DB MongoDB database event. + public partial class RestorableMongodbDatabasePropertiesResource + { + /// Initializes a new instance of RestorableMongodbDatabasePropertiesResource. + internal RestorableMongodbDatabasePropertiesResource() + { + } + + /// Initializes a new instance of RestorableMongodbDatabasePropertiesResource. + /// A system generated property. A unique identifier. + /// The operation type of this database event. + /// The time when this database event happened. + /// The name of this MongoDB database. + /// The resource ID of this MongoDB database. + internal RestorableMongodbDatabasePropertiesResource(string rid, OperationType? operationType, string eventTimestamp, string ownerId, string ownerResourceId) + { + Rid = rid; + OperationType = operationType; + EventTimestamp = eventTimestamp; + OwnerId = ownerId; + OwnerResourceId = ownerResourceId; + } + + /// A system generated property. A unique identifier. + public string Rid { get; } + /// The operation type of this database event. + public OperationType? OperationType { get; } + /// The time when this database event happened. + public string EventTimestamp { get; } + /// The name of this MongoDB database. + public string OwnerId { get; } + /// The resource ID of this MongoDB database. + public string OwnerResourceId { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbDatabasesListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbDatabasesListResult.Serialization.cs new file mode 100644 index 0000000000000..7caf41f82f311 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbDatabasesListResult.Serialization.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + internal partial class RestorableMongodbDatabasesListResult + { + internal static RestorableMongodbDatabasesListResult DeserializeRestorableMongodbDatabasesListResult(JsonElement element) + { + Optional> value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RestorableMongodbDatabaseGetResult.DeserializeRestorableMongodbDatabaseGetResult(item)); + } + value = array; + continue; + } + } + return new RestorableMongodbDatabasesListResult(Optional.ToList(value)); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbDatabasesListResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbDatabasesListResult.cs new file mode 100644 index 0000000000000..fbf6f2de426e4 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbDatabasesListResult.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The List operation response, that contains the MongoDB database events and their properties. + internal partial class RestorableMongodbDatabasesListResult + { + /// Initializes a new instance of RestorableMongodbDatabasesListResult. + internal RestorableMongodbDatabasesListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of RestorableMongodbDatabasesListResult. + /// List of MongoDB database events and their properties. + internal RestorableMongodbDatabasesListResult(IReadOnlyList value) + { + Value = value; + } + + /// List of MongoDB database events and their properties. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbResourcesListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbResourcesListResult.Serialization.cs new file mode 100644 index 0000000000000..73f681481c603 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbResourcesListResult.Serialization.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + internal partial class RestorableMongodbResourcesListResult + { + internal static RestorableMongodbResourcesListResult DeserializeRestorableMongodbResourcesListResult(JsonElement element) + { + Optional> value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DatabaseRestoreResource.DeserializeDatabaseRestoreResource(item)); + } + value = array; + continue; + } + } + return new RestorableMongodbResourcesListResult(Optional.ToList(value)); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbResourcesListResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbResourcesListResult.cs new file mode 100644 index 0000000000000..487afa8b1c9e0 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongodbResourcesListResult.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The List operation response, that contains the restorable MongoDB resources. + internal partial class RestorableMongodbResourcesListResult + { + /// Initializes a new instance of RestorableMongodbResourcesListResult. + internal RestorableMongodbResourcesListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of RestorableMongodbResourcesListResult. + /// List of restorable MongoDB resources, including the database and collection names. + internal RestorableMongodbResourcesListResult(IReadOnlyList value) + { + Value = value; + } + + /// List of restorable MongoDB resources, including the database and collection names. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerGetResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerGetResult.Serialization.cs new file mode 100644 index 0000000000000..50c1cc0800054 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerGetResult.Serialization.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class RestorableSqlContainerGetResult + { + internal static RestorableSqlContainerGetResult DeserializeRestorableSqlContainerGetResult(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional type = default; + Optional resource = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("resource")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + resource = RestorableSqlContainerPropertiesResource.DeserializeRestorableSqlContainerPropertiesResource(property0.Value); + continue; + } + } + continue; + } + } + return new RestorableSqlContainerGetResult(id.Value, name.Value, type.Value, resource.Value); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerGetResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerGetResult.cs new file mode 100644 index 0000000000000..1e6ee2066d4e7 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerGetResult.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// An Azure Cosmos DB SQL container event. + public partial class RestorableSqlContainerGetResult + { + /// Initializes a new instance of RestorableSqlContainerGetResult. + internal RestorableSqlContainerGetResult() + { + } + + /// Initializes a new instance of RestorableSqlContainerGetResult. + /// The unique resource Identifier of the ARM resource. + /// The name of the ARM resource. + /// The type of Azure resource. + /// The resource of an Azure Cosmos DB SQL container event. + internal RestorableSqlContainerGetResult(string id, string name, string type, RestorableSqlContainerPropertiesResource resource) + { + Id = id; + Name = name; + Type = type; + Resource = resource; + } + + /// The unique resource Identifier of the ARM resource. + public string Id { get; } + /// The name of the ARM resource. + public string Name { get; } + /// The type of Azure resource. + public string Type { get; } + /// The resource of an Azure Cosmos DB SQL container event. + public RestorableSqlContainerPropertiesResource Resource { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResource.Serialization.cs new file mode 100644 index 0000000000000..4e79013afbf1d --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResource.Serialization.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class RestorableSqlContainerPropertiesResource + { + internal static RestorableSqlContainerPropertiesResource DeserializeRestorableSqlContainerPropertiesResource(JsonElement element) + { + Optional Rid = default; + Optional operationType = default; + Optional eventTimestamp = default; + Optional ownerId = default; + Optional ownerResourceId = default; + Optional container = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("_rid")) + { + Rid = property.Value.GetString(); + continue; + } + if (property.NameEquals("operationType")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + operationType = new OperationType(property.Value.GetString()); + continue; + } + if (property.NameEquals("eventTimestamp")) + { + eventTimestamp = property.Value.GetString(); + continue; + } + if (property.NameEquals("ownerId")) + { + ownerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("ownerResourceId")) + { + ownerResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("container")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + container = RestorableSqlContainerPropertiesResourceContainer.DeserializeRestorableSqlContainerPropertiesResourceContainer(property.Value); + continue; + } + } + return new RestorableSqlContainerPropertiesResource(Rid.Value, Optional.ToNullable(operationType), eventTimestamp.Value, ownerId.Value, ownerResourceId.Value, container.Value); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResource.cs new file mode 100644 index 0000000000000..4211d93e7f54d --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResource.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The resource of an Azure Cosmos DB SQL container event. + public partial class RestorableSqlContainerPropertiesResource + { + /// Initializes a new instance of RestorableSqlContainerPropertiesResource. + internal RestorableSqlContainerPropertiesResource() + { + } + + /// Initializes a new instance of RestorableSqlContainerPropertiesResource. + /// A system generated property. A unique identifier. + /// The operation type of this container event. + /// The when this container event happened. + /// The name of this SQL container. + /// The resource ID of this SQL container. + /// Cosmos DB SQL container resource object. + internal RestorableSqlContainerPropertiesResource(string rid, OperationType? operationType, string eventTimestamp, string ownerId, string ownerResourceId, RestorableSqlContainerPropertiesResourceContainer container) + { + Rid = rid; + OperationType = operationType; + EventTimestamp = eventTimestamp; + OwnerId = ownerId; + OwnerResourceId = ownerResourceId; + Container = container; + } + + /// A system generated property. A unique identifier. + public string Rid { get; } + /// The operation type of this container event. + public OperationType? OperationType { get; } + /// The when this container event happened. + public string EventTimestamp { get; } + /// The name of this SQL container. + public string OwnerId { get; } + /// The resource ID of this SQL container. + public string OwnerResourceId { get; } + /// Cosmos DB SQL container resource object. + public RestorableSqlContainerPropertiesResourceContainer Container { get; } + } +} 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 new file mode 100644 index 0000000000000..de9fc29b08fc8 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.Serialization.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class RestorableSqlContainerPropertiesResourceContainer : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("id"); + writer.WriteStringValue(Id); + if (Optional.IsDefined(IndexingPolicy)) + { + writer.WritePropertyName("indexingPolicy"); + writer.WriteObjectValue(IndexingPolicy); + } + if (Optional.IsDefined(PartitionKey)) + { + writer.WritePropertyName("partitionKey"); + writer.WriteObjectValue(PartitionKey); + } + if (Optional.IsDefined(DefaultTtl)) + { + writer.WritePropertyName("defaultTtl"); + writer.WriteNumberValue(DefaultTtl.Value); + } + if (Optional.IsDefined(UniqueKeyPolicy)) + { + writer.WritePropertyName("uniqueKeyPolicy"); + writer.WriteObjectValue(UniqueKeyPolicy); + } + if (Optional.IsDefined(ConflictResolutionPolicy)) + { + writer.WritePropertyName("conflictResolutionPolicy"); + writer.WriteObjectValue(ConflictResolutionPolicy); + } + if (Optional.IsDefined(AnalyticalStorageTtl)) + { + writer.WritePropertyName("analyticalStorageTtl"); + writer.WriteNumberValue(AnalyticalStorageTtl.Value); + } + writer.WriteEndObject(); + } + + internal static RestorableSqlContainerPropertiesResourceContainer DeserializeRestorableSqlContainerPropertiesResourceContainer(JsonElement element) + { + Optional Self = default; + Optional Rid = default; + Optional Ts = default; + Optional Etag = default; + string id = default; + Optional indexingPolicy = default; + Optional partitionKey = default; + Optional defaultTtl = default; + Optional uniqueKeyPolicy = default; + Optional conflictResolutionPolicy = default; + Optional analyticalStorageTtl = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("_self")) + { + Self = property.Value.GetString(); + continue; + } + if (property.NameEquals("_rid")) + { + Rid = property.Value.GetString(); + continue; + } + if (property.NameEquals("_ts")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + Ts = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("_etag")) + { + Etag = property.Value.GetString(); + continue; + } + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("indexingPolicy")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + indexingPolicy = IndexingPolicy.DeserializeIndexingPolicy(property.Value); + continue; + } + if (property.NameEquals("partitionKey")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + partitionKey = ContainerPartitionKey.DeserializeContainerPartitionKey(property.Value); + continue; + } + if (property.NameEquals("defaultTtl")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + defaultTtl = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("uniqueKeyPolicy")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + uniqueKeyPolicy = UniqueKeyPolicy.DeserializeUniqueKeyPolicy(property.Value); + continue; + } + if (property.NameEquals("conflictResolutionPolicy")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + conflictResolutionPolicy = ConflictResolutionPolicy.DeserializeConflictResolutionPolicy(property.Value); + continue; + } + if (property.NameEquals("analyticalStorageTtl")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + analyticalStorageTtl = property.Value.GetInt64(); + continue; + } + } + return new RestorableSqlContainerPropertiesResourceContainer(id, indexingPolicy.Value, partitionKey.Value, Optional.ToNullable(defaultTtl), uniqueKeyPolicy.Value, conflictResolutionPolicy.Value, Optional.ToNullable(analyticalStorageTtl), Self.Value, Rid.Value, Optional.ToNullable(Ts), Etag.Value); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.cs new file mode 100644 index 0000000000000..ed892e0ccd9af --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// Cosmos DB SQL container resource object. + public partial class RestorableSqlContainerPropertiesResourceContainer : SqlContainerResource + { + /// Initializes a new instance of RestorableSqlContainerPropertiesResourceContainer. + /// Name of the Cosmos DB SQL container. + /// is null. + public RestorableSqlContainerPropertiesResourceContainer(string id) : base(id) + { + if (id == null) + { + throw new ArgumentNullException(nameof(id)); + } + } + + /// Initializes a new instance of RestorableSqlContainerPropertiesResourceContainer. + /// Name of the Cosmos DB SQL container. + /// The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container. + /// The configuration of the partition key to be used for partitioning data into multiple partitions. + /// Default time to live. + /// The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. + /// The conflict resolution policy for the container. + /// Analytical TTL. + /// 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 id, IndexingPolicy indexingPolicy, ContainerPartitionKey partitionKey, int? defaultTtl, UniqueKeyPolicy uniqueKeyPolicy, ConflictResolutionPolicy conflictResolutionPolicy, long? analyticalStorageTtl, string self, string rid, float? ts, string etag) : base(id, indexingPolicy, partitionKey, defaultTtl, uniqueKeyPolicy, conflictResolutionPolicy, analyticalStorageTtl) + { + Self = self; + Rid = rid; + Ts = ts; + Etag = etag; + } + + /// A system generated property that specifies the addressable path of the container resource. + public string Self { get; } + /// A system generated property. A unique identifier. + public string Rid { get; } + /// A system generated property that denotes the last updated timestamp of the resource. + public float? Ts { get; } + /// A system generated property representing the resource etag required for optimistic concurrency control. + public string Etag { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainersListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainersListResult.Serialization.cs new file mode 100644 index 0000000000000..20e1fbf1f6943 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainersListResult.Serialization.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + internal partial class RestorableSqlContainersListResult + { + internal static RestorableSqlContainersListResult DeserializeRestorableSqlContainersListResult(JsonElement element) + { + Optional> value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RestorableSqlContainerGetResult.DeserializeRestorableSqlContainerGetResult(item)); + } + value = array; + continue; + } + } + return new RestorableSqlContainersListResult(Optional.ToList(value)); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainersListResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainersListResult.cs new file mode 100644 index 0000000000000..24b25e523fd2a --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainersListResult.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The List operation response, that contains the SQL container events and their properties. + internal partial class RestorableSqlContainersListResult + { + /// Initializes a new instance of RestorableSqlContainersListResult. + internal RestorableSqlContainersListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of RestorableSqlContainersListResult. + /// List of SQL container events and their properties. + internal RestorableSqlContainersListResult(IReadOnlyList value) + { + Value = value; + } + + /// List of SQL container events and their properties. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabaseGetResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabaseGetResult.Serialization.cs new file mode 100644 index 0000000000000..036508849d471 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabaseGetResult.Serialization.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class RestorableSqlDatabaseGetResult + { + internal static RestorableSqlDatabaseGetResult DeserializeRestorableSqlDatabaseGetResult(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional type = default; + Optional resource = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("resource")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + resource = RestorableSqlDatabasePropertiesResource.DeserializeRestorableSqlDatabasePropertiesResource(property0.Value); + continue; + } + } + continue; + } + } + return new RestorableSqlDatabaseGetResult(id.Value, name.Value, type.Value, resource.Value); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabaseGetResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabaseGetResult.cs new file mode 100644 index 0000000000000..61ee603d1875d --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabaseGetResult.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// An Azure Cosmos DB SQL database event. + public partial class RestorableSqlDatabaseGetResult + { + /// Initializes a new instance of RestorableSqlDatabaseGetResult. + internal RestorableSqlDatabaseGetResult() + { + } + + /// Initializes a new instance of RestorableSqlDatabaseGetResult. + /// The unique resource Identifier of the ARM resource. + /// The name of the ARM resource. + /// The type of Azure resource. + /// The resource of an Azure Cosmos DB SQL database event. + internal RestorableSqlDatabaseGetResult(string id, string name, string type, RestorableSqlDatabasePropertiesResource resource) + { + Id = id; + Name = name; + Type = type; + Resource = resource; + } + + /// The unique resource Identifier of the ARM resource. + public string Id { get; } + /// The name of the ARM resource. + public string Name { get; } + /// The type of Azure resource. + public string Type { get; } + /// The resource of an Azure Cosmos DB SQL database event. + public RestorableSqlDatabasePropertiesResource Resource { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabasePropertiesResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabasePropertiesResource.Serialization.cs new file mode 100644 index 0000000000000..09cee742f5df7 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabasePropertiesResource.Serialization.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class RestorableSqlDatabasePropertiesResource + { + internal static RestorableSqlDatabasePropertiesResource DeserializeRestorableSqlDatabasePropertiesResource(JsonElement element) + { + Optional Rid = default; + Optional operationType = default; + Optional eventTimestamp = default; + Optional ownerId = default; + Optional ownerResourceId = default; + Optional database = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("_rid")) + { + Rid = property.Value.GetString(); + continue; + } + if (property.NameEquals("operationType")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + operationType = new OperationType(property.Value.GetString()); + continue; + } + if (property.NameEquals("eventTimestamp")) + { + eventTimestamp = property.Value.GetString(); + continue; + } + if (property.NameEquals("ownerId")) + { + ownerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("ownerResourceId")) + { + ownerResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("database")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + database = RestorableSqlDatabasePropertiesResourceDatabase.DeserializeRestorableSqlDatabasePropertiesResourceDatabase(property.Value); + continue; + } + } + return new RestorableSqlDatabasePropertiesResource(Rid.Value, Optional.ToNullable(operationType), eventTimestamp.Value, ownerId.Value, ownerResourceId.Value, database.Value); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabasePropertiesResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabasePropertiesResource.cs new file mode 100644 index 0000000000000..8b2438de112c7 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabasePropertiesResource.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The resource of an Azure Cosmos DB SQL database event. + public partial class RestorableSqlDatabasePropertiesResource + { + /// Initializes a new instance of RestorableSqlDatabasePropertiesResource. + internal RestorableSqlDatabasePropertiesResource() + { + } + + /// Initializes a new instance of RestorableSqlDatabasePropertiesResource. + /// A system generated property. A unique identifier. + /// The operation type of this database event. + /// The time when this database event happened. + /// The name of the SQL database. + /// The resource ID of the SQL database. + /// Cosmos DB SQL database resource object. + internal RestorableSqlDatabasePropertiesResource(string rid, OperationType? operationType, string eventTimestamp, string ownerId, string ownerResourceId, RestorableSqlDatabasePropertiesResourceDatabase database) + { + Rid = rid; + OperationType = operationType; + EventTimestamp = eventTimestamp; + OwnerId = ownerId; + OwnerResourceId = ownerResourceId; + Database = database; + } + + /// A system generated property. A unique identifier. + public string Rid { get; } + /// The operation type of this database event. + public OperationType? OperationType { get; } + /// The time when this database event happened. + public string EventTimestamp { get; } + /// The name of the SQL database. + public string OwnerId { get; } + /// The resource ID of the SQL database. + public string OwnerResourceId { get; } + /// Cosmos DB SQL database resource object. + public RestorableSqlDatabasePropertiesResourceDatabase Database { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabasePropertiesResourceDatabase.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabasePropertiesResourceDatabase.Serialization.cs new file mode 100644 index 0000000000000..18d0466b8bde8 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabasePropertiesResourceDatabase.Serialization.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class RestorableSqlDatabasePropertiesResourceDatabase : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("id"); + writer.WriteStringValue(Id); + writer.WriteEndObject(); + } + + internal static RestorableSqlDatabasePropertiesResourceDatabase DeserializeRestorableSqlDatabasePropertiesResourceDatabase(JsonElement element) + { + Optional Colls = default; + Optional Users = default; + Optional Self = default; + Optional Rid = default; + Optional Ts = default; + Optional Etag = default; + string id = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("_colls")) + { + Colls = property.Value.GetString(); + continue; + } + if (property.NameEquals("_users")) + { + Users = property.Value.GetString(); + continue; + } + if (property.NameEquals("_self")) + { + Self = property.Value.GetString(); + continue; + } + if (property.NameEquals("_rid")) + { + Rid = property.Value.GetString(); + continue; + } + if (property.NameEquals("_ts")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + Ts = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("_etag")) + { + Etag = property.Value.GetString(); + continue; + } + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + } + return new RestorableSqlDatabasePropertiesResourceDatabase(id, Colls.Value, Users.Value, Self.Value, Rid.Value, Optional.ToNullable(Ts), Etag.Value); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabasePropertiesResourceDatabase.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabasePropertiesResourceDatabase.cs new file mode 100644 index 0000000000000..b23b981cc858f --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabasePropertiesResourceDatabase.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// Cosmos DB SQL database resource object. + public partial class RestorableSqlDatabasePropertiesResourceDatabase : SqlDatabaseResource + { + /// Initializes a new instance of RestorableSqlDatabasePropertiesResourceDatabase. + /// Name of the Cosmos DB SQL database. + /// is null. + public RestorableSqlDatabasePropertiesResourceDatabase(string id) : base(id) + { + if (id == null) + { + throw new ArgumentNullException(nameof(id)); + } + } + + /// Initializes a new instance of RestorableSqlDatabasePropertiesResourceDatabase. + /// Name of the Cosmos DB SQL database. + /// A system generated property that specified the addressable path of the collections resource. + /// A system generated property that specifies the addressable path of the users resource. + /// A system generated property that specifies the addressable path of the database 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. + /// is null. + internal RestorableSqlDatabasePropertiesResourceDatabase(string id, string colls, string users, string self, string rid, float? ts, string etag) : base(id) + { + if (id == null) + { + throw new ArgumentNullException(nameof(id)); + } + + Colls = colls; + Users = users; + Self = self; + Rid = rid; + Ts = ts; + Etag = etag; + } + + /// A system generated property that specified the addressable path of the collections resource. + public string Colls { get; } + /// A system generated property that specifies the addressable path of the users resource. + public string Users { get; } + /// A system generated property that specifies the addressable path of the database resource. + public string Self { get; } + /// A system generated property. A unique identifier. + public string Rid { get; } + /// A system generated property that denotes the last updated timestamp of the resource. + public float? Ts { get; } + /// A system generated property representing the resource etag required for optimistic concurrency control. + public string Etag { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabasesListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabasesListResult.Serialization.cs new file mode 100644 index 0000000000000..064b8cda8658c --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabasesListResult.Serialization.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + internal partial class RestorableSqlDatabasesListResult + { + internal static RestorableSqlDatabasesListResult DeserializeRestorableSqlDatabasesListResult(JsonElement element) + { + Optional> value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RestorableSqlDatabaseGetResult.DeserializeRestorableSqlDatabaseGetResult(item)); + } + value = array; + continue; + } + } + return new RestorableSqlDatabasesListResult(Optional.ToList(value)); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabasesListResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabasesListResult.cs new file mode 100644 index 0000000000000..81d71ab41466e --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabasesListResult.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The List operation response, that contains the SQL database events and their properties. + internal partial class RestorableSqlDatabasesListResult + { + /// Initializes a new instance of RestorableSqlDatabasesListResult. + internal RestorableSqlDatabasesListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of RestorableSqlDatabasesListResult. + /// List of SQL database events and their properties. + internal RestorableSqlDatabasesListResult(IReadOnlyList value) + { + Value = value; + } + + /// List of SQL database events and their properties. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlResourcesListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlResourcesListResult.Serialization.cs new file mode 100644 index 0000000000000..4f11588d5c269 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlResourcesListResult.Serialization.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + internal partial class RestorableSqlResourcesListResult + { + internal static RestorableSqlResourcesListResult DeserializeRestorableSqlResourcesListResult(JsonElement element) + { + Optional> value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DatabaseRestoreResource.DeserializeDatabaseRestoreResource(item)); + } + value = array; + continue; + } + } + return new RestorableSqlResourcesListResult(Optional.ToList(value)); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlResourcesListResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlResourcesListResult.cs new file mode 100644 index 0000000000000..9b4b313742274 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlResourcesListResult.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The List operation response, that contains the restorable SQL resources. + internal partial class RestorableSqlResourcesListResult + { + /// Initializes a new instance of RestorableSqlResourcesListResult. + internal RestorableSqlResourcesListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of RestorableSqlResourcesListResult. + /// List of restorable SQL resources, including the database and collection names. + internal RestorableSqlResourcesListResult(IReadOnlyList value) + { + Value = value; + } + + /// List of restorable SQL resources, including the database and collection names. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestoreMode.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestoreMode.cs new file mode 100644 index 0000000000000..3f4024913513d --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestoreMode.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// Describes the mode of the restore. + public readonly partial struct RestoreMode : IEquatable + { + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public RestoreMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PointInTimeValue = "PointInTime"; + + /// PointInTime. + public static RestoreMode PointInTime { get; } = new RestoreMode(PointInTimeValue); + /// Determines if two values are the same. + public static bool operator ==(RestoreMode left, RestoreMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(RestoreMode left, RestoreMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator RestoreMode(string value) => new RestoreMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is RestoreMode other && Equals(other); + /// + public bool Equals(RestoreMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestoreParameters.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestoreParameters.Serialization.cs new file mode 100644 index 0000000000000..0afd55f1b13ae --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestoreParameters.Serialization.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class RestoreParameters : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(RestoreMode)) + { + writer.WritePropertyName("restoreMode"); + writer.WriteStringValue(RestoreMode.Value.ToString()); + } + if (Optional.IsDefined(RestoreSource)) + { + writer.WritePropertyName("restoreSource"); + writer.WriteStringValue(RestoreSource); + } + if (Optional.IsDefined(RestoreTimestampInUtc)) + { + writer.WritePropertyName("restoreTimestampInUtc"); + writer.WriteStringValue(RestoreTimestampInUtc.Value, "O"); + } + if (Optional.IsCollectionDefined(DatabasesToRestore)) + { + writer.WritePropertyName("databasesToRestore"); + writer.WriteStartArray(); + foreach (var item in DatabasesToRestore) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static RestoreParameters DeserializeRestoreParameters(JsonElement element) + { + Optional restoreMode = default; + Optional restoreSource = default; + Optional restoreTimestampInUtc = default; + Optional> databasesToRestore = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("restoreMode")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + restoreMode = new RestoreMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("restoreSource")) + { + restoreSource = property.Value.GetString(); + continue; + } + if (property.NameEquals("restoreTimestampInUtc")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + restoreTimestampInUtc = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("databasesToRestore")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DatabaseRestoreResource.DeserializeDatabaseRestoreResource(item)); + } + databasesToRestore = array; + continue; + } + } + return new RestoreParameters(Optional.ToNullable(restoreMode), restoreSource.Value, Optional.ToNullable(restoreTimestampInUtc), Optional.ToList(databasesToRestore)); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestoreParameters.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestoreParameters.cs new file mode 100644 index 0000000000000..047f92e0ba18b --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestoreParameters.cs @@ -0,0 +1,45 @@ +// 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 +{ + /// Parameters to indicate the information about the restore. + public partial class RestoreParameters + { + /// Initializes a new instance of RestoreParameters. + public RestoreParameters() + { + DatabasesToRestore = new ChangeTrackingList(); + } + + /// Initializes a new instance of RestoreParameters. + /// Describes the mode of the restore. + /// The id of the restorable database account from which the restore has to be initiated. For example: /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName}. + /// Time to which the account has to be restored (ISO-8601 format). + /// List of specific databases available for restore. + internal RestoreParameters(RestoreMode? restoreMode, string restoreSource, DateTimeOffset? restoreTimestampInUtc, IList databasesToRestore) + { + RestoreMode = restoreMode; + RestoreSource = restoreSource; + RestoreTimestampInUtc = restoreTimestampInUtc; + DatabasesToRestore = databasesToRestore; + } + + /// Describes the mode of the restore. + public RestoreMode? RestoreMode { get; set; } + /// The id of the restorable database account from which the restore has to be initiated. For example: /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName}. + public string RestoreSource { get; set; } + /// Time to which the account has to be restored (ISO-8601 format). + public DateTimeOffset? RestoreTimestampInUtc { get; set; } + /// List of specific databases available for restore. + public IList DatabasesToRestore { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RoleDefinitionType.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RoleDefinitionType.Serialization.cs new file mode 100644 index 0000000000000..b3f2ce568b07c --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RoleDefinitionType.Serialization.cs @@ -0,0 +1,28 @@ +// 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 RoleDefinitionTypeExtensions + { + public static string ToSerialString(this RoleDefinitionType value) => value switch + { + RoleDefinitionType.BuiltInRole => "BuiltInRole", + RoleDefinitionType.CustomRole => "CustomRole", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown RoleDefinitionType value.") + }; + + public static RoleDefinitionType ToRoleDefinitionType(this string value) + { + if (string.Equals(value, "BuiltInRole", StringComparison.InvariantCultureIgnoreCase)) return RoleDefinitionType.BuiltInRole; + if (string.Equals(value, "CustomRole", StringComparison.InvariantCultureIgnoreCase)) return RoleDefinitionType.CustomRole; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown RoleDefinitionType value."); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RoleDefinitionType.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RoleDefinitionType.cs new file mode 100644 index 0000000000000..7295202d186a5 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RoleDefinitionType.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// Indicates whether the Role Definition was built-in or user created. + public enum RoleDefinitionType + { + /// BuiltInRole. + BuiltInRole, + /// CustomRole. + CustomRole + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ServerVersion.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ServerVersion.cs index 0b5e9b20f8c7f..bf5c3dc6e2729 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ServerVersion.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ServerVersion.cs @@ -24,11 +24,14 @@ public ServerVersion(string value) private const string Three2Value = "3.2"; private const string Three6Value = "3.6"; + private const string Four0Value = "4.0"; /// 3.2. public static ServerVersion Three2 { get; } = new ServerVersion(Three2Value); /// 3.6. public static ServerVersion Three6 { get; } = new ServerVersion(Three6Value); + /// 4.0. + public static ServerVersion Four0 { get; } = new ServerVersion(Four0Value); /// Determines if two values are the same. public static bool operator ==(ServerVersion left, ServerVersion right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlContainerCreateUpdateParameters.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlContainerCreateUpdateParameters.Serialization.cs index c3faa8dd16180..4ae4f2fbde183 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlContainerCreateUpdateParameters.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlContainerCreateUpdateParameters.Serialization.cs @@ -36,8 +36,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStartObject(); writer.WritePropertyName("resource"); writer.WriteObjectValue(Resource); - writer.WritePropertyName("options"); - writer.WriteObjectValue(Options); + if (Optional.IsDefined(Options)) + { + writer.WritePropertyName("options"); + writer.WriteObjectValue(Options); + } writer.WriteEndObject(); writer.WriteEndObject(); } @@ -50,7 +53,7 @@ internal static SqlContainerCreateUpdateParameters DeserializeSqlContainerCreate Optional location = default; Optional> tags = default; SqlContainerResource resource = default; - CreateUpdateOptions options = default; + Optional options = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("id")) @@ -104,6 +107,11 @@ internal static SqlContainerCreateUpdateParameters DeserializeSqlContainerCreate } if (property0.NameEquals("options")) { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } options = CreateUpdateOptions.DeserializeCreateUpdateOptions(property0.Value); continue; } @@ -111,7 +119,7 @@ internal static SqlContainerCreateUpdateParameters DeserializeSqlContainerCreate continue; } } - return new SqlContainerCreateUpdateParameters(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), resource, options); + return new SqlContainerCreateUpdateParameters(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), resource, options.Value); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlContainerCreateUpdateParameters.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlContainerCreateUpdateParameters.cs index f9c940b37c21c..64cc2ca400002 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlContainerCreateUpdateParameters.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlContainerCreateUpdateParameters.cs @@ -15,21 +15,15 @@ public partial class SqlContainerCreateUpdateParameters : ARMResourceProperties { /// Initializes a new instance of SqlContainerCreateUpdateParameters. /// 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. - /// or is null. - public SqlContainerCreateUpdateParameters(SqlContainerResource resource, CreateUpdateOptions options) + /// is null. + public SqlContainerCreateUpdateParameters(SqlContainerResource resource) { if (resource == null) { throw new ArgumentNullException(nameof(resource)); } - if (options == null) - { - throw new ArgumentNullException(nameof(options)); - } Resource = resource; - Options = options; } /// Initializes a new instance of SqlContainerCreateUpdateParameters. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlContainerGetPropertiesResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlContainerGetPropertiesResource.Serialization.cs index 29549e41a44ba..f6f546232ceee 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlContainerGetPropertiesResource.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlContainerGetPropertiesResource.Serialization.cs @@ -53,7 +53,7 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) internal static SqlContainerGetPropertiesResource DeserializeSqlContainerGetPropertiesResource(JsonElement element) { Optional Rid = default; - Optional Ts = default; + Optional Ts = default; Optional Etag = default; string id = default; Optional indexingPolicy = default; @@ -76,7 +76,7 @@ internal static SqlContainerGetPropertiesResource DeserializeSqlContainerGetProp property.ThrowNonNullablePropertyIsNull(); continue; } - Ts = property.Value.GetObject(); + Ts = property.Value.GetSingle(); continue; } if (property.NameEquals("_etag")) @@ -150,7 +150,7 @@ internal static SqlContainerGetPropertiesResource DeserializeSqlContainerGetProp continue; } } - return new SqlContainerGetPropertiesResource(id, indexingPolicy.Value, partitionKey.Value, Optional.ToNullable(defaultTtl), uniqueKeyPolicy.Value, conflictResolutionPolicy.Value, Optional.ToNullable(analyticalStorageTtl), Rid.Value, Ts.Value, Etag.Value); + return new SqlContainerGetPropertiesResource(id, indexingPolicy.Value, partitionKey.Value, Optional.ToNullable(defaultTtl), uniqueKeyPolicy.Value, conflictResolutionPolicy.Value, Optional.ToNullable(analyticalStorageTtl), Rid.Value, Optional.ToNullable(Ts), Etag.Value); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlContainerGetPropertiesResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlContainerGetPropertiesResource.cs index a47d848ef5b5a..c3a8b3b2eea96 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlContainerGetPropertiesResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlContainerGetPropertiesResource.cs @@ -34,7 +34,7 @@ public SqlContainerGetPropertiesResource(string id) : base(id) /// 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 SqlContainerGetPropertiesResource(string id, IndexingPolicy indexingPolicy, ContainerPartitionKey partitionKey, int? defaultTtl, UniqueKeyPolicy uniqueKeyPolicy, ConflictResolutionPolicy conflictResolutionPolicy, long? analyticalStorageTtl, string rid, object ts, string etag) : base(id, indexingPolicy, partitionKey, defaultTtl, uniqueKeyPolicy, conflictResolutionPolicy, analyticalStorageTtl) + internal SqlContainerGetPropertiesResource(string id, IndexingPolicy indexingPolicy, ContainerPartitionKey partitionKey, int? defaultTtl, UniqueKeyPolicy uniqueKeyPolicy, ConflictResolutionPolicy conflictResolutionPolicy, long? analyticalStorageTtl, string rid, float? ts, string etag) : base(id, indexingPolicy, partitionKey, defaultTtl, uniqueKeyPolicy, conflictResolutionPolicy, analyticalStorageTtl) { Rid = rid; Ts = ts; @@ -44,7 +44,7 @@ internal SqlContainerGetPropertiesResource(string id, IndexingPolicy indexingPol /// A system generated property. A unique identifier. public string Rid { get; } /// A system generated property that denotes the last updated timestamp of the resource. - public object Ts { get; } + public float? Ts { get; } /// A system generated property representing the resource etag required for optimistic concurrency control. public string Etag { get; } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlDatabaseCreateUpdateParameters.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlDatabaseCreateUpdateParameters.Serialization.cs index 911cee9aa89eb..d1379a2d6eb45 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlDatabaseCreateUpdateParameters.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlDatabaseCreateUpdateParameters.Serialization.cs @@ -36,8 +36,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStartObject(); writer.WritePropertyName("resource"); writer.WriteObjectValue(Resource); - writer.WritePropertyName("options"); - writer.WriteObjectValue(Options); + if (Optional.IsDefined(Options)) + { + writer.WritePropertyName("options"); + writer.WriteObjectValue(Options); + } writer.WriteEndObject(); writer.WriteEndObject(); } @@ -50,7 +53,7 @@ internal static SqlDatabaseCreateUpdateParameters DeserializeSqlDatabaseCreateUp Optional location = default; Optional> tags = default; SqlDatabaseResource resource = default; - CreateUpdateOptions options = default; + Optional options = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("id")) @@ -104,6 +107,11 @@ internal static SqlDatabaseCreateUpdateParameters DeserializeSqlDatabaseCreateUp } if (property0.NameEquals("options")) { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } options = CreateUpdateOptions.DeserializeCreateUpdateOptions(property0.Value); continue; } @@ -111,7 +119,7 @@ internal static SqlDatabaseCreateUpdateParameters DeserializeSqlDatabaseCreateUp continue; } } - return new SqlDatabaseCreateUpdateParameters(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), resource, options); + return new SqlDatabaseCreateUpdateParameters(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), resource, options.Value); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlDatabaseCreateUpdateParameters.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlDatabaseCreateUpdateParameters.cs index 4e3ab0cf193f6..9aefd8d7efbdd 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlDatabaseCreateUpdateParameters.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlDatabaseCreateUpdateParameters.cs @@ -15,21 +15,15 @@ public partial class SqlDatabaseCreateUpdateParameters : ARMResourceProperties { /// Initializes a new instance of SqlDatabaseCreateUpdateParameters. /// 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. - /// or is null. - public SqlDatabaseCreateUpdateParameters(SqlDatabaseResource resource, CreateUpdateOptions options) + /// is null. + public SqlDatabaseCreateUpdateParameters(SqlDatabaseResource resource) { if (resource == null) { throw new ArgumentNullException(nameof(resource)); } - if (options == null) - { - throw new ArgumentNullException(nameof(options)); - } Resource = resource; - Options = options; } /// Initializes a new instance of SqlDatabaseCreateUpdateParameters. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlDatabaseGetPropertiesResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlDatabaseGetPropertiesResource.Serialization.cs index 41f766bd1b731..af1dd442cc5d0 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlDatabaseGetPropertiesResource.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlDatabaseGetPropertiesResource.Serialization.cs @@ -35,7 +35,7 @@ internal static SqlDatabaseGetPropertiesResource DeserializeSqlDatabaseGetProper Optional Colls = default; Optional Users = default; Optional Rid = default; - Optional Ts = default; + Optional Ts = default; Optional Etag = default; string id = default; foreach (var property in element.EnumerateObject()) @@ -62,7 +62,7 @@ internal static SqlDatabaseGetPropertiesResource DeserializeSqlDatabaseGetProper property.ThrowNonNullablePropertyIsNull(); continue; } - Ts = property.Value.GetObject(); + Ts = property.Value.GetSingle(); continue; } if (property.NameEquals("_etag")) @@ -76,7 +76,7 @@ internal static SqlDatabaseGetPropertiesResource DeserializeSqlDatabaseGetProper continue; } } - return new SqlDatabaseGetPropertiesResource(id, Colls.Value, Users.Value, Rid.Value, Ts.Value, Etag.Value); + return new SqlDatabaseGetPropertiesResource(id, Colls.Value, Users.Value, Rid.Value, Optional.ToNullable(Ts), Etag.Value); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlDatabaseGetPropertiesResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlDatabaseGetPropertiesResource.cs index b3e9b506aa92b..5879e3d8d13ad 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlDatabaseGetPropertiesResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlDatabaseGetPropertiesResource.cs @@ -31,7 +31,7 @@ public SqlDatabaseGetPropertiesResource(string id) : base(id) /// 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. /// is null. - internal SqlDatabaseGetPropertiesResource(string id, string colls, string users, string rid, object ts, string etag) : base(id) + internal SqlDatabaseGetPropertiesResource(string id, string colls, string users, string rid, float? ts, string etag) : base(id) { if (id == null) { @@ -52,7 +52,7 @@ internal SqlDatabaseGetPropertiesResource(string id, string colls, string users, /// A system generated property. A unique identifier. public string Rid { get; } /// A system generated property that denotes the last updated timestamp of the resource. - public object Ts { get; } + public float? Ts { get; } /// A system generated property representing the resource etag required for optimistic concurrency control. public string Etag { get; } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleAssignmentCreateUpdateParameters.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleAssignmentCreateUpdateParameters.Serialization.cs new file mode 100644 index 0000000000000..b7eea67451c58 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleAssignmentCreateUpdateParameters.Serialization.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class SqlRoleAssignmentCreateUpdateParameters : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(RoleDefinitionId)) + { + writer.WritePropertyName("roleDefinitionId"); + writer.WriteStringValue(RoleDefinitionId); + } + if (Optional.IsDefined(Scope)) + { + writer.WritePropertyName("scope"); + writer.WriteStringValue(Scope); + } + if (Optional.IsDefined(PrincipalId)) + { + writer.WritePropertyName("principalId"); + writer.WriteStringValue(PrincipalId); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleAssignmentCreateUpdateParameters.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleAssignmentCreateUpdateParameters.cs new file mode 100644 index 0000000000000..55bd1d7c19c57 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleAssignmentCreateUpdateParameters.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// Parameters to create and update an Azure Cosmos DB SQL Role Assignment. + public partial class SqlRoleAssignmentCreateUpdateParameters + { + /// Initializes a new instance of SqlRoleAssignmentCreateUpdateParameters. + public SqlRoleAssignmentCreateUpdateParameters() + { + } + + /// The unique identifier for the associated Role Definition. + public string RoleDefinitionId { get; set; } + /// The data plane resource path for which access is being granted through this Role Assignment. + public string Scope { get; set; } + /// The unique identifier for the associated AAD principal in the AAD graph to which access is being granted through this Role Assignment. Tenant ID for the principal is inferred using the tenant associated with the subscription. + public string PrincipalId { get; set; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleAssignmentGetResults.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleAssignmentGetResults.Serialization.cs new file mode 100644 index 0000000000000..f27e5ffc9b575 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleAssignmentGetResults.Serialization.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class SqlRoleAssignmentGetResults : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(RoleDefinitionId)) + { + writer.WritePropertyName("roleDefinitionId"); + writer.WriteStringValue(RoleDefinitionId); + } + if (Optional.IsDefined(Scope)) + { + writer.WritePropertyName("scope"); + writer.WriteStringValue(Scope); + } + if (Optional.IsDefined(PrincipalId)) + { + writer.WritePropertyName("principalId"); + writer.WriteStringValue(PrincipalId); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static SqlRoleAssignmentGetResults DeserializeSqlRoleAssignmentGetResults(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional type = default; + Optional roleDefinitionId = default; + Optional scope = default; + Optional principalId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("roleDefinitionId")) + { + roleDefinitionId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("scope")) + { + scope = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("principalId")) + { + principalId = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new SqlRoleAssignmentGetResults(id.Value, name.Value, type.Value, roleDefinitionId.Value, scope.Value, principalId.Value); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleAssignmentGetResults.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleAssignmentGetResults.cs new file mode 100644 index 0000000000000..3c59d980e22e9 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleAssignmentGetResults.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// An Azure Cosmos DB Role Assignment. + public partial class SqlRoleAssignmentGetResults : ARMProxyResource + { + /// Initializes a new instance of SqlRoleAssignmentGetResults. + public SqlRoleAssignmentGetResults() + { + } + + /// Initializes a new instance of SqlRoleAssignmentGetResults. + /// The unique resource identifier of the database account. + /// The name of the database account. + /// The type of Azure resource. + /// The unique identifier for the associated Role Definition. + /// The data plane resource path for which access is being granted through this Role Assignment. + /// The unique identifier for the associated AAD principal in the AAD graph to which access is being granted through this Role Assignment. Tenant ID for the principal is inferred using the tenant associated with the subscription. + internal SqlRoleAssignmentGetResults(string id, string name, string type, string roleDefinitionId, string scope, string principalId) : base(id, name, type) + { + RoleDefinitionId = roleDefinitionId; + Scope = scope; + PrincipalId = principalId; + } + + /// The unique identifier for the associated Role Definition. + public string RoleDefinitionId { get; set; } + /// The data plane resource path for which access is being granted through this Role Assignment. + public string Scope { get; set; } + /// The unique identifier for the associated AAD principal in the AAD graph to which access is being granted through this Role Assignment. Tenant ID for the principal is inferred using the tenant associated with the subscription. + public string PrincipalId { get; set; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleAssignmentListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleAssignmentListResult.Serialization.cs new file mode 100644 index 0000000000000..e22d99795069a --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleAssignmentListResult.Serialization.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + internal partial class SqlRoleAssignmentListResult + { + internal static SqlRoleAssignmentListResult DeserializeSqlRoleAssignmentListResult(JsonElement element) + { + Optional> value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SqlRoleAssignmentGetResults.DeserializeSqlRoleAssignmentGetResults(item)); + } + value = array; + continue; + } + } + return new SqlRoleAssignmentListResult(Optional.ToList(value)); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleAssignmentListResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleAssignmentListResult.cs new file mode 100644 index 0000000000000..3043f4cd2006f --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleAssignmentListResult.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The relevant Role Assignments. + internal partial class SqlRoleAssignmentListResult + { + /// Initializes a new instance of SqlRoleAssignmentListResult. + internal SqlRoleAssignmentListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of SqlRoleAssignmentListResult. + /// List of Role Assignments and their properties. + internal SqlRoleAssignmentListResult(IReadOnlyList value) + { + Value = value; + } + + /// List of Role Assignments and their properties. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleDefinitionCreateUpdateParameters.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleDefinitionCreateUpdateParameters.Serialization.cs new file mode 100644 index 0000000000000..8cab4ae899a05 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleDefinitionCreateUpdateParameters.Serialization.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class SqlRoleDefinitionCreateUpdateParameters : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(RoleName)) + { + writer.WritePropertyName("roleName"); + writer.WriteStringValue(RoleName); + } + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"); + writer.WriteStringValue(Type.Value.ToSerialString()); + } + if (Optional.IsCollectionDefined(AssignableScopes)) + { + writer.WritePropertyName("assignableScopes"); + writer.WriteStartArray(); + foreach (var item in AssignableScopes) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Permissions)) + { + writer.WritePropertyName("permissions"); + writer.WriteStartArray(); + foreach (var item in Permissions) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleDefinitionCreateUpdateParameters.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleDefinitionCreateUpdateParameters.cs new file mode 100644 index 0000000000000..890abf4d32d1c --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleDefinitionCreateUpdateParameters.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// Parameters to create and update an Azure Cosmos DB SQL Role Definition. + public partial class SqlRoleDefinitionCreateUpdateParameters + { + /// Initializes a new instance of SqlRoleDefinitionCreateUpdateParameters. + public SqlRoleDefinitionCreateUpdateParameters() + { + AssignableScopes = new ChangeTrackingList(); + Permissions = new ChangeTrackingList(); + } + + /// A user-friendly name for the Role Definition. Must be unique for the database account. + public string RoleName { get; set; } + /// Indicates whether the Role Definition was built-in or user created. + public RoleDefinitionType? Type { get; set; } + /// A set of fully qualified Scopes at or below which Role Assignments may be created using this Role Definition. This will allow application of this Role Definition on the entire database account or any underlying Database / Collection. Must have at least one element. Scopes higher than Database account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes need not exist. + public IList AssignableScopes { get; } + /// The set of operations allowed through this Role Definition. + public IList Permissions { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleDefinitionGetResults.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleDefinitionGetResults.Serialization.cs new file mode 100644 index 0000000000000..af2f68a20c68e --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleDefinitionGetResults.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class SqlRoleDefinitionGetResults : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(RoleName)) + { + writer.WritePropertyName("roleName"); + writer.WriteStringValue(RoleName); + } + if (Optional.IsDefined(TypePropertiesType)) + { + writer.WritePropertyName("type"); + writer.WriteStringValue(TypePropertiesType.Value.ToSerialString()); + } + if (Optional.IsCollectionDefined(AssignableScopes)) + { + writer.WritePropertyName("assignableScopes"); + writer.WriteStartArray(); + foreach (var item in AssignableScopes) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Permissions)) + { + writer.WritePropertyName("permissions"); + writer.WriteStartArray(); + foreach (var item in Permissions) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static SqlRoleDefinitionGetResults DeserializeSqlRoleDefinitionGetResults(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional type = default; + Optional roleName = default; + Optional type0 = default; + Optional> assignableScopes = default; + Optional> permissions = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("roleName")) + { + roleName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("type")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + type0 = property0.Value.GetString().ToRoleDefinitionType(); + continue; + } + if (property0.NameEquals("assignableScopes")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + assignableScopes = array; + continue; + } + if (property0.NameEquals("permissions")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(Permission.DeserializePermission(item)); + } + permissions = array; + continue; + } + } + continue; + } + } + return new SqlRoleDefinitionGetResults(id.Value, name.Value, type.Value, roleName.Value, Optional.ToNullable(type0), Optional.ToList(assignableScopes), Optional.ToList(permissions)); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleDefinitionGetResults.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleDefinitionGetResults.cs new file mode 100644 index 0000000000000..4dd798f883123 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleDefinitionGetResults.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// An Azure Cosmos DB SQL Role Definition. + public partial class SqlRoleDefinitionGetResults : ARMProxyResource + { + /// Initializes a new instance of SqlRoleDefinitionGetResults. + public SqlRoleDefinitionGetResults() + { + AssignableScopes = new ChangeTrackingList(); + Permissions = new ChangeTrackingList(); + } + + /// Initializes a new instance of SqlRoleDefinitionGetResults. + /// The unique resource identifier of the database account. + /// The name of the database account. + /// The type of Azure resource. + /// A user-friendly name for the Role Definition. Must be unique for the database account. + /// Indicates whether the Role Definition was built-in or user created. + /// A set of fully qualified Scopes at or below which Role Assignments may be created using this Role Definition. This will allow application of this Role Definition on the entire database account or any underlying Database / Collection. Must have at least one element. Scopes higher than Database account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes need not exist. + /// The set of operations allowed through this Role Definition. + internal SqlRoleDefinitionGetResults(string id, string name, string type, string roleName, RoleDefinitionType? typePropertiesType, IList assignableScopes, IList permissions) : base(id, name, type) + { + RoleName = roleName; + TypePropertiesType = typePropertiesType; + AssignableScopes = assignableScopes; + Permissions = permissions; + } + + /// A user-friendly name for the Role Definition. Must be unique for the database account. + public string RoleName { get; set; } + /// Indicates whether the Role Definition was built-in or user created. + public RoleDefinitionType? TypePropertiesType { get; set; } + /// A set of fully qualified Scopes at or below which Role Assignments may be created using this Role Definition. This will allow application of this Role Definition on the entire database account or any underlying Database / Collection. Must have at least one element. Scopes higher than Database account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes need not exist. + public IList AssignableScopes { get; } + /// The set of operations allowed through this Role Definition. + public IList Permissions { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleDefinitionListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleDefinitionListResult.Serialization.cs new file mode 100644 index 0000000000000..efc671f03f94e --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleDefinitionListResult.Serialization.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + internal partial class SqlRoleDefinitionListResult + { + internal static SqlRoleDefinitionListResult DeserializeSqlRoleDefinitionListResult(JsonElement element) + { + Optional> value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SqlRoleDefinitionGetResults.DeserializeSqlRoleDefinitionGetResults(item)); + } + value = array; + continue; + } + } + return new SqlRoleDefinitionListResult(Optional.ToList(value)); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleDefinitionListResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleDefinitionListResult.cs new file mode 100644 index 0000000000000..b1df4fed1ae8a --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlRoleDefinitionListResult.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The relevant Role Definitions. + internal partial class SqlRoleDefinitionListResult + { + /// Initializes a new instance of SqlRoleDefinitionListResult. + internal SqlRoleDefinitionListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of SqlRoleDefinitionListResult. + /// List of Role Definitions and their properties. + internal SqlRoleDefinitionListResult(IReadOnlyList value) + { + Value = value; + } + + /// List of Role Definitions and their properties. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlStoredProcedureCreateUpdateParameters.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlStoredProcedureCreateUpdateParameters.Serialization.cs index b21c32d1635eb..86f7bd97b5573 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlStoredProcedureCreateUpdateParameters.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlStoredProcedureCreateUpdateParameters.Serialization.cs @@ -36,8 +36,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStartObject(); writer.WritePropertyName("resource"); writer.WriteObjectValue(Resource); - writer.WritePropertyName("options"); - writer.WriteObjectValue(Options); + if (Optional.IsDefined(Options)) + { + writer.WritePropertyName("options"); + writer.WriteObjectValue(Options); + } writer.WriteEndObject(); writer.WriteEndObject(); } @@ -50,7 +53,7 @@ internal static SqlStoredProcedureCreateUpdateParameters DeserializeSqlStoredPro Optional location = default; Optional> tags = default; SqlStoredProcedureResource resource = default; - CreateUpdateOptions options = default; + Optional options = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("id")) @@ -104,6 +107,11 @@ internal static SqlStoredProcedureCreateUpdateParameters DeserializeSqlStoredPro } if (property0.NameEquals("options")) { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } options = CreateUpdateOptions.DeserializeCreateUpdateOptions(property0.Value); continue; } @@ -111,7 +119,7 @@ internal static SqlStoredProcedureCreateUpdateParameters DeserializeSqlStoredPro continue; } } - return new SqlStoredProcedureCreateUpdateParameters(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), resource, options); + return new SqlStoredProcedureCreateUpdateParameters(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), resource, options.Value); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlStoredProcedureCreateUpdateParameters.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlStoredProcedureCreateUpdateParameters.cs index 09f606c7e1f6a..ed4bdf4ab2627 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlStoredProcedureCreateUpdateParameters.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlStoredProcedureCreateUpdateParameters.cs @@ -15,21 +15,15 @@ public partial class SqlStoredProcedureCreateUpdateParameters : ARMResourcePrope { /// Initializes a new instance of SqlStoredProcedureCreateUpdateParameters. /// 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. - /// or is null. - public SqlStoredProcedureCreateUpdateParameters(SqlStoredProcedureResource resource, CreateUpdateOptions options) + /// is null. + public SqlStoredProcedureCreateUpdateParameters(SqlStoredProcedureResource resource) { if (resource == null) { throw new ArgumentNullException(nameof(resource)); } - if (options == null) - { - throw new ArgumentNullException(nameof(options)); - } Resource = resource; - Options = options; } /// Initializes a new instance of SqlStoredProcedureCreateUpdateParameters. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlStoredProcedureGetPropertiesResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlStoredProcedureGetPropertiesResource.Serialization.cs index dfcd071198ef8..1bd07f66ed6ad 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlStoredProcedureGetPropertiesResource.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlStoredProcedureGetPropertiesResource.Serialization.cs @@ -28,7 +28,7 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) internal static SqlStoredProcedureGetPropertiesResource DeserializeSqlStoredProcedureGetPropertiesResource(JsonElement element) { Optional Rid = default; - Optional Ts = default; + Optional Ts = default; Optional Etag = default; string id = default; Optional body = default; @@ -46,7 +46,7 @@ internal static SqlStoredProcedureGetPropertiesResource DeserializeSqlStoredProc property.ThrowNonNullablePropertyIsNull(); continue; } - Ts = property.Value.GetObject(); + Ts = property.Value.GetSingle(); continue; } if (property.NameEquals("_etag")) @@ -65,7 +65,7 @@ internal static SqlStoredProcedureGetPropertiesResource DeserializeSqlStoredProc continue; } } - return new SqlStoredProcedureGetPropertiesResource(id, body.Value, Rid.Value, Ts.Value, Etag.Value); + return new SqlStoredProcedureGetPropertiesResource(id, body.Value, Rid.Value, Optional.ToNullable(Ts), Etag.Value); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlStoredProcedureGetPropertiesResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlStoredProcedureGetPropertiesResource.cs index edba2b95b3691..40e2250713d9d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlStoredProcedureGetPropertiesResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlStoredProcedureGetPropertiesResource.cs @@ -29,7 +29,7 @@ public SqlStoredProcedureGetPropertiesResource(string id) : base(id) /// 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 SqlStoredProcedureGetPropertiesResource(string id, string body, string rid, object ts, string etag) : base(id, body) + internal SqlStoredProcedureGetPropertiesResource(string id, string body, string rid, float? ts, string etag) : base(id, body) { Rid = rid; Ts = ts; @@ -39,7 +39,7 @@ internal SqlStoredProcedureGetPropertiesResource(string id, string body, string /// A system generated property. A unique identifier. public string Rid { get; } /// A system generated property that denotes the last updated timestamp of the resource. - public object Ts { get; } + public float? Ts { get; } /// A system generated property representing the resource etag required for optimistic concurrency control. public string Etag { get; } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlTriggerCreateUpdateParameters.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlTriggerCreateUpdateParameters.Serialization.cs index 3a467ce27f4a7..198259b74268c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlTriggerCreateUpdateParameters.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlTriggerCreateUpdateParameters.Serialization.cs @@ -36,8 +36,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStartObject(); writer.WritePropertyName("resource"); writer.WriteObjectValue(Resource); - writer.WritePropertyName("options"); - writer.WriteObjectValue(Options); + if (Optional.IsDefined(Options)) + { + writer.WritePropertyName("options"); + writer.WriteObjectValue(Options); + } writer.WriteEndObject(); writer.WriteEndObject(); } @@ -50,7 +53,7 @@ internal static SqlTriggerCreateUpdateParameters DeserializeSqlTriggerCreateUpda Optional location = default; Optional> tags = default; SqlTriggerResource resource = default; - CreateUpdateOptions options = default; + Optional options = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("id")) @@ -104,6 +107,11 @@ internal static SqlTriggerCreateUpdateParameters DeserializeSqlTriggerCreateUpda } if (property0.NameEquals("options")) { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } options = CreateUpdateOptions.DeserializeCreateUpdateOptions(property0.Value); continue; } @@ -111,7 +119,7 @@ internal static SqlTriggerCreateUpdateParameters DeserializeSqlTriggerCreateUpda continue; } } - return new SqlTriggerCreateUpdateParameters(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), resource, options); + return new SqlTriggerCreateUpdateParameters(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), resource, options.Value); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlTriggerCreateUpdateParameters.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlTriggerCreateUpdateParameters.cs index 42687f4ef18f3..8d9f83f82b3f7 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlTriggerCreateUpdateParameters.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlTriggerCreateUpdateParameters.cs @@ -15,21 +15,15 @@ public partial class SqlTriggerCreateUpdateParameters : ARMResourceProperties { /// Initializes a new instance of SqlTriggerCreateUpdateParameters. /// 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. - /// or is null. - public SqlTriggerCreateUpdateParameters(SqlTriggerResource resource, CreateUpdateOptions options) + /// is null. + public SqlTriggerCreateUpdateParameters(SqlTriggerResource resource) { if (resource == null) { throw new ArgumentNullException(nameof(resource)); } - if (options == null) - { - throw new ArgumentNullException(nameof(options)); - } Resource = resource; - Options = options; } /// Initializes a new instance of SqlTriggerCreateUpdateParameters. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlTriggerGetPropertiesResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlTriggerGetPropertiesResource.Serialization.cs index 9e3fe3758a5c7..b5ce43d0cea15 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlTriggerGetPropertiesResource.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlTriggerGetPropertiesResource.Serialization.cs @@ -38,7 +38,7 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) internal static SqlTriggerGetPropertiesResource DeserializeSqlTriggerGetPropertiesResource(JsonElement element) { Optional Rid = default; - Optional Ts = default; + Optional Ts = default; Optional Etag = default; string id = default; Optional body = default; @@ -58,7 +58,7 @@ internal static SqlTriggerGetPropertiesResource DeserializeSqlTriggerGetProperti property.ThrowNonNullablePropertyIsNull(); continue; } - Ts = property.Value.GetObject(); + Ts = property.Value.GetSingle(); continue; } if (property.NameEquals("_etag")) @@ -97,7 +97,7 @@ internal static SqlTriggerGetPropertiesResource DeserializeSqlTriggerGetProperti continue; } } - return new SqlTriggerGetPropertiesResource(id, body.Value, Optional.ToNullable(triggerType), Optional.ToNullable(triggerOperation), Rid.Value, Ts.Value, Etag.Value); + return new SqlTriggerGetPropertiesResource(id, body.Value, Optional.ToNullable(triggerType), Optional.ToNullable(triggerOperation), Rid.Value, Optional.ToNullable(Ts), Etag.Value); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlTriggerGetPropertiesResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlTriggerGetPropertiesResource.cs index ee3385b83fa57..b83f21456b427 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlTriggerGetPropertiesResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlTriggerGetPropertiesResource.cs @@ -31,7 +31,7 @@ public SqlTriggerGetPropertiesResource(string id) : base(id) /// 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 SqlTriggerGetPropertiesResource(string id, string body, TriggerType? triggerType, TriggerOperation? triggerOperation, string rid, object ts, string etag) : base(id, body, triggerType, triggerOperation) + internal SqlTriggerGetPropertiesResource(string id, string body, TriggerType? triggerType, TriggerOperation? triggerOperation, string rid, float? ts, string etag) : base(id, body, triggerType, triggerOperation) { Rid = rid; Ts = ts; @@ -41,7 +41,7 @@ internal SqlTriggerGetPropertiesResource(string id, string body, TriggerType? tr /// A system generated property. A unique identifier. public string Rid { get; } /// A system generated property that denotes the last updated timestamp of the resource. - public object Ts { get; } + public float? Ts { get; } /// A system generated property representing the resource etag required for optimistic concurrency control. public string Etag { get; } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlUserDefinedFunctionCreateUpdateParameters.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlUserDefinedFunctionCreateUpdateParameters.Serialization.cs index c2beb5b3f720b..e18b0ffc80062 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlUserDefinedFunctionCreateUpdateParameters.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlUserDefinedFunctionCreateUpdateParameters.Serialization.cs @@ -36,8 +36,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStartObject(); writer.WritePropertyName("resource"); writer.WriteObjectValue(Resource); - writer.WritePropertyName("options"); - writer.WriteObjectValue(Options); + if (Optional.IsDefined(Options)) + { + writer.WritePropertyName("options"); + writer.WriteObjectValue(Options); + } writer.WriteEndObject(); writer.WriteEndObject(); } @@ -50,7 +53,7 @@ internal static SqlUserDefinedFunctionCreateUpdateParameters DeserializeSqlUserD Optional location = default; Optional> tags = default; SqlUserDefinedFunctionResource resource = default; - CreateUpdateOptions options = default; + Optional options = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("id")) @@ -104,6 +107,11 @@ internal static SqlUserDefinedFunctionCreateUpdateParameters DeserializeSqlUserD } if (property0.NameEquals("options")) { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } options = CreateUpdateOptions.DeserializeCreateUpdateOptions(property0.Value); continue; } @@ -111,7 +119,7 @@ internal static SqlUserDefinedFunctionCreateUpdateParameters DeserializeSqlUserD continue; } } - return new SqlUserDefinedFunctionCreateUpdateParameters(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), resource, options); + return new SqlUserDefinedFunctionCreateUpdateParameters(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), resource, options.Value); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlUserDefinedFunctionCreateUpdateParameters.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlUserDefinedFunctionCreateUpdateParameters.cs index d80a69a5e3f47..a076861684ddc 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlUserDefinedFunctionCreateUpdateParameters.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlUserDefinedFunctionCreateUpdateParameters.cs @@ -15,21 +15,15 @@ public partial class SqlUserDefinedFunctionCreateUpdateParameters : ARMResourceP { /// Initializes a new instance of SqlUserDefinedFunctionCreateUpdateParameters. /// 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. - /// or is null. - public SqlUserDefinedFunctionCreateUpdateParameters(SqlUserDefinedFunctionResource resource, CreateUpdateOptions options) + /// is null. + public SqlUserDefinedFunctionCreateUpdateParameters(SqlUserDefinedFunctionResource resource) { if (resource == null) { throw new ArgumentNullException(nameof(resource)); } - if (options == null) - { - throw new ArgumentNullException(nameof(options)); - } Resource = resource; - Options = options; } /// Initializes a new instance of SqlUserDefinedFunctionCreateUpdateParameters. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlUserDefinedFunctionGetPropertiesResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlUserDefinedFunctionGetPropertiesResource.Serialization.cs index 680a97905463a..de9c81506c997 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlUserDefinedFunctionGetPropertiesResource.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlUserDefinedFunctionGetPropertiesResource.Serialization.cs @@ -28,7 +28,7 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) internal static SqlUserDefinedFunctionGetPropertiesResource DeserializeSqlUserDefinedFunctionGetPropertiesResource(JsonElement element) { Optional Rid = default; - Optional Ts = default; + Optional Ts = default; Optional Etag = default; string id = default; Optional body = default; @@ -46,7 +46,7 @@ internal static SqlUserDefinedFunctionGetPropertiesResource DeserializeSqlUserDe property.ThrowNonNullablePropertyIsNull(); continue; } - Ts = property.Value.GetObject(); + Ts = property.Value.GetSingle(); continue; } if (property.NameEquals("_etag")) @@ -65,7 +65,7 @@ internal static SqlUserDefinedFunctionGetPropertiesResource DeserializeSqlUserDe continue; } } - return new SqlUserDefinedFunctionGetPropertiesResource(id, body.Value, Rid.Value, Ts.Value, Etag.Value); + return new SqlUserDefinedFunctionGetPropertiesResource(id, body.Value, Rid.Value, Optional.ToNullable(Ts), Etag.Value); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlUserDefinedFunctionGetPropertiesResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlUserDefinedFunctionGetPropertiesResource.cs index 539f936551b62..a3741447e5e91 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlUserDefinedFunctionGetPropertiesResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlUserDefinedFunctionGetPropertiesResource.cs @@ -29,7 +29,7 @@ public SqlUserDefinedFunctionGetPropertiesResource(string id) : base(id) /// 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 SqlUserDefinedFunctionGetPropertiesResource(string id, string body, string rid, object ts, string etag) : base(id, body) + internal SqlUserDefinedFunctionGetPropertiesResource(string id, string body, string rid, float? ts, string etag) : base(id, body) { Rid = rid; Ts = ts; @@ -39,7 +39,7 @@ internal SqlUserDefinedFunctionGetPropertiesResource(string id, string body, str /// A system generated property. A unique identifier. public string Rid { get; } /// A system generated property that denotes the last updated timestamp of the resource. - public object Ts { get; } + public float? Ts { get; } /// A system generated property representing the resource etag required for optimistic concurrency control. public string Etag { get; } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SystemData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SystemData.Serialization.cs new file mode 100644 index 0000000000000..7ae4cc1755b3e --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SystemData.Serialization.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class SystemData + { + internal static SystemData DeserializeSystemData(JsonElement element) + { + Optional createdBy = default; + Optional createdByType = default; + Optional createdAt = default; + Optional lastModifiedBy = default; + Optional lastModifiedByType = default; + Optional lastModifiedAt = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("createdBy")) + { + createdBy = property.Value.GetString(); + continue; + } + if (property.NameEquals("createdByType")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + createdByType = new CreatedByType(property.Value.GetString()); + continue; + } + if (property.NameEquals("createdAt")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + createdAt = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastModifiedBy")) + { + lastModifiedBy = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastModifiedByType")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + lastModifiedByType = new CreatedByType(property.Value.GetString()); + continue; + } + if (property.NameEquals("lastModifiedAt")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + lastModifiedAt = property.Value.GetDateTimeOffset("O"); + continue; + } + } + return new SystemData(createdBy.Value, Optional.ToNullable(createdByType), Optional.ToNullable(createdAt), lastModifiedBy.Value, Optional.ToNullable(lastModifiedByType), Optional.ToNullable(lastModifiedAt)); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SystemData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SystemData.cs new file mode 100644 index 0000000000000..b5bd302523738 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SystemData.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// Metadata pertaining to creation and last modification of the resource. + public partial class SystemData + { + /// Initializes a new instance of SystemData. + internal SystemData() + { + } + + /// Initializes a new instance of SystemData. + /// The identity that created the resource. + /// The type of identity that created the resource. + /// The timestamp of resource creation (UTC). + /// The identity that last modified the resource. + /// The type of identity that last modified the resource. + /// The timestamp of resource last modification (UTC). + internal SystemData(string createdBy, CreatedByType? createdByType, DateTimeOffset? createdAt, string lastModifiedBy, CreatedByType? lastModifiedByType, DateTimeOffset? lastModifiedAt) + { + CreatedBy = createdBy; + CreatedByType = createdByType; + CreatedAt = createdAt; + LastModifiedBy = lastModifiedBy; + LastModifiedByType = lastModifiedByType; + LastModifiedAt = lastModifiedAt; + } + + /// The identity that created the resource. + public string CreatedBy { get; } + /// The type of identity that created the resource. + public CreatedByType? CreatedByType { get; } + /// The timestamp of resource creation (UTC). + public DateTimeOffset? CreatedAt { get; } + /// The identity that last modified the resource. + public string LastModifiedBy { get; } + /// The type of identity that last modified the resource. + public CreatedByType? LastModifiedByType { get; } + /// The timestamp of resource last modification (UTC). + public DateTimeOffset? LastModifiedAt { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/TableCreateUpdateParameters.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/TableCreateUpdateParameters.Serialization.cs index 45681ec0cec75..df334ec78e0de 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/TableCreateUpdateParameters.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/TableCreateUpdateParameters.Serialization.cs @@ -36,8 +36,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStartObject(); writer.WritePropertyName("resource"); writer.WriteObjectValue(Resource); - writer.WritePropertyName("options"); - writer.WriteObjectValue(Options); + if (Optional.IsDefined(Options)) + { + writer.WritePropertyName("options"); + writer.WriteObjectValue(Options); + } writer.WriteEndObject(); writer.WriteEndObject(); } @@ -50,7 +53,7 @@ internal static TableCreateUpdateParameters DeserializeTableCreateUpdateParamete Optional location = default; Optional> tags = default; TableResource resource = default; - CreateUpdateOptions options = default; + Optional options = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("id")) @@ -104,6 +107,11 @@ internal static TableCreateUpdateParameters DeserializeTableCreateUpdateParamete } if (property0.NameEquals("options")) { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } options = CreateUpdateOptions.DeserializeCreateUpdateOptions(property0.Value); continue; } @@ -111,7 +119,7 @@ internal static TableCreateUpdateParameters DeserializeTableCreateUpdateParamete continue; } } - return new TableCreateUpdateParameters(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), resource, options); + return new TableCreateUpdateParameters(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), resource, options.Value); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/TableCreateUpdateParameters.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/TableCreateUpdateParameters.cs index 3336a38f97735..2fc083aaeb3b0 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/TableCreateUpdateParameters.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/TableCreateUpdateParameters.cs @@ -15,21 +15,15 @@ public partial class TableCreateUpdateParameters : ARMResourceProperties { /// Initializes a new instance of TableCreateUpdateParameters. /// 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. - /// or is null. - public TableCreateUpdateParameters(TableResource resource, CreateUpdateOptions options) + /// is null. + public TableCreateUpdateParameters(TableResource resource) { if (resource == null) { throw new ArgumentNullException(nameof(resource)); } - if (options == null) - { - throw new ArgumentNullException(nameof(options)); - } Resource = resource; - Options = options; } /// Initializes a new instance of TableCreateUpdateParameters. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/TableGetPropertiesResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/TableGetPropertiesResource.Serialization.cs index d9a8a921b931e..2c414460150e2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/TableGetPropertiesResource.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/TableGetPropertiesResource.Serialization.cs @@ -23,7 +23,7 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) internal static TableGetPropertiesResource DeserializeTableGetPropertiesResource(JsonElement element) { Optional Rid = default; - Optional Ts = default; + Optional Ts = default; Optional Etag = default; string id = default; foreach (var property in element.EnumerateObject()) @@ -40,7 +40,7 @@ internal static TableGetPropertiesResource DeserializeTableGetPropertiesResource property.ThrowNonNullablePropertyIsNull(); continue; } - Ts = property.Value.GetObject(); + Ts = property.Value.GetSingle(); continue; } if (property.NameEquals("_etag")) @@ -54,7 +54,7 @@ internal static TableGetPropertiesResource DeserializeTableGetPropertiesResource continue; } } - return new TableGetPropertiesResource(id, Rid.Value, Ts.Value, Etag.Value); + return new TableGetPropertiesResource(id, Rid.Value, Optional.ToNullable(Ts), Etag.Value); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/TableGetPropertiesResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/TableGetPropertiesResource.cs index 4c8dd0dbce519..b1c543f639084 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/TableGetPropertiesResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/TableGetPropertiesResource.cs @@ -29,7 +29,7 @@ public TableGetPropertiesResource(string id) : base(id) /// 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. /// is null. - internal TableGetPropertiesResource(string id, string rid, object ts, string etag) : base(id) + internal TableGetPropertiesResource(string id, string rid, float? ts, string etag) : base(id) { if (id == null) { @@ -44,7 +44,7 @@ internal TableGetPropertiesResource(string id, string rid, object ts, string eta /// A system generated property. A unique identifier. public string Rid { get; } /// A system generated property that denotes the last updated timestamp of the resource. - public object Ts { get; } + public float? Ts { get; } /// A system generated property representing the resource etag required for optimistic concurrency control. public string Etag { get; } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsGetPropertiesResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsGetPropertiesResource.Serialization.cs index 51e22e0519f3e..0783c430febcd 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsGetPropertiesResource.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsGetPropertiesResource.Serialization.cs @@ -31,7 +31,7 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) internal static ThroughputSettingsGetPropertiesResource DeserializeThroughputSettingsGetPropertiesResource(JsonElement element) { Optional Rid = default; - Optional Ts = default; + Optional Ts = default; Optional Etag = default; Optional throughput = default; Optional autoscaleSettings = default; @@ -51,7 +51,7 @@ internal static ThroughputSettingsGetPropertiesResource DeserializeThroughputSet property.ThrowNonNullablePropertyIsNull(); continue; } - Ts = property.Value.GetObject(); + Ts = property.Value.GetSingle(); continue; } if (property.NameEquals("_etag")) @@ -90,7 +90,7 @@ internal static ThroughputSettingsGetPropertiesResource DeserializeThroughputSet continue; } } - return new ThroughputSettingsGetPropertiesResource(Optional.ToNullable(throughput), autoscaleSettings.Value, minimumThroughput.Value, offerReplacePending.Value, Rid.Value, Ts.Value, Etag.Value); + return new ThroughputSettingsGetPropertiesResource(Optional.ToNullable(throughput), autoscaleSettings.Value, minimumThroughput.Value, offerReplacePending.Value, Rid.Value, Optional.ToNullable(Ts), Etag.Value); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsGetPropertiesResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsGetPropertiesResource.cs index 74de1bb0f78a8..33f99787d28b4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsGetPropertiesResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsGetPropertiesResource.cs @@ -23,7 +23,7 @@ public ThroughputSettingsGetPropertiesResource() /// 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 ThroughputSettingsGetPropertiesResource(int? throughput, AutoscaleSettingsResource autoscaleSettings, string minimumThroughput, string offerReplacePending, string rid, object ts, string etag) : base(throughput, autoscaleSettings, minimumThroughput, offerReplacePending) + internal ThroughputSettingsGetPropertiesResource(int? throughput, AutoscaleSettingsResource autoscaleSettings, string minimumThroughput, string offerReplacePending, string rid, float? ts, string etag) : base(throughput, autoscaleSettings, minimumThroughput, offerReplacePending) { Rid = rid; Ts = ts; @@ -33,7 +33,7 @@ internal ThroughputSettingsGetPropertiesResource(int? throughput, AutoscaleSetti /// A system generated property. A unique identifier. public string Rid { get; } /// A system generated property that denotes the last updated timestamp of the resource. - public object Ts { get; } + public float? Ts { get; } /// A system generated property representing the resource etag required for optimistic concurrency control. public string Etag { get; } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBResourcesOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBResourcesOperations.cs index d815b774e3437..88b74805493c9 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBResourcesOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBResourcesOperations.cs @@ -32,9 +32,10 @@ protected MongoDBResourcesOperations() /// The HTTP pipeline for sending and receiving REST requests and responses. /// The ID of the target subscription. /// server parameter. - internal MongoDBResourcesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null) + /// Api Version. + internal MongoDBResourcesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") { - RestClient = new MongoDBResourcesRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint); + RestClient = new MongoDBResourcesRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion); _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBResourcesRestOperations.cs index b9848664aea21..9480ca31050f3 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBResourcesRestOperations.cs @@ -20,6 +20,7 @@ internal partial class MongoDBResourcesRestOperations { private string subscriptionId; private Uri endpoint; + private string apiVersion; private ClientDiagnostics _clientDiagnostics; private HttpPipeline _pipeline; @@ -28,17 +29,23 @@ internal partial class MongoDBResourcesRestOperations /// The HTTP pipeline for sending and receiving REST requests and responses. /// The ID of the target subscription. /// server parameter. - /// is null. - public MongoDBResourcesRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null) + /// Api Version. + /// or is null. + public MongoDBResourcesRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") { if (subscriptionId == null) { throw new ArgumentNullException(nameof(subscriptionId)); } endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } this.subscriptionId = subscriptionId; this.endpoint = endpoint; + this.apiVersion = apiVersion; _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } @@ -57,7 +64,7 @@ internal HttpMessage CreateListMongoDBDatabasesRequest(string resourceGroupName, uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); uri.AppendPath(accountName, true); uri.AppendPath("/mongodbDatabases", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -142,7 +149,7 @@ internal HttpMessage CreateGetMongoDBDatabaseRequest(string resourceGroupName, s uri.AppendPath(accountName, true); uri.AppendPath("/mongodbDatabases/", false); uri.AppendPath(databaseName, true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -237,7 +244,7 @@ internal HttpMessage CreateCreateUpdateMongoDBDatabaseRequest(string resourceGro uri.AppendPath(accountName, true); uri.AppendPath("/mongodbDatabases/", false); uri.AppendPath(databaseName, true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); @@ -338,7 +345,7 @@ internal HttpMessage CreateDeleteMongoDBDatabaseRequest(string resourceGroupName uri.AppendPath(accountName, true); uri.AppendPath("/mongodbDatabases/", false); uri.AppendPath(databaseName, true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; return message; } @@ -425,7 +432,7 @@ internal HttpMessage CreateGetMongoDBDatabaseThroughputRequest(string resourceGr uri.AppendPath("/mongodbDatabases/", false); uri.AppendPath(databaseName, true); uri.AppendPath("/throughputSettings/default", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -521,7 +528,7 @@ internal HttpMessage CreateUpdateMongoDBDatabaseThroughputRequest(string resourc uri.AppendPath("/mongodbDatabases/", false); uri.AppendPath(databaseName, true); uri.AppendPath("/throughputSettings/default", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); @@ -623,7 +630,7 @@ internal HttpMessage CreateMigrateMongoDBDatabaseToAutoscaleRequest(string resou uri.AppendPath("/mongodbDatabases/", false); uri.AppendPath(databaseName, true); uri.AppendPath("/throughputSettings/default/migrateToAutoscale", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -711,7 +718,7 @@ internal HttpMessage CreateMigrateMongoDBDatabaseToManualThroughputRequest(strin uri.AppendPath("/mongodbDatabases/", false); uri.AppendPath(databaseName, true); uri.AppendPath("/throughputSettings/default/migrateToManualThroughput", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -799,7 +806,7 @@ internal HttpMessage CreateListMongoDBCollectionsRequest(string resourceGroupNam uri.AppendPath("/mongodbDatabases/", false); uri.AppendPath(databaseName, true); uri.AppendPath("/collections", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -896,7 +903,7 @@ internal HttpMessage CreateGetMongoDBCollectionRequest(string resourceGroupName, uri.AppendPath(databaseName, true); uri.AppendPath("/collections/", false); uri.AppendPath(collectionName, true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -1003,7 +1010,7 @@ internal HttpMessage CreateCreateUpdateMongoDBCollectionRequest(string resourceG uri.AppendPath(databaseName, true); uri.AppendPath("/collections/", false); uri.AppendPath(collectionName, true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); @@ -1116,7 +1123,7 @@ internal HttpMessage CreateDeleteMongoDBCollectionRequest(string resourceGroupNa uri.AppendPath(databaseName, true); uri.AppendPath("/collections/", false); uri.AppendPath(collectionName, true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; return message; } @@ -1215,7 +1222,7 @@ internal HttpMessage CreateGetMongoDBCollectionThroughputRequest(string resource uri.AppendPath("/collections/", false); uri.AppendPath(collectionName, true); uri.AppendPath("/throughputSettings/default", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -1323,7 +1330,7 @@ internal HttpMessage CreateUpdateMongoDBCollectionThroughputRequest(string resou uri.AppendPath("/collections/", false); uri.AppendPath(collectionName, true); uri.AppendPath("/throughputSettings/default", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); @@ -1437,7 +1444,7 @@ internal HttpMessage CreateMigrateMongoDBCollectionToAutoscaleRequest(string res uri.AppendPath("/collections/", false); uri.AppendPath(collectionName, true); uri.AppendPath("/throughputSettings/default/migrateToAutoscale", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -1537,7 +1544,7 @@ internal HttpMessage CreateMigrateMongoDBCollectionToManualThroughputRequest(str uri.AppendPath("/collections/", false); uri.AppendPath(collectionName, true); uri.AppendPath("/throughputSettings/default/migrateToManualThroughput", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NotebookWorkspacesOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NotebookWorkspacesOperations.cs index 995fefa2dd2aa..3fe8201da0ceb 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NotebookWorkspacesOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NotebookWorkspacesOperations.cs @@ -32,9 +32,10 @@ protected NotebookWorkspacesOperations() /// The HTTP pipeline for sending and receiving REST requests and responses. /// The ID of the target subscription. /// server parameter. - internal NotebookWorkspacesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null) + /// Api Version. + internal NotebookWorkspacesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") { - RestClient = new NotebookWorkspacesRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint); + RestClient = new NotebookWorkspacesRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion); _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NotebookWorkspacesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NotebookWorkspacesRestOperations.cs index 8b421686d8ae5..dddc509b00027 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NotebookWorkspacesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NotebookWorkspacesRestOperations.cs @@ -20,6 +20,7 @@ internal partial class NotebookWorkspacesRestOperations { private string subscriptionId; private Uri endpoint; + private string apiVersion; private ClientDiagnostics _clientDiagnostics; private HttpPipeline _pipeline; @@ -28,17 +29,23 @@ internal partial class NotebookWorkspacesRestOperations /// The HTTP pipeline for sending and receiving REST requests and responses. /// The ID of the target subscription. /// server parameter. - /// is null. - public NotebookWorkspacesRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null) + /// Api Version. + /// or is null. + public NotebookWorkspacesRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") { if (subscriptionId == null) { throw new ArgumentNullException(nameof(subscriptionId)); } endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } this.subscriptionId = subscriptionId; this.endpoint = endpoint; + this.apiVersion = apiVersion; _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } @@ -57,7 +64,7 @@ internal HttpMessage CreateListByDatabaseAccountRequest(string resourceGroupName uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); uri.AppendPath(accountName, true); uri.AppendPath("/notebookWorkspaces", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -142,7 +149,7 @@ internal HttpMessage CreateGetRequest(string resourceGroupName, string accountNa uri.AppendPath(accountName, true); uri.AppendPath("/notebookWorkspaces/", false); uri.AppendPath(notebookWorkspaceName.ToString(), true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -229,7 +236,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, strin uri.AppendPath(accountName, true); uri.AppendPath("/notebookWorkspaces/", false); uri.AppendPath(notebookWorkspaceName.ToString(), true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); @@ -320,7 +327,7 @@ internal HttpMessage CreateDeleteRequest(string resourceGroupName, string accoun uri.AppendPath(accountName, true); uri.AppendPath("/notebookWorkspaces/", false); uri.AppendPath(notebookWorkspaceName.ToString(), true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -400,7 +407,7 @@ internal HttpMessage CreateListConnectionInfoRequest(string resourceGroupName, s uri.AppendPath("/notebookWorkspaces/", false); uri.AppendPath(notebookWorkspaceName.ToString(), true); uri.AppendPath("/listConnectionInfo", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -488,7 +495,7 @@ internal HttpMessage CreateRegenerateAuthTokenRequest(string resourceGroupName, uri.AppendPath("/notebookWorkspaces/", false); uri.AppendPath(notebookWorkspaceName.ToString(), true); uri.AppendPath("/regenerateAuthToken", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -568,7 +575,7 @@ internal HttpMessage CreateStartRequest(string resourceGroupName, string account uri.AppendPath("/notebookWorkspaces/", false); uri.AppendPath(notebookWorkspaceName.ToString(), true); uri.AppendPath("/start", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Operations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Operations.cs index 36ded75601952..316f41f422caf 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Operations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Operations.cs @@ -31,9 +31,10 @@ protected Operations() /// The handler for diagnostic messaging in the client. /// The HTTP pipeline for sending and receiving REST requests and responses. /// server parameter. - internal Operations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint = null) + /// Api Version. + internal Operations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint = null, string apiVersion = "2021-06-15") { - RestClient = new RestOperations(clientDiagnostics, pipeline, endpoint); + RestClient = new RestOperations(clientDiagnostics, pipeline, endpoint, apiVersion); _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PartitionKeyRangeIdOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PartitionKeyRangeIdOperations.cs index 23436f3af6f0d..d43f5b9ca977f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PartitionKeyRangeIdOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PartitionKeyRangeIdOperations.cs @@ -32,9 +32,10 @@ protected PartitionKeyRangeIdOperations() /// The HTTP pipeline for sending and receiving REST requests and responses. /// The ID of the target subscription. /// server parameter. - internal PartitionKeyRangeIdOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null) + /// Api Version. + internal PartitionKeyRangeIdOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") { - RestClient = new PartitionKeyRangeIdRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint); + RestClient = new PartitionKeyRangeIdRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion); _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PartitionKeyRangeIdRegionOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PartitionKeyRangeIdRegionOperations.cs index c7c4acd0aebf7..0e496d20a59f2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PartitionKeyRangeIdRegionOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PartitionKeyRangeIdRegionOperations.cs @@ -32,9 +32,10 @@ protected PartitionKeyRangeIdRegionOperations() /// The HTTP pipeline for sending and receiving REST requests and responses. /// The ID of the target subscription. /// server parameter. - internal PartitionKeyRangeIdRegionOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null) + /// Api Version. + internal PartitionKeyRangeIdRegionOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") { - RestClient = new PartitionKeyRangeIdRegionRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint); + RestClient = new PartitionKeyRangeIdRegionRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion); _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PartitionKeyRangeIdRegionRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PartitionKeyRangeIdRegionRestOperations.cs index ede3184f35d5d..11c4cdd244029 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PartitionKeyRangeIdRegionRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PartitionKeyRangeIdRegionRestOperations.cs @@ -20,6 +20,7 @@ internal partial class PartitionKeyRangeIdRegionRestOperations { private string subscriptionId; private Uri endpoint; + private string apiVersion; private ClientDiagnostics _clientDiagnostics; private HttpPipeline _pipeline; @@ -28,17 +29,23 @@ internal partial class PartitionKeyRangeIdRegionRestOperations /// The HTTP pipeline for sending and receiving REST requests and responses. /// The ID of the target subscription. /// server parameter. - /// is null. - public PartitionKeyRangeIdRegionRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null) + /// Api Version. + /// or is null. + public PartitionKeyRangeIdRegionRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") { if (subscriptionId == null) { throw new ArgumentNullException(nameof(subscriptionId)); } endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } this.subscriptionId = subscriptionId; this.endpoint = endpoint; + this.apiVersion = apiVersion; _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } @@ -65,7 +72,7 @@ internal HttpMessage CreateListMetricsRequest(string resourceGroupName, string a uri.AppendPath("/partitionKeyRangeId/", false); uri.AppendPath(partitionKeyRangeId, true); uri.AppendPath("/metrics", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); uri.AppendQuery("$filter", filter, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PartitionKeyRangeIdRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PartitionKeyRangeIdRestOperations.cs index b35fe46317849..e16276aa51583 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PartitionKeyRangeIdRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PartitionKeyRangeIdRestOperations.cs @@ -20,6 +20,7 @@ internal partial class PartitionKeyRangeIdRestOperations { private string subscriptionId; private Uri endpoint; + private string apiVersion; private ClientDiagnostics _clientDiagnostics; private HttpPipeline _pipeline; @@ -28,17 +29,23 @@ internal partial class PartitionKeyRangeIdRestOperations /// The HTTP pipeline for sending and receiving REST requests and responses. /// The ID of the target subscription. /// server parameter. - /// is null. - public PartitionKeyRangeIdRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null) + /// Api Version. + /// or is null. + public PartitionKeyRangeIdRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") { if (subscriptionId == null) { throw new ArgumentNullException(nameof(subscriptionId)); } endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } this.subscriptionId = subscriptionId; this.endpoint = endpoint; + this.apiVersion = apiVersion; _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } @@ -63,7 +70,7 @@ internal HttpMessage CreateListMetricsRequest(string resourceGroupName, string a uri.AppendPath("/partitionKeyRangeId/", false); uri.AppendPath(partitionKeyRangeId, true); uri.AppendPath("/metrics", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); uri.AppendQuery("$filter", filter, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PercentileOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PercentileOperations.cs index 6f908b8eed636..4ce10955f9302 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PercentileOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PercentileOperations.cs @@ -32,9 +32,10 @@ protected PercentileOperations() /// The HTTP pipeline for sending and receiving REST requests and responses. /// The ID of the target subscription. /// server parameter. - internal PercentileOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null) + /// Api Version. + internal PercentileOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") { - RestClient = new PercentileRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint); + RestClient = new PercentileRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion); _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PercentileRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PercentileRestOperations.cs index cf8117d599d49..b9fd439ce52a4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PercentileRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PercentileRestOperations.cs @@ -20,6 +20,7 @@ internal partial class PercentileRestOperations { private string subscriptionId; private Uri endpoint; + private string apiVersion; private ClientDiagnostics _clientDiagnostics; private HttpPipeline _pipeline; @@ -28,17 +29,23 @@ internal partial class PercentileRestOperations /// The HTTP pipeline for sending and receiving REST requests and responses. /// The ID of the target subscription. /// server parameter. - /// is null. - public PercentileRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null) + /// Api Version. + /// or is null. + public PercentileRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") { if (subscriptionId == null) { throw new ArgumentNullException(nameof(subscriptionId)); } endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } this.subscriptionId = subscriptionId; this.endpoint = endpoint; + this.apiVersion = apiVersion; _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } @@ -57,7 +64,7 @@ internal HttpMessage CreateListMetricsRequest(string resourceGroupName, string a uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); uri.AppendPath(accountName, true); uri.AppendPath("/percentile/metrics", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); uri.AppendQuery("$filter", filter, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PercentileSourceTargetOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PercentileSourceTargetOperations.cs index 5d237a2ad6ea6..6153f1b83c5a0 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PercentileSourceTargetOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PercentileSourceTargetOperations.cs @@ -32,9 +32,10 @@ protected PercentileSourceTargetOperations() /// The HTTP pipeline for sending and receiving REST requests and responses. /// The ID of the target subscription. /// server parameter. - internal PercentileSourceTargetOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null) + /// Api Version. + internal PercentileSourceTargetOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") { - RestClient = new PercentileSourceTargetRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint); + RestClient = new PercentileSourceTargetRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion); _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PercentileSourceTargetRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PercentileSourceTargetRestOperations.cs index e8a7b7df8bf64..eb4ab9529a974 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PercentileSourceTargetRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PercentileSourceTargetRestOperations.cs @@ -20,6 +20,7 @@ internal partial class PercentileSourceTargetRestOperations { private string subscriptionId; private Uri endpoint; + private string apiVersion; private ClientDiagnostics _clientDiagnostics; private HttpPipeline _pipeline; @@ -28,17 +29,23 @@ internal partial class PercentileSourceTargetRestOperations /// The HTTP pipeline for sending and receiving REST requests and responses. /// The ID of the target subscription. /// server parameter. - /// is null. - public PercentileSourceTargetRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null) + /// Api Version. + /// or is null. + public PercentileSourceTargetRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") { if (subscriptionId == null) { throw new ArgumentNullException(nameof(subscriptionId)); } endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } this.subscriptionId = subscriptionId; this.endpoint = endpoint; + this.apiVersion = apiVersion; _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } @@ -61,7 +68,7 @@ internal HttpMessage CreateListMetricsRequest(string resourceGroupName, string a uri.AppendPath("/targetRegion/", false); uri.AppendPath(targetRegion, true); uri.AppendPath("/percentile/metrics", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); uri.AppendQuery("$filter", filter, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PercentileTargetOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PercentileTargetOperations.cs index e4acf0c44ad36..3fdc0baa17da5 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PercentileTargetOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PercentileTargetOperations.cs @@ -32,9 +32,10 @@ protected PercentileTargetOperations() /// The HTTP pipeline for sending and receiving REST requests and responses. /// The ID of the target subscription. /// server parameter. - internal PercentileTargetOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null) + /// Api Version. + internal PercentileTargetOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") { - RestClient = new PercentileTargetRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint); + RestClient = new PercentileTargetRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion); _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PercentileTargetRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PercentileTargetRestOperations.cs index a7bb03f236a56..68c676ef97e9e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PercentileTargetRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PercentileTargetRestOperations.cs @@ -20,6 +20,7 @@ internal partial class PercentileTargetRestOperations { private string subscriptionId; private Uri endpoint; + private string apiVersion; private ClientDiagnostics _clientDiagnostics; private HttpPipeline _pipeline; @@ -28,17 +29,23 @@ internal partial class PercentileTargetRestOperations /// The HTTP pipeline for sending and receiving REST requests and responses. /// The ID of the target subscription. /// server parameter. - /// is null. - public PercentileTargetRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null) + /// Api Version. + /// or is null. + public PercentileTargetRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") { if (subscriptionId == null) { throw new ArgumentNullException(nameof(subscriptionId)); } endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } this.subscriptionId = subscriptionId; this.endpoint = endpoint; + this.apiVersion = apiVersion; _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } @@ -59,7 +66,7 @@ internal HttpMessage CreateListMetricsRequest(string resourceGroupName, string a uri.AppendPath("/targetRegion/", false); uri.AppendPath(targetRegion, true); uri.AppendPath("/percentile/metrics", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); uri.AppendQuery("$filter", filter, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PrivateEndpointConnectionsCreateOrUpdateOperation.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PrivateEndpointConnectionsCreateOrUpdateOperation.cs index 79c2326d81354..b1925d9f78cb8 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PrivateEndpointConnectionsCreateOrUpdateOperation.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PrivateEndpointConnectionsCreateOrUpdateOperation.cs @@ -17,9 +17,9 @@ namespace Azure.ResourceManager.CosmosDB { /// Approve or reject a private endpoint connection with a given name. - public partial class PrivateEndpointConnectionsCreateOrUpdateOperation : Operation, IOperationSource + public partial class PrivateEndpointConnectionsCreateOrUpdateOperation : Operation, IOperationSource { - private readonly ArmOperationHelpers _operation; + private readonly ArmOperationHelpers _operation; /// Initializes a new instance of PrivateEndpointConnectionsCreateOrUpdateOperation for mocking. protected PrivateEndpointConnectionsCreateOrUpdateOperation() @@ -28,13 +28,13 @@ protected PrivateEndpointConnectionsCreateOrUpdateOperation() internal PrivateEndpointConnectionsCreateOrUpdateOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response) { - _operation = new ArmOperationHelpers(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "PrivateEndpointConnectionsCreateOrUpdateOperation"); + _operation = new ArmOperationHelpers(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "PrivateEndpointConnectionsCreateOrUpdateOperation"); } /// public override string Id => _operation.Id; /// - public override PrivateEndpointConnectionAutoGenerated Value => _operation.Value; + public override PrivateEndpointConnection Value => _operation.Value; /// public override bool HasCompleted => _operation.HasCompleted; @@ -52,21 +52,21 @@ internal PrivateEndpointConnectionsCreateOrUpdateOperation(ClientDiagnostics cli public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); /// - public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); + public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); /// - public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); + public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); - PrivateEndpointConnectionAutoGenerated IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + PrivateEndpointConnection IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) { using var document = JsonDocument.Parse(response.ContentStream); - return PrivateEndpointConnectionAutoGenerated.DeserializePrivateEndpointConnectionAutoGenerated(document.RootElement); + return PrivateEndpointConnection.DeserializePrivateEndpointConnection(document.RootElement); } - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) { using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - return PrivateEndpointConnectionAutoGenerated.DeserializePrivateEndpointConnectionAutoGenerated(document.RootElement); + return PrivateEndpointConnection.DeserializePrivateEndpointConnection(document.RootElement); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PrivateEndpointConnectionsOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PrivateEndpointConnectionsOperations.cs index fb1a4c4a6923e..664c99945e79e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PrivateEndpointConnectionsOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PrivateEndpointConnectionsOperations.cs @@ -32,9 +32,10 @@ protected PrivateEndpointConnectionsOperations() /// The HTTP pipeline for sending and receiving REST requests and responses. /// The ID of the target subscription. /// server parameter. - internal PrivateEndpointConnectionsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null) + /// Api Version. + internal PrivateEndpointConnectionsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") { - RestClient = new PrivateEndpointConnectionsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint); + RestClient = new PrivateEndpointConnectionsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion); _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } @@ -44,7 +45,7 @@ internal PrivateEndpointConnectionsOperations(ClientDiagnostics clientDiagnostic /// Cosmos DB database account name. /// The name of the private endpoint connection. /// The cancellation token to use. - public virtual async Task> GetAsync(string resourceGroupName, string accountName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(string resourceGroupName, string accountName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.Get"); scope.Start(); @@ -64,7 +65,7 @@ public virtual async Task> GetA /// Cosmos DB database account name. /// The name of the private endpoint connection. /// The cancellation token to use. - public virtual Response Get(string resourceGroupName, string accountName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + public virtual Response Get(string resourceGroupName, string accountName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.Get"); scope.Start(); @@ -84,7 +85,7 @@ public virtual Response Get(string resou /// Cosmos DB database account name. /// The cancellation token to use. /// or is null. - public virtual AsyncPageable ListByDatabaseAccountAsync(string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + public virtual AsyncPageable ListByDatabaseAccountAsync(string resourceGroupName, string accountName, CancellationToken cancellationToken = default) { if (resourceGroupName == null) { @@ -95,7 +96,7 @@ public virtual AsyncPageable ListByDatab throw new ArgumentNullException(nameof(accountName)); } - async Task> FirstPageFunc(int? pageSizeHint) + async Task> FirstPageFunc(int? pageSizeHint) { using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.ListByDatabaseAccount"); scope.Start(); @@ -118,7 +119,7 @@ async Task> FirstPageFunc(int? page /// Cosmos DB database account name. /// The cancellation token to use. /// or is null. - public virtual Pageable ListByDatabaseAccount(string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + public virtual Pageable ListByDatabaseAccount(string resourceGroupName, string accountName, CancellationToken cancellationToken = default) { if (resourceGroupName == null) { @@ -129,7 +130,7 @@ public virtual Pageable ListByDatabaseAc throw new ArgumentNullException(nameof(accountName)); } - Page FirstPageFunc(int? pageSizeHint) + Page FirstPageFunc(int? pageSizeHint) { using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.ListByDatabaseAccount"); scope.Start(); @@ -151,10 +152,10 @@ Page FirstPageFunc(int? pageSizeHint) /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The name of the private endpoint connection. - /// The PrivateEndpointConnectionAutoGenerated to use. + /// The PrivateEndpointConnection to use. /// The cancellation token to use. /// , , , or is null. - public virtual async Task StartCreateOrUpdateAsync(string resourceGroupName, string accountName, string privateEndpointConnectionName, PrivateEndpointConnectionAutoGenerated parameters, CancellationToken cancellationToken = default) + public virtual async Task StartCreateOrUpdateAsync(string resourceGroupName, string accountName, string privateEndpointConnectionName, PrivateEndpointConnection parameters, CancellationToken cancellationToken = default) { if (resourceGroupName == null) { @@ -191,10 +192,10 @@ public virtual async Task Sta /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The name of the private endpoint connection. - /// The PrivateEndpointConnectionAutoGenerated to use. + /// The PrivateEndpointConnection to use. /// The cancellation token to use. /// , , , or is null. - public virtual PrivateEndpointConnectionsCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupName, string accountName, string privateEndpointConnectionName, PrivateEndpointConnectionAutoGenerated parameters, CancellationToken cancellationToken = default) + public virtual PrivateEndpointConnectionsCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupName, string accountName, string privateEndpointConnectionName, PrivateEndpointConnection parameters, CancellationToken cancellationToken = default) { if (resourceGroupName == null) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PrivateEndpointConnectionsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PrivateEndpointConnectionsRestOperations.cs index 605cbf0c82ef0..4017502229327 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PrivateEndpointConnectionsRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PrivateEndpointConnectionsRestOperations.cs @@ -20,6 +20,7 @@ internal partial class PrivateEndpointConnectionsRestOperations { private string subscriptionId; private Uri endpoint; + private string apiVersion; private ClientDiagnostics _clientDiagnostics; private HttpPipeline _pipeline; @@ -28,17 +29,23 @@ internal partial class PrivateEndpointConnectionsRestOperations /// The HTTP pipeline for sending and receiving REST requests and responses. /// The ID of the target subscription. /// server parameter. - /// is null. - public PrivateEndpointConnectionsRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null) + /// Api Version. + /// or is null. + public PrivateEndpointConnectionsRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") { if (subscriptionId == null) { throw new ArgumentNullException(nameof(subscriptionId)); } endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } this.subscriptionId = subscriptionId; this.endpoint = endpoint; + this.apiVersion = apiVersion; _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } @@ -57,7 +64,7 @@ internal HttpMessage CreateListByDatabaseAccountRequest(string resourceGroupName uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); uri.AppendPath(accountName, true); uri.AppendPath("/privateEndpointConnections", false); - uri.AppendQuery("api-version", "2019-08-01-preview", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -142,7 +149,7 @@ internal HttpMessage CreateGetRequest(string resourceGroupName, string accountNa uri.AppendPath(accountName, true); uri.AppendPath("/privateEndpointConnections/", false); uri.AppendPath(privateEndpointConnectionName, true); - uri.AppendQuery("api-version", "2019-08-01-preview", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -154,7 +161,7 @@ internal HttpMessage CreateGetRequest(string resourceGroupName, string accountNa /// The name of the private endpoint connection. /// The cancellation token to use. /// , , or is null. - public async Task> GetAsync(string resourceGroupName, string accountName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string resourceGroupName, string accountName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) { if (resourceGroupName == null) { @@ -175,9 +182,9 @@ public async Task> GetAsync(str { case 200: { - PrivateEndpointConnectionAutoGenerated value = default; + PrivateEndpointConnection value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PrivateEndpointConnectionAutoGenerated.DeserializePrivateEndpointConnectionAutoGenerated(document.RootElement); + value = PrivateEndpointConnection.DeserializePrivateEndpointConnection(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -191,7 +198,7 @@ public async Task> GetAsync(str /// The name of the private endpoint connection. /// The cancellation token to use. /// , , or is null. - public Response Get(string resourceGroupName, string accountName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + public Response Get(string resourceGroupName, string accountName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) { if (resourceGroupName == null) { @@ -212,9 +219,9 @@ public Response Get(string resourceGroup { case 200: { - PrivateEndpointConnectionAutoGenerated value = default; + PrivateEndpointConnection value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PrivateEndpointConnectionAutoGenerated.DeserializePrivateEndpointConnectionAutoGenerated(document.RootElement); + value = PrivateEndpointConnection.DeserializePrivateEndpointConnection(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -222,7 +229,7 @@ public Response Get(string resourceGroup } } - internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string accountName, string privateEndpointConnectionName, PrivateEndpointConnectionAutoGenerated parameters) + internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string accountName, string privateEndpointConnectionName, PrivateEndpointConnection parameters) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -237,7 +244,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, strin uri.AppendPath(accountName, true); uri.AppendPath("/privateEndpointConnections/", false); uri.AppendPath(privateEndpointConnectionName, true); - uri.AppendQuery("api-version", "2019-08-01-preview", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); @@ -251,10 +258,10 @@ internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, strin /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The name of the private endpoint connection. - /// The PrivateEndpointConnectionAutoGenerated to use. + /// The PrivateEndpointConnection to use. /// The cancellation token to use. /// , , , or is null. - public async Task CreateOrUpdateAsync(string resourceGroupName, string accountName, string privateEndpointConnectionName, PrivateEndpointConnectionAutoGenerated parameters, CancellationToken cancellationToken = default) + public async Task CreateOrUpdateAsync(string resourceGroupName, string accountName, string privateEndpointConnectionName, PrivateEndpointConnection parameters, CancellationToken cancellationToken = default) { if (resourceGroupName == null) { @@ -289,10 +296,10 @@ public async Task CreateOrUpdateAsync(string resourceGroupName, string /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The name of the private endpoint connection. - /// The PrivateEndpointConnectionAutoGenerated to use. + /// The PrivateEndpointConnection to use. /// The cancellation token to use. /// , , , or is null. - public Response CreateOrUpdate(string resourceGroupName, string accountName, string privateEndpointConnectionName, PrivateEndpointConnectionAutoGenerated parameters, CancellationToken cancellationToken = default) + public Response CreateOrUpdate(string resourceGroupName, string accountName, string privateEndpointConnectionName, PrivateEndpointConnection parameters, CancellationToken cancellationToken = default) { if (resourceGroupName == null) { @@ -338,7 +345,7 @@ internal HttpMessage CreateDeleteRequest(string resourceGroupName, string accoun uri.AppendPath(accountName, true); uri.AppendPath("/privateEndpointConnections/", false); uri.AppendPath(privateEndpointConnectionName, true); - uri.AppendQuery("api-version", "2019-08-01-preview", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PrivateLinkResourcesOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PrivateLinkResourcesOperations.cs index a78cd3a32876f..6f69dcc6037aa 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PrivateLinkResourcesOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PrivateLinkResourcesOperations.cs @@ -32,9 +32,10 @@ protected PrivateLinkResourcesOperations() /// The HTTP pipeline for sending and receiving REST requests and responses. /// The ID of the target subscription. /// server parameter. - internal PrivateLinkResourcesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null) + /// Api Version. + internal PrivateLinkResourcesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") { - RestClient = new PrivateLinkResourcesRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint); + RestClient = new PrivateLinkResourcesRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion); _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PrivateLinkResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PrivateLinkResourcesRestOperations.cs index dfb50b476877c..7d5c97abf7c25 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PrivateLinkResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/PrivateLinkResourcesRestOperations.cs @@ -20,6 +20,7 @@ internal partial class PrivateLinkResourcesRestOperations { private string subscriptionId; private Uri endpoint; + private string apiVersion; private ClientDiagnostics _clientDiagnostics; private HttpPipeline _pipeline; @@ -28,17 +29,23 @@ internal partial class PrivateLinkResourcesRestOperations /// The HTTP pipeline for sending and receiving REST requests and responses. /// The ID of the target subscription. /// server parameter. - /// is null. - public PrivateLinkResourcesRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null) + /// Api Version. + /// or is null. + public PrivateLinkResourcesRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") { if (subscriptionId == null) { throw new ArgumentNullException(nameof(subscriptionId)); } endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } this.subscriptionId = subscriptionId; this.endpoint = endpoint; + this.apiVersion = apiVersion; _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } @@ -57,7 +64,7 @@ internal HttpMessage CreateListByDatabaseAccountRequest(string resourceGroupName uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); uri.AppendPath(accountName, true); uri.AppendPath("/privateLinkResources", false); - uri.AppendQuery("api-version", "2019-08-01-preview", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -142,7 +149,7 @@ internal HttpMessage CreateGetRequest(string resourceGroupName, string accountNa uri.AppendPath(accountName, true); uri.AppendPath("/privateLinkResources/", false); uri.AppendPath(groupName, true); - uri.AppendQuery("api-version", "2019-08-01-preview", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations.cs index 7c76c3f0e1b63..c6c795afcc16d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations.cs @@ -19,6 +19,7 @@ namespace Azure.ResourceManager.CosmosDB internal partial class RestOperations { private Uri endpoint; + private string apiVersion; private ClientDiagnostics _clientDiagnostics; private HttpPipeline _pipeline; @@ -26,11 +27,18 @@ internal partial class RestOperations /// The handler for diagnostic messaging in the client. /// The HTTP pipeline for sending and receiving REST requests and responses. /// server parameter. - public RestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint = null) + /// Api Version. + /// is null. + public RestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint = null, string apiVersion = "2021-06-15") { endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } this.endpoint = endpoint; + this.apiVersion = apiVersion; _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } @@ -43,7 +51,7 @@ internal HttpMessage CreateListRequest() var uri = new RawRequestUriBuilder(); uri.Reset(endpoint); uri.AppendPath("/providers/Microsoft.DocumentDB/operations", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableDatabaseAccountsOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableDatabaseAccountsOperations.cs new file mode 100644 index 0000000000000..9a99d1c18f70f --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableDatabaseAccountsOperations.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.CosmosDB.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + /// The RestorableDatabaseAccounts service client. + public partial class RestorableDatabaseAccountsOperations + { + private readonly ClientDiagnostics _clientDiagnostics; + private readonly HttpPipeline _pipeline; + internal RestorableDatabaseAccountsRestOperations RestClient { get; } + + /// Initializes a new instance of RestorableDatabaseAccountsOperations for mocking. + protected RestorableDatabaseAccountsOperations() + { + } + + /// Initializes a new instance of RestorableDatabaseAccountsOperations. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The ID of the target subscription. + /// server parameter. + /// Api Version. + internal RestorableDatabaseAccountsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") + { + RestClient = new RestorableDatabaseAccountsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion); + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + /// Retrieves the properties of an existing Azure Cosmos DB restorable database account. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' permission. + /// Cosmos DB region, with spaces between words and each word capitalized. + /// The instanceId GUID of a restorable database account. + /// The cancellation token to use. + public virtual async Task> GetByLocationAsync(string location, string instanceId, CancellationToken cancellationToken = default) + { + using var scope = _clientDiagnostics.CreateScope("RestorableDatabaseAccountsOperations.GetByLocation"); + scope.Start(); + try + { + return await RestClient.GetByLocationAsync(location, instanceId, cancellationToken).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Retrieves the properties of an existing Azure Cosmos DB restorable database account. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' permission. + /// Cosmos DB region, with spaces between words and each word capitalized. + /// The instanceId GUID of a restorable database account. + /// The cancellation token to use. + public virtual Response GetByLocation(string location, string instanceId, CancellationToken cancellationToken = default) + { + using var scope = _clientDiagnostics.CreateScope("RestorableDatabaseAccountsOperations.GetByLocation"); + scope.Start(); + try + { + return RestClient.GetByLocation(location, instanceId, cancellationToken); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Lists all the restorable Azure Cosmos DB database accounts available under the subscription and in a region. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. + /// Cosmos DB region, with spaces between words and each word capitalized. + /// The cancellation token to use. + /// is null. + public virtual AsyncPageable ListByLocationAsync(string location, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("RestorableDatabaseAccountsOperations.ListByLocation"); + scope.Start(); + try + { + var response = await RestClient.ListByLocationAsync(location, cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null); + } + + /// Lists all the restorable Azure Cosmos DB database accounts available under the subscription and in a region. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. + /// Cosmos DB region, with spaces between words and each word capitalized. + /// The cancellation token to use. + /// is null. + public virtual Pageable ListByLocation(string location, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("RestorableDatabaseAccountsOperations.ListByLocation"); + scope.Start(); + try + { + var response = RestClient.ListByLocation(location, cancellationToken); + return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, null); + } + + /// Lists all the restorable Azure Cosmos DB database accounts available under the subscription. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. + /// The cancellation token to use. + public virtual AsyncPageable ListAsync(CancellationToken cancellationToken = default) + { + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("RestorableDatabaseAccountsOperations.List"); + scope.Start(); + try + { + var response = await RestClient.ListAsync(cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null); + } + + /// Lists all the restorable Azure Cosmos DB database accounts available under the subscription. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. + /// The cancellation token to use. + public virtual Pageable List(CancellationToken cancellationToken = default) + { + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("RestorableDatabaseAccountsOperations.List"); + scope.Start(); + try + { + var response = RestClient.List(cancellationToken); + return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, null); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableDatabaseAccountsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableDatabaseAccountsRestOperations.cs new file mode 100644 index 0000000000000..e8bfeabe84642 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableDatabaseAccountsRestOperations.cs @@ -0,0 +1,264 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.CosmosDB.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + internal partial class RestorableDatabaseAccountsRestOperations + { + private string subscriptionId; + private Uri endpoint; + private string apiVersion; + private ClientDiagnostics _clientDiagnostics; + private HttpPipeline _pipeline; + + /// Initializes a new instance of RestorableDatabaseAccountsRestOperations. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The ID of the target subscription. + /// server parameter. + /// Api Version. + /// or is null. + public RestorableDatabaseAccountsRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } + + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = apiVersion; + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + internal HttpMessage CreateListByLocationRequest(string location) + { + 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/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/restorableDatabaseAccounts", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Lists all the restorable Azure Cosmos DB database accounts available under the subscription and in a region. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. + /// Cosmos DB region, with spaces between words and each word capitalized. + /// The cancellation token to use. + /// is null. + public async Task> ListByLocationAsync(string location, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + + using var message = CreateListByLocationRequest(location); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RestorableDatabaseAccountsListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RestorableDatabaseAccountsListResult.DeserializeRestorableDatabaseAccountsListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Lists all the restorable Azure Cosmos DB database accounts available under the subscription and in a region. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. + /// Cosmos DB region, with spaces between words and each word capitalized. + /// The cancellation token to use. + /// is null. + public Response ListByLocation(string location, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + + using var message = CreateListByLocationRequest(location); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RestorableDatabaseAccountsListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RestorableDatabaseAccountsListResult.DeserializeRestorableDatabaseAccountsListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListRequest() + { + 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/restorableDatabaseAccounts", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Lists all the restorable Azure Cosmos DB database accounts available under the subscription. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. + /// The cancellation token to use. + public async Task> ListAsync(CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RestorableDatabaseAccountsListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RestorableDatabaseAccountsListResult.DeserializeRestorableDatabaseAccountsListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Lists all the restorable Azure Cosmos DB database accounts available under the subscription. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. + /// The cancellation token to use. + public Response List(CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RestorableDatabaseAccountsListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RestorableDatabaseAccountsListResult.DeserializeRestorableDatabaseAccountsListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetByLocationRequest(string location, string instanceId) + { + 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/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/restorableDatabaseAccounts/", false); + uri.AppendPath(instanceId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Retrieves the properties of an existing Azure Cosmos DB restorable database account. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' permission. + /// Cosmos DB region, with spaces between words and each word capitalized. + /// The instanceId GUID of a restorable database account. + /// The cancellation token to use. + /// or is null. + public async Task> GetByLocationAsync(string location, string instanceId, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateGetByLocationRequest(location, instanceId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RestorableDatabaseAccountGetResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RestorableDatabaseAccountGetResult.DeserializeRestorableDatabaseAccountGetResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Retrieves the properties of an existing Azure Cosmos DB restorable database account. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' permission. + /// Cosmos DB region, with spaces between words and each word capitalized. + /// The instanceId GUID of a restorable database account. + /// The cancellation token to use. + /// or is null. + public Response GetByLocation(string location, string instanceId, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateGetByLocationRequest(location, instanceId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RestorableDatabaseAccountGetResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RestorableDatabaseAccountGetResult.DeserializeRestorableDatabaseAccountGetResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableMongodbCollectionsOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableMongodbCollectionsOperations.cs new file mode 100644 index 0000000000000..c610f475e4344 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableMongodbCollectionsOperations.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.CosmosDB.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + /// The RestorableMongodbCollections service client. + public partial class RestorableMongodbCollectionsOperations + { + private readonly ClientDiagnostics _clientDiagnostics; + private readonly HttpPipeline _pipeline; + internal RestorableMongodbCollectionsRestOperations RestClient { get; } + + /// Initializes a new instance of RestorableMongodbCollectionsOperations for mocking. + protected RestorableMongodbCollectionsOperations() + { + } + + /// Initializes a new instance of RestorableMongodbCollectionsOperations. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The ID of the target subscription. + /// server parameter. + /// Api Version. + internal RestorableMongodbCollectionsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") + { + RestClient = new RestorableMongodbCollectionsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion); + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + /// Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB collections under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. + /// Cosmos DB region, with spaces between words and each word capitalized. + /// The instanceId GUID of a restorable database account. + /// The resource ID of the MongoDB database. + /// The cancellation token to use. + /// or is null. + public virtual AsyncPageable ListAsync(string location, string instanceId, string restorableMongodbDatabaseRid = null, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("RestorableMongodbCollectionsOperations.List"); + scope.Start(); + try + { + var response = await RestClient.ListAsync(location, instanceId, restorableMongodbDatabaseRid, cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null); + } + + /// Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB collections under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. + /// Cosmos DB region, with spaces between words and each word capitalized. + /// The instanceId GUID of a restorable database account. + /// The resource ID of the MongoDB database. + /// The cancellation token to use. + /// or is null. + public virtual Pageable List(string location, string instanceId, string restorableMongodbDatabaseRid = null, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("RestorableMongodbCollectionsOperations.List"); + scope.Start(); + try + { + var response = RestClient.List(location, instanceId, restorableMongodbDatabaseRid, cancellationToken); + return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, null); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableMongodbCollectionsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableMongodbCollectionsRestOperations.cs new file mode 100644 index 0000000000000..50f62bbbafdc4 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableMongodbCollectionsRestOperations.cs @@ -0,0 +1,143 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.CosmosDB.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + internal partial class RestorableMongodbCollectionsRestOperations + { + private string subscriptionId; + private Uri endpoint; + private string apiVersion; + private ClientDiagnostics _clientDiagnostics; + private HttpPipeline _pipeline; + + /// Initializes a new instance of RestorableMongodbCollectionsRestOperations. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The ID of the target subscription. + /// server parameter. + /// Api Version. + /// or is null. + public RestorableMongodbCollectionsRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } + + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = apiVersion; + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + internal HttpMessage CreateListRequest(string location, string instanceId, string restorableMongodbDatabaseRid) + { + 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/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/restorableDatabaseAccounts/", false); + uri.AppendPath(instanceId, true); + uri.AppendPath("/restorableMongodbCollections", false); + uri.AppendQuery("api-version", apiVersion, true); + if (restorableMongodbDatabaseRid != null) + { + uri.AppendQuery("restorableMongodbDatabaseRid", restorableMongodbDatabaseRid, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB collections under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. + /// Cosmos DB region, with spaces between words and each word capitalized. + /// The instanceId GUID of a restorable database account. + /// The resource ID of the MongoDB database. + /// The cancellation token to use. + /// or is null. + public async Task> ListAsync(string location, string instanceId, string restorableMongodbDatabaseRid = null, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateListRequest(location, instanceId, restorableMongodbDatabaseRid); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RestorableMongodbCollectionsListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RestorableMongodbCollectionsListResult.DeserializeRestorableMongodbCollectionsListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB collections under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. + /// Cosmos DB region, with spaces between words and each word capitalized. + /// The instanceId GUID of a restorable database account. + /// The resource ID of the MongoDB database. + /// The cancellation token to use. + /// or is null. + public Response List(string location, string instanceId, string restorableMongodbDatabaseRid = null, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateListRequest(location, instanceId, restorableMongodbDatabaseRid); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RestorableMongodbCollectionsListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RestorableMongodbCollectionsListResult.DeserializeRestorableMongodbCollectionsListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableMongodbDatabasesOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableMongodbDatabasesOperations.cs new file mode 100644 index 0000000000000..4c014820fa77a --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableMongodbDatabasesOperations.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.CosmosDB.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + /// The RestorableMongodbDatabases service client. + public partial class RestorableMongodbDatabasesOperations + { + private readonly ClientDiagnostics _clientDiagnostics; + private readonly HttpPipeline _pipeline; + internal RestorableMongodbDatabasesRestOperations RestClient { get; } + + /// Initializes a new instance of RestorableMongodbDatabasesOperations for mocking. + protected RestorableMongodbDatabasesOperations() + { + } + + /// Initializes a new instance of RestorableMongodbDatabasesOperations. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The ID of the target subscription. + /// server parameter. + /// Api Version. + internal RestorableMongodbDatabasesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") + { + RestClient = new RestorableMongodbDatabasesRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion); + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + /// Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. + /// Cosmos DB region, with spaces between words and each word capitalized. + /// The instanceId GUID of a restorable database account. + /// The cancellation token to use. + /// or is null. + public virtual AsyncPageable ListAsync(string location, string instanceId, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("RestorableMongodbDatabasesOperations.List"); + scope.Start(); + try + { + var response = await RestClient.ListAsync(location, instanceId, cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null); + } + + /// Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. + /// Cosmos DB region, with spaces between words and each word capitalized. + /// The instanceId GUID of a restorable database account. + /// The cancellation token to use. + /// or is null. + public virtual Pageable List(string location, string instanceId, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("RestorableMongodbDatabasesOperations.List"); + scope.Start(); + try + { + var response = RestClient.List(location, instanceId, cancellationToken); + return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, null); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableMongodbDatabasesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableMongodbDatabasesRestOperations.cs new file mode 100644 index 0000000000000..406f6a42b9a42 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableMongodbDatabasesRestOperations.cs @@ -0,0 +1,137 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.CosmosDB.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + internal partial class RestorableMongodbDatabasesRestOperations + { + private string subscriptionId; + private Uri endpoint; + private string apiVersion; + private ClientDiagnostics _clientDiagnostics; + private HttpPipeline _pipeline; + + /// Initializes a new instance of RestorableMongodbDatabasesRestOperations. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The ID of the target subscription. + /// server parameter. + /// Api Version. + /// or is null. + public RestorableMongodbDatabasesRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } + + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = apiVersion; + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + internal HttpMessage CreateListRequest(string location, string instanceId) + { + 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/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/restorableDatabaseAccounts/", false); + uri.AppendPath(instanceId, true); + uri.AppendPath("/restorableMongodbDatabases", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. + /// Cosmos DB region, with spaces between words and each word capitalized. + /// The instanceId GUID of a restorable database account. + /// The cancellation token to use. + /// or is null. + public async Task> ListAsync(string location, string instanceId, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateListRequest(location, instanceId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RestorableMongodbDatabasesListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RestorableMongodbDatabasesListResult.DeserializeRestorableMongodbDatabasesListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. + /// Cosmos DB region, with spaces between words and each word capitalized. + /// The instanceId GUID of a restorable database account. + /// The cancellation token to use. + /// or is null. + public Response List(string location, string instanceId, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateListRequest(location, instanceId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RestorableMongodbDatabasesListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RestorableMongodbDatabasesListResult.DeserializeRestorableMongodbDatabasesListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableMongodbResourcesOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableMongodbResourcesOperations.cs new file mode 100644 index 0000000000000..79f835870afdd --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableMongodbResourcesOperations.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.CosmosDB.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + /// The RestorableMongodbResources service client. + public partial class RestorableMongodbResourcesOperations + { + private readonly ClientDiagnostics _clientDiagnostics; + private readonly HttpPipeline _pipeline; + internal RestorableMongodbResourcesRestOperations RestClient { get; } + + /// Initializes a new instance of RestorableMongodbResourcesOperations for mocking. + protected RestorableMongodbResourcesOperations() + { + } + + /// Initializes a new instance of RestorableMongodbResourcesOperations. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The ID of the target subscription. + /// server parameter. + /// Api Version. + internal RestorableMongodbResourcesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") + { + RestClient = new RestorableMongodbResourcesRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion); + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + /// Return a list of database and collection combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. + /// Cosmos DB region, with spaces between words and each word capitalized. + /// The instanceId GUID of a restorable database account. + /// The location where the restorable resources are located. + /// The timestamp when the restorable resources existed. + /// The cancellation token to use. + /// or is null. + public virtual AsyncPageable ListAsync(string location, string instanceId, string restoreLocation = null, string restoreTimestampInUtc = null, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("RestorableMongodbResourcesOperations.List"); + scope.Start(); + try + { + var response = await RestClient.ListAsync(location, instanceId, restoreLocation, restoreTimestampInUtc, cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null); + } + + /// Return a list of database and collection combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. + /// Cosmos DB region, with spaces between words and each word capitalized. + /// The instanceId GUID of a restorable database account. + /// The location where the restorable resources are located. + /// The timestamp when the restorable resources existed. + /// The cancellation token to use. + /// or is null. + public virtual Pageable List(string location, string instanceId, string restoreLocation = null, string restoreTimestampInUtc = null, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("RestorableMongodbResourcesOperations.List"); + scope.Start(); + try + { + var response = RestClient.List(location, instanceId, restoreLocation, restoreTimestampInUtc, cancellationToken); + return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, null); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableMongodbResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableMongodbResourcesRestOperations.cs new file mode 100644 index 0000000000000..a4b0730275c3d --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableMongodbResourcesRestOperations.cs @@ -0,0 +1,149 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.CosmosDB.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + internal partial class RestorableMongodbResourcesRestOperations + { + private string subscriptionId; + private Uri endpoint; + private string apiVersion; + private ClientDiagnostics _clientDiagnostics; + private HttpPipeline _pipeline; + + /// Initializes a new instance of RestorableMongodbResourcesRestOperations. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The ID of the target subscription. + /// server parameter. + /// Api Version. + /// or is null. + public RestorableMongodbResourcesRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } + + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = apiVersion; + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + internal HttpMessage CreateListRequest(string location, string instanceId, string restoreLocation, string restoreTimestampInUtc) + { + 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/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/restorableDatabaseAccounts/", false); + uri.AppendPath(instanceId, true); + uri.AppendPath("/restorableMongodbResources", false); + uri.AppendQuery("api-version", apiVersion, true); + if (restoreLocation != null) + { + uri.AppendQuery("restoreLocation", restoreLocation, true); + } + if (restoreTimestampInUtc != null) + { + uri.AppendQuery("restoreTimestampInUtc", restoreTimestampInUtc, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Return a list of database and collection combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. + /// Cosmos DB region, with spaces between words and each word capitalized. + /// The instanceId GUID of a restorable database account. + /// The location where the restorable resources are located. + /// The timestamp when the restorable resources existed. + /// The cancellation token to use. + /// or is null. + public async Task> ListAsync(string location, string instanceId, string restoreLocation = null, string restoreTimestampInUtc = null, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateListRequest(location, instanceId, restoreLocation, restoreTimestampInUtc); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RestorableMongodbResourcesListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RestorableMongodbResourcesListResult.DeserializeRestorableMongodbResourcesListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Return a list of database and collection combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. + /// Cosmos DB region, with spaces between words and each word capitalized. + /// The instanceId GUID of a restorable database account. + /// The location where the restorable resources are located. + /// The timestamp when the restorable resources existed. + /// The cancellation token to use. + /// or is null. + public Response List(string location, string instanceId, string restoreLocation = null, string restoreTimestampInUtc = null, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateListRequest(location, instanceId, restoreLocation, restoreTimestampInUtc); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RestorableMongodbResourcesListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RestorableMongodbResourcesListResult.DeserializeRestorableMongodbResourcesListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableSqlContainersOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableSqlContainersOperations.cs new file mode 100644 index 0000000000000..dcc9a947c08b7 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableSqlContainersOperations.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.CosmosDB.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + /// The RestorableSqlContainers service client. + public partial class RestorableSqlContainersOperations + { + private readonly ClientDiagnostics _clientDiagnostics; + private readonly HttpPipeline _pipeline; + internal RestorableSqlContainersRestOperations RestClient { get; } + + /// Initializes a new instance of RestorableSqlContainersOperations for mocking. + protected RestorableSqlContainersOperations() + { + } + + /// Initializes a new instance of RestorableSqlContainersOperations. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The ID of the target subscription. + /// server parameter. + /// Api Version. + internal RestorableSqlContainersOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") + { + RestClient = new RestorableSqlContainersRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion); + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + /// Show the event feed of all mutations done on all the Azure Cosmos DB SQL containers under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. + /// Cosmos DB region, with spaces between words and each word capitalized. + /// The instanceId GUID of a restorable database account. + /// The resource ID of the SQL database. + /// The snapshot create timestamp after which snapshots need to be listed. + /// The snapshot create timestamp before which snapshots need to be listed. + /// The cancellation token to use. + /// or is null. + public virtual AsyncPageable ListAsync(string location, string instanceId, string restorableSqlDatabaseRid = null, string startTime = null, string endTime = null, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("RestorableSqlContainersOperations.List"); + scope.Start(); + try + { + var response = await RestClient.ListAsync(location, instanceId, restorableSqlDatabaseRid, startTime, endTime, cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null); + } + + /// Show the event feed of all mutations done on all the Azure Cosmos DB SQL containers under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. + /// Cosmos DB region, with spaces between words and each word capitalized. + /// The instanceId GUID of a restorable database account. + /// The resource ID of the SQL database. + /// The snapshot create timestamp after which snapshots need to be listed. + /// The snapshot create timestamp before which snapshots need to be listed. + /// The cancellation token to use. + /// or is null. + public virtual Pageable List(string location, string instanceId, string restorableSqlDatabaseRid = null, string startTime = null, string endTime = null, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("RestorableSqlContainersOperations.List"); + scope.Start(); + try + { + var response = RestClient.List(location, instanceId, restorableSqlDatabaseRid, startTime, endTime, cancellationToken); + return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, null); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableSqlContainersRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableSqlContainersRestOperations.cs new file mode 100644 index 0000000000000..040c0ce1d9fbe --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableSqlContainersRestOperations.cs @@ -0,0 +1,155 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.CosmosDB.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + internal partial class RestorableSqlContainersRestOperations + { + private string subscriptionId; + private Uri endpoint; + private string apiVersion; + private ClientDiagnostics _clientDiagnostics; + private HttpPipeline _pipeline; + + /// Initializes a new instance of RestorableSqlContainersRestOperations. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The ID of the target subscription. + /// server parameter. + /// Api Version. + /// or is null. + public RestorableSqlContainersRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } + + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = apiVersion; + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + internal HttpMessage CreateListRequest(string location, string instanceId, string restorableSqlDatabaseRid, string startTime, string endTime) + { + 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/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/restorableDatabaseAccounts/", false); + uri.AppendPath(instanceId, true); + uri.AppendPath("/restorableSqlContainers", false); + uri.AppendQuery("api-version", apiVersion, true); + if (restorableSqlDatabaseRid != null) + { + uri.AppendQuery("restorableSqlDatabaseRid", restorableSqlDatabaseRid, true); + } + if (startTime != null) + { + uri.AppendQuery("startTime", startTime, true); + } + if (endTime != null) + { + uri.AppendQuery("endTime", endTime, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Show the event feed of all mutations done on all the Azure Cosmos DB SQL containers under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. + /// Cosmos DB region, with spaces between words and each word capitalized. + /// The instanceId GUID of a restorable database account. + /// The resource ID of the SQL database. + /// The snapshot create timestamp after which snapshots need to be listed. + /// The snapshot create timestamp before which snapshots need to be listed. + /// The cancellation token to use. + /// or is null. + public async Task> ListAsync(string location, string instanceId, string restorableSqlDatabaseRid = null, string startTime = null, string endTime = null, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateListRequest(location, instanceId, restorableSqlDatabaseRid, startTime, endTime); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RestorableSqlContainersListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RestorableSqlContainersListResult.DeserializeRestorableSqlContainersListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Show the event feed of all mutations done on all the Azure Cosmos DB SQL containers under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. + /// Cosmos DB region, with spaces between words and each word capitalized. + /// The instanceId GUID of a restorable database account. + /// The resource ID of the SQL database. + /// The snapshot create timestamp after which snapshots need to be listed. + /// The snapshot create timestamp before which snapshots need to be listed. + /// The cancellation token to use. + /// or is null. + public Response List(string location, string instanceId, string restorableSqlDatabaseRid = null, string startTime = null, string endTime = null, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateListRequest(location, instanceId, restorableSqlDatabaseRid, startTime, endTime); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RestorableSqlContainersListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RestorableSqlContainersListResult.DeserializeRestorableSqlContainersListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableSqlDatabasesOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableSqlDatabasesOperations.cs new file mode 100644 index 0000000000000..5ff32a9c7e987 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableSqlDatabasesOperations.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.CosmosDB.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + /// The RestorableSqlDatabases service client. + public partial class RestorableSqlDatabasesOperations + { + private readonly ClientDiagnostics _clientDiagnostics; + private readonly HttpPipeline _pipeline; + internal RestorableSqlDatabasesRestOperations RestClient { get; } + + /// Initializes a new instance of RestorableSqlDatabasesOperations for mocking. + protected RestorableSqlDatabasesOperations() + { + } + + /// Initializes a new instance of RestorableSqlDatabasesOperations. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The ID of the target subscription. + /// server parameter. + /// Api Version. + internal RestorableSqlDatabasesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") + { + RestClient = new RestorableSqlDatabasesRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion); + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + /// Show the event feed of all mutations done on all the Azure Cosmos DB SQL databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. + /// Cosmos DB region, with spaces between words and each word capitalized. + /// The instanceId GUID of a restorable database account. + /// The cancellation token to use. + /// or is null. + public virtual AsyncPageable ListAsync(string location, string instanceId, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("RestorableSqlDatabasesOperations.List"); + scope.Start(); + try + { + var response = await RestClient.ListAsync(location, instanceId, cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null); + } + + /// Show the event feed of all mutations done on all the Azure Cosmos DB SQL databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. + /// Cosmos DB region, with spaces between words and each word capitalized. + /// The instanceId GUID of a restorable database account. + /// The cancellation token to use. + /// or is null. + public virtual Pageable List(string location, string instanceId, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("RestorableSqlDatabasesOperations.List"); + scope.Start(); + try + { + var response = RestClient.List(location, instanceId, cancellationToken); + return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, null); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableSqlDatabasesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableSqlDatabasesRestOperations.cs new file mode 100644 index 0000000000000..895a2e85036ba --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableSqlDatabasesRestOperations.cs @@ -0,0 +1,137 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.CosmosDB.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + internal partial class RestorableSqlDatabasesRestOperations + { + private string subscriptionId; + private Uri endpoint; + private string apiVersion; + private ClientDiagnostics _clientDiagnostics; + private HttpPipeline _pipeline; + + /// Initializes a new instance of RestorableSqlDatabasesRestOperations. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The ID of the target subscription. + /// server parameter. + /// Api Version. + /// or is null. + public RestorableSqlDatabasesRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } + + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = apiVersion; + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + internal HttpMessage CreateListRequest(string location, string instanceId) + { + 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/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/restorableDatabaseAccounts/", false); + uri.AppendPath(instanceId, true); + uri.AppendPath("/restorableSqlDatabases", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Show the event feed of all mutations done on all the Azure Cosmos DB SQL databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. + /// Cosmos DB region, with spaces between words and each word capitalized. + /// The instanceId GUID of a restorable database account. + /// The cancellation token to use. + /// or is null. + public async Task> ListAsync(string location, string instanceId, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateListRequest(location, instanceId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RestorableSqlDatabasesListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RestorableSqlDatabasesListResult.DeserializeRestorableSqlDatabasesListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Show the event feed of all mutations done on all the Azure Cosmos DB SQL databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. + /// Cosmos DB region, with spaces between words and each word capitalized. + /// The instanceId GUID of a restorable database account. + /// The cancellation token to use. + /// or is null. + public Response List(string location, string instanceId, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateListRequest(location, instanceId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RestorableSqlDatabasesListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RestorableSqlDatabasesListResult.DeserializeRestorableSqlDatabasesListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableSqlResourcesOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableSqlResourcesOperations.cs new file mode 100644 index 0000000000000..98aad719a8c24 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableSqlResourcesOperations.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.CosmosDB.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + /// The RestorableSqlResources service client. + public partial class RestorableSqlResourcesOperations + { + private readonly ClientDiagnostics _clientDiagnostics; + private readonly HttpPipeline _pipeline; + internal RestorableSqlResourcesRestOperations RestClient { get; } + + /// Initializes a new instance of RestorableSqlResourcesOperations for mocking. + protected RestorableSqlResourcesOperations() + { + } + + /// Initializes a new instance of RestorableSqlResourcesOperations. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The ID of the target subscription. + /// server parameter. + /// Api Version. + internal RestorableSqlResourcesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") + { + RestClient = new RestorableSqlResourcesRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion); + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + /// Return a list of database and container combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. + /// Cosmos DB region, with spaces between words and each word capitalized. + /// The instanceId GUID of a restorable database account. + /// The location where the restorable resources are located. + /// The timestamp when the restorable resources existed. + /// The cancellation token to use. + /// or is null. + public virtual AsyncPageable ListAsync(string location, string instanceId, string restoreLocation = null, string restoreTimestampInUtc = null, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("RestorableSqlResourcesOperations.List"); + scope.Start(); + try + { + var response = await RestClient.ListAsync(location, instanceId, restoreLocation, restoreTimestampInUtc, cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null); + } + + /// Return a list of database and container combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. + /// Cosmos DB region, with spaces between words and each word capitalized. + /// The instanceId GUID of a restorable database account. + /// The location where the restorable resources are located. + /// The timestamp when the restorable resources existed. + /// The cancellation token to use. + /// or is null. + public virtual Pageable List(string location, string instanceId, string restoreLocation = null, string restoreTimestampInUtc = null, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("RestorableSqlResourcesOperations.List"); + scope.Start(); + try + { + var response = RestClient.List(location, instanceId, restoreLocation, restoreTimestampInUtc, cancellationToken); + return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, null); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableSqlResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableSqlResourcesRestOperations.cs new file mode 100644 index 0000000000000..222ef5fed621e --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableSqlResourcesRestOperations.cs @@ -0,0 +1,149 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.CosmosDB.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + internal partial class RestorableSqlResourcesRestOperations + { + private string subscriptionId; + private Uri endpoint; + private string apiVersion; + private ClientDiagnostics _clientDiagnostics; + private HttpPipeline _pipeline; + + /// Initializes a new instance of RestorableSqlResourcesRestOperations. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The ID of the target subscription. + /// server parameter. + /// Api Version. + /// or is null. + public RestorableSqlResourcesRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } + + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = apiVersion; + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + internal HttpMessage CreateListRequest(string location, string instanceId, string restoreLocation, string restoreTimestampInUtc) + { + 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/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/restorableDatabaseAccounts/", false); + uri.AppendPath(instanceId, true); + uri.AppendPath("/restorableSqlResources", false); + uri.AppendQuery("api-version", apiVersion, true); + if (restoreLocation != null) + { + uri.AppendQuery("restoreLocation", restoreLocation, true); + } + if (restoreTimestampInUtc != null) + { + uri.AppendQuery("restoreTimestampInUtc", restoreTimestampInUtc, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Return a list of database and container combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. + /// Cosmos DB region, with spaces between words and each word capitalized. + /// The instanceId GUID of a restorable database account. + /// The location where the restorable resources are located. + /// The timestamp when the restorable resources existed. + /// The cancellation token to use. + /// or is null. + public async Task> ListAsync(string location, string instanceId, string restoreLocation = null, string restoreTimestampInUtc = null, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateListRequest(location, instanceId, restoreLocation, restoreTimestampInUtc); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RestorableSqlResourcesListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RestorableSqlResourcesListResult.DeserializeRestorableSqlResourcesListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Return a list of database and container combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. + /// Cosmos DB region, with spaces between words and each word capitalized. + /// The instanceId GUID of a restorable database account. + /// The location where the restorable resources are located. + /// The timestamp when the restorable resources existed. + /// The cancellation token to use. + /// or is null. + public Response List(string location, string instanceId, string restoreLocation = null, string restoreTimestampInUtc = null, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateListRequest(location, instanceId, restoreLocation, restoreTimestampInUtc); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RestorableSqlResourcesListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RestorableSqlResourcesListResult.DeserializeRestorableSqlResourcesListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/SqlResourcesCreateUpdateSqlRoleAssignmentOperation.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/SqlResourcesCreateUpdateSqlRoleAssignmentOperation.cs new file mode 100644 index 0000000000000..c6db9cb80c43d --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/SqlResourcesCreateUpdateSqlRoleAssignmentOperation.cs @@ -0,0 +1,72 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.CosmosDB.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + /// Creates or updates an Azure Cosmos DB SQL Role Assignment. + public partial class SqlResourcesCreateUpdateSqlRoleAssignmentOperation : Operation, IOperationSource + { + private readonly ArmOperationHelpers _operation; + + /// Initializes a new instance of SqlResourcesCreateUpdateSqlRoleAssignmentOperation for mocking. + protected SqlResourcesCreateUpdateSqlRoleAssignmentOperation() + { + } + + internal SqlResourcesCreateUpdateSqlRoleAssignmentOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response) + { + _operation = new ArmOperationHelpers(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "SqlResourcesCreateUpdateSqlRoleAssignmentOperation"); + } + /// + public override string Id => _operation.Id; + + /// + public override SqlRoleAssignmentGetResults Value => _operation.Value; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override bool HasValue => _operation.HasValue; + + /// + public override Response GetRawResponse() => _operation.GetRawResponse(); + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); + + SqlRoleAssignmentGetResults IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + return SqlRoleAssignmentGetResults.DeserializeSqlRoleAssignmentGetResults(document.RootElement); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + return SqlRoleAssignmentGetResults.DeserializeSqlRoleAssignmentGetResults(document.RootElement); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/SqlResourcesCreateUpdateSqlRoleDefinitionOperation.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/SqlResourcesCreateUpdateSqlRoleDefinitionOperation.cs new file mode 100644 index 0000000000000..2542a36bd90ce --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/SqlResourcesCreateUpdateSqlRoleDefinitionOperation.cs @@ -0,0 +1,72 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.CosmosDB.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + /// Creates or updates an Azure Cosmos DB SQL Role Definition. + public partial class SqlResourcesCreateUpdateSqlRoleDefinitionOperation : Operation, IOperationSource + { + private readonly ArmOperationHelpers _operation; + + /// Initializes a new instance of SqlResourcesCreateUpdateSqlRoleDefinitionOperation for mocking. + protected SqlResourcesCreateUpdateSqlRoleDefinitionOperation() + { + } + + internal SqlResourcesCreateUpdateSqlRoleDefinitionOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response) + { + _operation = new ArmOperationHelpers(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "SqlResourcesCreateUpdateSqlRoleDefinitionOperation"); + } + /// + public override string Id => _operation.Id; + + /// + public override SqlRoleDefinitionGetResults Value => _operation.Value; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override bool HasValue => _operation.HasValue; + + /// + public override Response GetRawResponse() => _operation.GetRawResponse(); + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); + + SqlRoleDefinitionGetResults IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + return SqlRoleDefinitionGetResults.DeserializeSqlRoleDefinitionGetResults(document.RootElement); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + return SqlRoleDefinitionGetResults.DeserializeSqlRoleDefinitionGetResults(document.RootElement); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/SqlResourcesDeleteSqlRoleAssignmentOperation.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/SqlResourcesDeleteSqlRoleAssignmentOperation.cs new file mode 100644 index 0000000000000..09ca5f6d76926 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/SqlResourcesDeleteSqlRoleAssignmentOperation.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.CosmosDB +{ + /// Deletes an existing Azure Cosmos DB SQL Role Assignment. + public partial class SqlResourcesDeleteSqlRoleAssignmentOperation : Operation, IOperationSource + { + private readonly ArmOperationHelpers _operation; + + /// Initializes a new instance of SqlResourcesDeleteSqlRoleAssignmentOperation for mocking. + protected SqlResourcesDeleteSqlRoleAssignmentOperation() + { + } + + internal SqlResourcesDeleteSqlRoleAssignmentOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response) + { + _operation = new ArmOperationHelpers(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "SqlResourcesDeleteSqlRoleAssignmentOperation"); + } + /// + public override string Id => _operation.Id; + + /// + public override Response Value => _operation.Value; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override bool HasValue => _operation.HasValue; + + /// + public override Response GetRawResponse() => _operation.GetRawResponse(); + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); + + Response IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + return response; + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + return await new ValueTask(response).ConfigureAwait(false); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/SqlResourcesDeleteSqlRoleDefinitionOperation.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/SqlResourcesDeleteSqlRoleDefinitionOperation.cs new file mode 100644 index 0000000000000..3cac3ace07f9c --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/SqlResourcesDeleteSqlRoleDefinitionOperation.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.CosmosDB +{ + /// Deletes an existing Azure Cosmos DB SQL Role Definition. + public partial class SqlResourcesDeleteSqlRoleDefinitionOperation : Operation, IOperationSource + { + private readonly ArmOperationHelpers _operation; + + /// Initializes a new instance of SqlResourcesDeleteSqlRoleDefinitionOperation for mocking. + protected SqlResourcesDeleteSqlRoleDefinitionOperation() + { + } + + internal SqlResourcesDeleteSqlRoleDefinitionOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response) + { + _operation = new ArmOperationHelpers(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "SqlResourcesDeleteSqlRoleDefinitionOperation"); + } + /// + public override string Id => _operation.Id; + + /// + public override Response Value => _operation.Value; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override bool HasValue => _operation.HasValue; + + /// + public override Response GetRawResponse() => _operation.GetRawResponse(); + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); + + Response IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + return response; + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + return await new ValueTask(response).ConfigureAwait(false); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/SqlResourcesOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/SqlResourcesOperations.cs index 74e128761bb17..483e727eb8655 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/SqlResourcesOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/SqlResourcesOperations.cs @@ -32,9 +32,10 @@ protected SqlResourcesOperations() /// The HTTP pipeline for sending and receiving REST requests and responses. /// The ID of the target subscription. /// server parameter. - internal SqlResourcesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null) + /// Api Version. + internal SqlResourcesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") { - RestClient = new SqlResourcesRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint); + RestClient = new SqlResourcesRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion); _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } @@ -335,6 +336,86 @@ public virtual Response GetSqlTrigger(string resourceGroup } } + /// Retrieves the properties of an existing Azure Cosmos DB SQL Role Definition with the given Id. + /// The GUID for the Role Definition. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The cancellation token to use. + public virtual async Task> GetSqlRoleDefinitionAsync(string roleDefinitionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + using var scope = _clientDiagnostics.CreateScope("SqlResourcesOperations.GetSqlRoleDefinition"); + scope.Start(); + try + { + return await RestClient.GetSqlRoleDefinitionAsync(roleDefinitionId, resourceGroupName, accountName, cancellationToken).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Retrieves the properties of an existing Azure Cosmos DB SQL Role Definition with the given Id. + /// The GUID for the Role Definition. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The cancellation token to use. + public virtual Response GetSqlRoleDefinition(string roleDefinitionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + using var scope = _clientDiagnostics.CreateScope("SqlResourcesOperations.GetSqlRoleDefinition"); + scope.Start(); + try + { + return RestClient.GetSqlRoleDefinition(roleDefinitionId, resourceGroupName, accountName, cancellationToken); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Retrieves the properties of an existing Azure Cosmos DB SQL Role Assignment with the given Id. + /// The GUID for the Role Assignment. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The cancellation token to use. + public virtual async Task> GetSqlRoleAssignmentAsync(string roleAssignmentId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + using var scope = _clientDiagnostics.CreateScope("SqlResourcesOperations.GetSqlRoleAssignment"); + scope.Start(); + try + { + return await RestClient.GetSqlRoleAssignmentAsync(roleAssignmentId, resourceGroupName, accountName, cancellationToken).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Retrieves the properties of an existing Azure Cosmos DB SQL Role Assignment with the given Id. + /// The GUID for the Role Assignment. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The cancellation token to use. + public virtual Response GetSqlRoleAssignment(string roleAssignmentId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + using var scope = _clientDiagnostics.CreateScope("SqlResourcesOperations.GetSqlRoleAssignment"); + scope.Start(); + try + { + return RestClient.GetSqlRoleAssignment(roleAssignmentId, resourceGroupName, accountName, cancellationToken); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// Lists the SQL databases under an existing Azure Cosmos DB database account. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. @@ -745,6 +826,142 @@ Page FirstPageFunc(int? pageSizeHint) return PageableHelpers.CreateEnumerable(FirstPageFunc, null); } + /// Retrieves the list of all Azure Cosmos DB SQL Role Definitions. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The cancellation token to use. + /// or is null. + public virtual AsyncPageable ListSqlRoleDefinitionsAsync(string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (accountName == null) + { + throw new ArgumentNullException(nameof(accountName)); + } + + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("SqlResourcesOperations.ListSqlRoleDefinitions"); + scope.Start(); + try + { + var response = await RestClient.ListSqlRoleDefinitionsAsync(resourceGroupName, accountName, cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null); + } + + /// Retrieves the list of all Azure Cosmos DB SQL Role Definitions. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The cancellation token to use. + /// or is null. + public virtual Pageable ListSqlRoleDefinitions(string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (accountName == null) + { + throw new ArgumentNullException(nameof(accountName)); + } + + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("SqlResourcesOperations.ListSqlRoleDefinitions"); + scope.Start(); + try + { + var response = RestClient.ListSqlRoleDefinitions(resourceGroupName, accountName, cancellationToken); + return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, null); + } + + /// Retrieves the list of all Azure Cosmos DB SQL Role Assignments. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The cancellation token to use. + /// or is null. + public virtual AsyncPageable ListSqlRoleAssignmentsAsync(string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (accountName == null) + { + throw new ArgumentNullException(nameof(accountName)); + } + + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("SqlResourcesOperations.ListSqlRoleAssignments"); + scope.Start(); + try + { + var response = await RestClient.ListSqlRoleAssignmentsAsync(resourceGroupName, accountName, cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null); + } + + /// Retrieves the list of all Azure Cosmos DB SQL Role Assignments. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The cancellation token to use. + /// or is null. + public virtual Pageable ListSqlRoleAssignments(string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (accountName == null) + { + throw new ArgumentNullException(nameof(accountName)); + } + + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("SqlResourcesOperations.ListSqlRoleAssignments"); + scope.Start(); + try + { + var response = RestClient.ListSqlRoleAssignments(resourceGroupName, accountName, cancellationToken); + return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, null); + } + /// Create or update an Azure Cosmos DB SQL database. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. @@ -2104,5 +2321,395 @@ public virtual SqlResourcesDeleteSqlTriggerOperation StartDeleteSqlTrigger(strin throw; } } + + /// Creates or updates an Azure Cosmos DB SQL Role Definition. + /// The GUID for the Role Definition. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The properties required to create or update a Role Definition. + /// The cancellation token to use. + /// , , , or is null. + public virtual async Task StartCreateUpdateSqlRoleDefinitionAsync(string roleDefinitionId, string resourceGroupName, string accountName, SqlRoleDefinitionCreateUpdateParameters createUpdateSqlRoleDefinitionParameters, CancellationToken cancellationToken = default) + { + if (roleDefinitionId == null) + { + throw new ArgumentNullException(nameof(roleDefinitionId)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (accountName == null) + { + throw new ArgumentNullException(nameof(accountName)); + } + if (createUpdateSqlRoleDefinitionParameters == null) + { + throw new ArgumentNullException(nameof(createUpdateSqlRoleDefinitionParameters)); + } + + using var scope = _clientDiagnostics.CreateScope("SqlResourcesOperations.StartCreateUpdateSqlRoleDefinition"); + scope.Start(); + try + { + var originalResponse = await RestClient.CreateUpdateSqlRoleDefinitionAsync(roleDefinitionId, resourceGroupName, accountName, createUpdateSqlRoleDefinitionParameters, cancellationToken).ConfigureAwait(false); + return new SqlResourcesCreateUpdateSqlRoleDefinitionOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateUpdateSqlRoleDefinitionRequest(roleDefinitionId, resourceGroupName, accountName, createUpdateSqlRoleDefinitionParameters).Request, originalResponse); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Creates or updates an Azure Cosmos DB SQL Role Definition. + /// The GUID for the Role Definition. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The properties required to create or update a Role Definition. + /// The cancellation token to use. + /// , , , or is null. + public virtual SqlResourcesCreateUpdateSqlRoleDefinitionOperation StartCreateUpdateSqlRoleDefinition(string roleDefinitionId, string resourceGroupName, string accountName, SqlRoleDefinitionCreateUpdateParameters createUpdateSqlRoleDefinitionParameters, CancellationToken cancellationToken = default) + { + if (roleDefinitionId == null) + { + throw new ArgumentNullException(nameof(roleDefinitionId)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (accountName == null) + { + throw new ArgumentNullException(nameof(accountName)); + } + if (createUpdateSqlRoleDefinitionParameters == null) + { + throw new ArgumentNullException(nameof(createUpdateSqlRoleDefinitionParameters)); + } + + using var scope = _clientDiagnostics.CreateScope("SqlResourcesOperations.StartCreateUpdateSqlRoleDefinition"); + scope.Start(); + try + { + var originalResponse = RestClient.CreateUpdateSqlRoleDefinition(roleDefinitionId, resourceGroupName, accountName, createUpdateSqlRoleDefinitionParameters, cancellationToken); + return new SqlResourcesCreateUpdateSqlRoleDefinitionOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateUpdateSqlRoleDefinitionRequest(roleDefinitionId, resourceGroupName, accountName, createUpdateSqlRoleDefinitionParameters).Request, originalResponse); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Deletes an existing Azure Cosmos DB SQL Role Definition. + /// The GUID for the Role Definition. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The cancellation token to use. + /// , , or is null. + public virtual async Task StartDeleteSqlRoleDefinitionAsync(string roleDefinitionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + if (roleDefinitionId == null) + { + throw new ArgumentNullException(nameof(roleDefinitionId)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (accountName == null) + { + throw new ArgumentNullException(nameof(accountName)); + } + + using var scope = _clientDiagnostics.CreateScope("SqlResourcesOperations.StartDeleteSqlRoleDefinition"); + scope.Start(); + try + { + var originalResponse = await RestClient.DeleteSqlRoleDefinitionAsync(roleDefinitionId, resourceGroupName, accountName, cancellationToken).ConfigureAwait(false); + return new SqlResourcesDeleteSqlRoleDefinitionOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteSqlRoleDefinitionRequest(roleDefinitionId, resourceGroupName, accountName).Request, originalResponse); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Deletes an existing Azure Cosmos DB SQL Role Definition. + /// The GUID for the Role Definition. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The cancellation token to use. + /// , , or is null. + public virtual SqlResourcesDeleteSqlRoleDefinitionOperation StartDeleteSqlRoleDefinition(string roleDefinitionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + if (roleDefinitionId == null) + { + throw new ArgumentNullException(nameof(roleDefinitionId)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (accountName == null) + { + throw new ArgumentNullException(nameof(accountName)); + } + + using var scope = _clientDiagnostics.CreateScope("SqlResourcesOperations.StartDeleteSqlRoleDefinition"); + scope.Start(); + try + { + var originalResponse = RestClient.DeleteSqlRoleDefinition(roleDefinitionId, resourceGroupName, accountName, cancellationToken); + return new SqlResourcesDeleteSqlRoleDefinitionOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteSqlRoleDefinitionRequest(roleDefinitionId, resourceGroupName, accountName).Request, originalResponse); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Creates or updates an Azure Cosmos DB SQL Role Assignment. + /// The GUID for the Role Assignment. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The properties required to create or update a Role Assignment. + /// The cancellation token to use. + /// , , , or is null. + public virtual async Task StartCreateUpdateSqlRoleAssignmentAsync(string roleAssignmentId, string resourceGroupName, string accountName, SqlRoleAssignmentCreateUpdateParameters createUpdateSqlRoleAssignmentParameters, CancellationToken cancellationToken = default) + { + if (roleAssignmentId == null) + { + throw new ArgumentNullException(nameof(roleAssignmentId)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (accountName == null) + { + throw new ArgumentNullException(nameof(accountName)); + } + if (createUpdateSqlRoleAssignmentParameters == null) + { + throw new ArgumentNullException(nameof(createUpdateSqlRoleAssignmentParameters)); + } + + using var scope = _clientDiagnostics.CreateScope("SqlResourcesOperations.StartCreateUpdateSqlRoleAssignment"); + scope.Start(); + try + { + var originalResponse = await RestClient.CreateUpdateSqlRoleAssignmentAsync(roleAssignmentId, resourceGroupName, accountName, createUpdateSqlRoleAssignmentParameters, cancellationToken).ConfigureAwait(false); + return new SqlResourcesCreateUpdateSqlRoleAssignmentOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateUpdateSqlRoleAssignmentRequest(roleAssignmentId, resourceGroupName, accountName, createUpdateSqlRoleAssignmentParameters).Request, originalResponse); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Creates or updates an Azure Cosmos DB SQL Role Assignment. + /// The GUID for the Role Assignment. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The properties required to create or update a Role Assignment. + /// The cancellation token to use. + /// , , , or is null. + public virtual SqlResourcesCreateUpdateSqlRoleAssignmentOperation StartCreateUpdateSqlRoleAssignment(string roleAssignmentId, string resourceGroupName, string accountName, SqlRoleAssignmentCreateUpdateParameters createUpdateSqlRoleAssignmentParameters, CancellationToken cancellationToken = default) + { + if (roleAssignmentId == null) + { + throw new ArgumentNullException(nameof(roleAssignmentId)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (accountName == null) + { + throw new ArgumentNullException(nameof(accountName)); + } + if (createUpdateSqlRoleAssignmentParameters == null) + { + throw new ArgumentNullException(nameof(createUpdateSqlRoleAssignmentParameters)); + } + + using var scope = _clientDiagnostics.CreateScope("SqlResourcesOperations.StartCreateUpdateSqlRoleAssignment"); + scope.Start(); + try + { + var originalResponse = RestClient.CreateUpdateSqlRoleAssignment(roleAssignmentId, resourceGroupName, accountName, createUpdateSqlRoleAssignmentParameters, cancellationToken); + return new SqlResourcesCreateUpdateSqlRoleAssignmentOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateUpdateSqlRoleAssignmentRequest(roleAssignmentId, resourceGroupName, accountName, createUpdateSqlRoleAssignmentParameters).Request, originalResponse); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Deletes an existing Azure Cosmos DB SQL Role Assignment. + /// The GUID for the Role Assignment. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The cancellation token to use. + /// , , or is null. + public virtual async Task StartDeleteSqlRoleAssignmentAsync(string roleAssignmentId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + if (roleAssignmentId == null) + { + throw new ArgumentNullException(nameof(roleAssignmentId)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (accountName == null) + { + throw new ArgumentNullException(nameof(accountName)); + } + + using var scope = _clientDiagnostics.CreateScope("SqlResourcesOperations.StartDeleteSqlRoleAssignment"); + scope.Start(); + try + { + var originalResponse = await RestClient.DeleteSqlRoleAssignmentAsync(roleAssignmentId, resourceGroupName, accountName, cancellationToken).ConfigureAwait(false); + return new SqlResourcesDeleteSqlRoleAssignmentOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteSqlRoleAssignmentRequest(roleAssignmentId, resourceGroupName, accountName).Request, originalResponse); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Deletes an existing Azure Cosmos DB SQL Role Assignment. + /// The GUID for the Role Assignment. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The cancellation token to use. + /// , , or is null. + public virtual SqlResourcesDeleteSqlRoleAssignmentOperation StartDeleteSqlRoleAssignment(string roleAssignmentId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + if (roleAssignmentId == null) + { + throw new ArgumentNullException(nameof(roleAssignmentId)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (accountName == null) + { + throw new ArgumentNullException(nameof(accountName)); + } + + using var scope = _clientDiagnostics.CreateScope("SqlResourcesOperations.StartDeleteSqlRoleAssignment"); + scope.Start(); + try + { + var originalResponse = RestClient.DeleteSqlRoleAssignment(roleAssignmentId, resourceGroupName, accountName, cancellationToken); + return new SqlResourcesDeleteSqlRoleAssignmentOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteSqlRoleAssignmentRequest(roleAssignmentId, resourceGroupName, accountName).Request, originalResponse); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Retrieves continuous backup information for a container resource. + /// 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 name of the continuous backup restore location. + /// The cancellation token to use. + /// , , , , or is null. + public virtual async Task StartRetrieveContinuousBackupInformationAsync(string resourceGroupName, string accountName, string databaseName, string containerName, ContinuousBackupRestoreLocation location, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (accountName == null) + { + throw new ArgumentNullException(nameof(accountName)); + } + if (databaseName == null) + { + throw new ArgumentNullException(nameof(databaseName)); + } + if (containerName == null) + { + throw new ArgumentNullException(nameof(containerName)); + } + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + + using var scope = _clientDiagnostics.CreateScope("SqlResourcesOperations.StartRetrieveContinuousBackupInformation"); + scope.Start(); + try + { + var originalResponse = await RestClient.RetrieveContinuousBackupInformationAsync(resourceGroupName, accountName, databaseName, containerName, location, cancellationToken).ConfigureAwait(false); + return new SqlResourcesRetrieveContinuousBackupInformationOperation(_clientDiagnostics, _pipeline, RestClient.CreateRetrieveContinuousBackupInformationRequest(resourceGroupName, accountName, databaseName, containerName, location).Request, originalResponse); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Retrieves continuous backup information for a container resource. + /// 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 name of the continuous backup restore location. + /// The cancellation token to use. + /// , , , , or is null. + public virtual SqlResourcesRetrieveContinuousBackupInformationOperation StartRetrieveContinuousBackupInformation(string resourceGroupName, string accountName, string databaseName, string containerName, ContinuousBackupRestoreLocation location, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (accountName == null) + { + throw new ArgumentNullException(nameof(accountName)); + } + if (databaseName == null) + { + throw new ArgumentNullException(nameof(databaseName)); + } + if (containerName == null) + { + throw new ArgumentNullException(nameof(containerName)); + } + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + + using var scope = _clientDiagnostics.CreateScope("SqlResourcesOperations.StartRetrieveContinuousBackupInformation"); + scope.Start(); + try + { + var originalResponse = RestClient.RetrieveContinuousBackupInformation(resourceGroupName, accountName, databaseName, containerName, location, cancellationToken); + return new SqlResourcesRetrieveContinuousBackupInformationOperation(_clientDiagnostics, _pipeline, RestClient.CreateRetrieveContinuousBackupInformationRequest(resourceGroupName, accountName, databaseName, containerName, location).Request, originalResponse); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/SqlResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/SqlResourcesRestOperations.cs index 1518427bc85e2..24f86bd8df79c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/SqlResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/SqlResourcesRestOperations.cs @@ -20,6 +20,7 @@ internal partial class SqlResourcesRestOperations { private string subscriptionId; private Uri endpoint; + private string apiVersion; private ClientDiagnostics _clientDiagnostics; private HttpPipeline _pipeline; @@ -28,17 +29,23 @@ internal partial class SqlResourcesRestOperations /// The HTTP pipeline for sending and receiving REST requests and responses. /// The ID of the target subscription. /// server parameter. - /// is null. - public SqlResourcesRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null) + /// Api Version. + /// or is null. + public SqlResourcesRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") { if (subscriptionId == null) { throw new ArgumentNullException(nameof(subscriptionId)); } endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } this.subscriptionId = subscriptionId; this.endpoint = endpoint; + this.apiVersion = apiVersion; _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } @@ -57,7 +64,7 @@ internal HttpMessage CreateListSqlDatabasesRequest(string resourceGroupName, str uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); uri.AppendPath(accountName, true); uri.AppendPath("/sqlDatabases", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -142,7 +149,7 @@ internal HttpMessage CreateGetSqlDatabaseRequest(string resourceGroupName, strin uri.AppendPath(accountName, true); uri.AppendPath("/sqlDatabases/", false); uri.AppendPath(databaseName, true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -237,7 +244,7 @@ internal HttpMessage CreateCreateUpdateSqlDatabaseRequest(string resourceGroupNa uri.AppendPath(accountName, true); uri.AppendPath("/sqlDatabases/", false); uri.AppendPath(databaseName, true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); @@ -338,7 +345,7 @@ internal HttpMessage CreateDeleteSqlDatabaseRequest(string resourceGroupName, st uri.AppendPath(accountName, true); uri.AppendPath("/sqlDatabases/", false); uri.AppendPath(databaseName, true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; return message; } @@ -425,7 +432,7 @@ internal HttpMessage CreateGetSqlDatabaseThroughputRequest(string resourceGroupN uri.AppendPath("/sqlDatabases/", false); uri.AppendPath(databaseName, true); uri.AppendPath("/throughputSettings/default", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -521,7 +528,7 @@ internal HttpMessage CreateUpdateSqlDatabaseThroughputRequest(string resourceGro uri.AppendPath("/sqlDatabases/", false); uri.AppendPath(databaseName, true); uri.AppendPath("/throughputSettings/default", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); @@ -623,7 +630,7 @@ internal HttpMessage CreateMigrateSqlDatabaseToAutoscaleRequest(string resourceG uri.AppendPath("/sqlDatabases/", false); uri.AppendPath(databaseName, true); uri.AppendPath("/throughputSettings/default/migrateToAutoscale", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -711,7 +718,7 @@ internal HttpMessage CreateMigrateSqlDatabaseToManualThroughputRequest(string re uri.AppendPath("/sqlDatabases/", false); uri.AppendPath(databaseName, true); uri.AppendPath("/throughputSettings/default/migrateToManualThroughput", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -799,7 +806,7 @@ internal HttpMessage CreateListSqlContainersRequest(string resourceGroupName, st uri.AppendPath("/sqlDatabases/", false); uri.AppendPath(databaseName, true); uri.AppendPath("/containers", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -896,7 +903,7 @@ internal HttpMessage CreateGetSqlContainerRequest(string resourceGroupName, stri uri.AppendPath(databaseName, true); uri.AppendPath("/containers/", false); uri.AppendPath(containerName, true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -1003,7 +1010,7 @@ internal HttpMessage CreateCreateUpdateSqlContainerRequest(string resourceGroupN uri.AppendPath(databaseName, true); uri.AppendPath("/containers/", false); uri.AppendPath(containerName, true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); @@ -1116,7 +1123,7 @@ internal HttpMessage CreateDeleteSqlContainerRequest(string resourceGroupName, s uri.AppendPath(databaseName, true); uri.AppendPath("/containers/", false); uri.AppendPath(containerName, true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; return message; } @@ -1215,7 +1222,7 @@ internal HttpMessage CreateGetSqlContainerThroughputRequest(string resourceGroup uri.AppendPath("/containers/", false); uri.AppendPath(containerName, true); uri.AppendPath("/throughputSettings/default", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -1323,7 +1330,7 @@ internal HttpMessage CreateUpdateSqlContainerThroughputRequest(string resourceGr uri.AppendPath("/containers/", false); uri.AppendPath(containerName, true); uri.AppendPath("/throughputSettings/default", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); @@ -1437,7 +1444,7 @@ internal HttpMessage CreateMigrateSqlContainerToAutoscaleRequest(string resource uri.AppendPath("/containers/", false); uri.AppendPath(containerName, true); uri.AppendPath("/throughputSettings/default/migrateToAutoscale", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -1537,7 +1544,7 @@ internal HttpMessage CreateMigrateSqlContainerToManualThroughputRequest(string r uri.AppendPath("/containers/", false); uri.AppendPath(containerName, true); uri.AppendPath("/throughputSettings/default/migrateToManualThroughput", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -1637,7 +1644,7 @@ internal HttpMessage CreateListSqlStoredProceduresRequest(string resourceGroupNa uri.AppendPath("/containers/", false); uri.AppendPath(containerName, true); uri.AppendPath("/storedProcedures", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -1746,7 +1753,7 @@ internal HttpMessage CreateGetSqlStoredProcedureRequest(string resourceGroupName uri.AppendPath(containerName, true); uri.AppendPath("/storedProcedures/", false); uri.AppendPath(storedProcedureName, true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -1865,7 +1872,7 @@ internal HttpMessage CreateCreateUpdateSqlStoredProcedureRequest(string resource uri.AppendPath(containerName, true); uri.AppendPath("/storedProcedures/", false); uri.AppendPath(storedProcedureName, true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); @@ -1990,7 +1997,7 @@ internal HttpMessage CreateDeleteSqlStoredProcedureRequest(string resourceGroupN uri.AppendPath(containerName, true); uri.AppendPath("/storedProcedures/", false); uri.AppendPath(storedProcedureName, true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; return message; } @@ -2099,7 +2106,7 @@ internal HttpMessage CreateListSqlUserDefinedFunctionsRequest(string resourceGro uri.AppendPath("/containers/", false); uri.AppendPath(containerName, true); uri.AppendPath("/userDefinedFunctions", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -2208,7 +2215,7 @@ internal HttpMessage CreateGetSqlUserDefinedFunctionRequest(string resourceGroup uri.AppendPath(containerName, true); uri.AppendPath("/userDefinedFunctions/", false); uri.AppendPath(userDefinedFunctionName, true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -2327,7 +2334,7 @@ internal HttpMessage CreateCreateUpdateSqlUserDefinedFunctionRequest(string reso uri.AppendPath(containerName, true); uri.AppendPath("/userDefinedFunctions/", false); uri.AppendPath(userDefinedFunctionName, true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); @@ -2452,7 +2459,7 @@ internal HttpMessage CreateDeleteSqlUserDefinedFunctionRequest(string resourceGr uri.AppendPath(containerName, true); uri.AppendPath("/userDefinedFunctions/", false); uri.AppendPath(userDefinedFunctionName, true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; return message; } @@ -2561,7 +2568,7 @@ internal HttpMessage CreateListSqlTriggersRequest(string resourceGroupName, stri uri.AppendPath("/containers/", false); uri.AppendPath(containerName, true); uri.AppendPath("/triggers", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -2670,7 +2677,7 @@ internal HttpMessage CreateGetSqlTriggerRequest(string resourceGroupName, string uri.AppendPath(containerName, true); uri.AppendPath("/triggers/", false); uri.AppendPath(triggerName, true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -2789,7 +2796,7 @@ internal HttpMessage CreateCreateUpdateSqlTriggerRequest(string resourceGroupNam uri.AppendPath(containerName, true); uri.AppendPath("/triggers/", false); uri.AppendPath(triggerName, true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); @@ -2914,7 +2921,7 @@ internal HttpMessage CreateDeleteSqlTriggerRequest(string resourceGroupName, str uri.AppendPath(containerName, true); uri.AppendPath("/triggers/", false); uri.AppendPath(triggerName, true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; return message; } @@ -3004,5 +3011,857 @@ public Response DeleteSqlTrigger(string resourceGroupName, string accountName, s throw _clientDiagnostics.CreateRequestFailedException(message.Response); } } + + internal HttpMessage CreateGetSqlRoleDefinitionRequest(string roleDefinitionId, 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("/sqlRoleDefinitions/", false); + uri.AppendPath(roleDefinitionId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Retrieves the properties of an existing Azure Cosmos DB SQL Role Definition with the given Id. + /// The GUID for the Role Definition. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetSqlRoleDefinitionAsync(string roleDefinitionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + if (roleDefinitionId == null) + { + throw new ArgumentNullException(nameof(roleDefinitionId)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (accountName == null) + { + throw new ArgumentNullException(nameof(accountName)); + } + + using var message = CreateGetSqlRoleDefinitionRequest(roleDefinitionId, resourceGroupName, accountName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SqlRoleDefinitionGetResults value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SqlRoleDefinitionGetResults.DeserializeSqlRoleDefinitionGetResults(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Retrieves the properties of an existing Azure Cosmos DB SQL Role Definition with the given Id. + /// The GUID for the Role Definition. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The cancellation token to use. + /// , , or is null. + public Response GetSqlRoleDefinition(string roleDefinitionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + if (roleDefinitionId == null) + { + throw new ArgumentNullException(nameof(roleDefinitionId)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (accountName == null) + { + throw new ArgumentNullException(nameof(accountName)); + } + + using var message = CreateGetSqlRoleDefinitionRequest(roleDefinitionId, resourceGroupName, accountName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SqlRoleDefinitionGetResults value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SqlRoleDefinitionGetResults.DeserializeSqlRoleDefinitionGetResults(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateUpdateSqlRoleDefinitionRequest(string roleDefinitionId, string resourceGroupName, string accountName, SqlRoleDefinitionCreateUpdateParameters createUpdateSqlRoleDefinitionParameters) + { + 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("/sqlRoleDefinitions/", false); + uri.AppendPath(roleDefinitionId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(createUpdateSqlRoleDefinitionParameters); + request.Content = content; + return message; + } + + /// Creates or updates an Azure Cosmos DB SQL Role Definition. + /// The GUID for the Role Definition. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The properties required to create or update a Role Definition. + /// The cancellation token to use. + /// , , , or is null. + public async Task CreateUpdateSqlRoleDefinitionAsync(string roleDefinitionId, string resourceGroupName, string accountName, SqlRoleDefinitionCreateUpdateParameters createUpdateSqlRoleDefinitionParameters, CancellationToken cancellationToken = default) + { + if (roleDefinitionId == null) + { + throw new ArgumentNullException(nameof(roleDefinitionId)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (accountName == null) + { + throw new ArgumentNullException(nameof(accountName)); + } + if (createUpdateSqlRoleDefinitionParameters == null) + { + throw new ArgumentNullException(nameof(createUpdateSqlRoleDefinitionParameters)); + } + + using var message = CreateCreateUpdateSqlRoleDefinitionRequest(roleDefinitionId, resourceGroupName, accountName, createUpdateSqlRoleDefinitionParameters); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Creates or updates an Azure Cosmos DB SQL Role Definition. + /// The GUID for the Role Definition. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The properties required to create or update a Role Definition. + /// The cancellation token to use. + /// , , , or is null. + public Response CreateUpdateSqlRoleDefinition(string roleDefinitionId, string resourceGroupName, string accountName, SqlRoleDefinitionCreateUpdateParameters createUpdateSqlRoleDefinitionParameters, CancellationToken cancellationToken = default) + { + if (roleDefinitionId == null) + { + throw new ArgumentNullException(nameof(roleDefinitionId)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (accountName == null) + { + throw new ArgumentNullException(nameof(accountName)); + } + if (createUpdateSqlRoleDefinitionParameters == null) + { + throw new ArgumentNullException(nameof(createUpdateSqlRoleDefinitionParameters)); + } + + using var message = CreateCreateUpdateSqlRoleDefinitionRequest(roleDefinitionId, resourceGroupName, accountName, createUpdateSqlRoleDefinitionParameters); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteSqlRoleDefinitionRequest(string roleDefinitionId, string resourceGroupName, string accountName) + { + 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("/sqlRoleDefinitions/", false); + uri.AppendPath(roleDefinitionId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Deletes an existing Azure Cosmos DB SQL Role Definition. + /// The GUID for the Role Definition. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The cancellation token to use. + /// , , or is null. + public async Task DeleteSqlRoleDefinitionAsync(string roleDefinitionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + if (roleDefinitionId == null) + { + throw new ArgumentNullException(nameof(roleDefinitionId)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (accountName == null) + { + throw new ArgumentNullException(nameof(accountName)); + } + + using var message = CreateDeleteSqlRoleDefinitionRequest(roleDefinitionId, resourceGroupName, accountName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Deletes an existing Azure Cosmos DB SQL Role Definition. + /// The GUID for the Role Definition. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The cancellation token to use. + /// , , or is null. + public Response DeleteSqlRoleDefinition(string roleDefinitionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + if (roleDefinitionId == null) + { + throw new ArgumentNullException(nameof(roleDefinitionId)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (accountName == null) + { + throw new ArgumentNullException(nameof(accountName)); + } + + using var message = CreateDeleteSqlRoleDefinitionRequest(roleDefinitionId, resourceGroupName, accountName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSqlRoleDefinitionsRequest(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("/sqlRoleDefinitions", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Retrieves the list of all Azure Cosmos DB SQL Role Definitions. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The cancellation token to use. + /// or is null. + public async Task> ListSqlRoleDefinitionsAsync(string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (accountName == null) + { + throw new ArgumentNullException(nameof(accountName)); + } + + using var message = CreateListSqlRoleDefinitionsRequest(resourceGroupName, accountName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SqlRoleDefinitionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SqlRoleDefinitionListResult.DeserializeSqlRoleDefinitionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Retrieves the list of all Azure Cosmos DB SQL Role Definitions. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The cancellation token to use. + /// or is null. + public Response ListSqlRoleDefinitions(string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (accountName == null) + { + throw new ArgumentNullException(nameof(accountName)); + } + + using var message = CreateListSqlRoleDefinitionsRequest(resourceGroupName, accountName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SqlRoleDefinitionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SqlRoleDefinitionListResult.DeserializeSqlRoleDefinitionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetSqlRoleAssignmentRequest(string roleAssignmentId, 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("/sqlRoleAssignments/", false); + uri.AppendPath(roleAssignmentId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Retrieves the properties of an existing Azure Cosmos DB SQL Role Assignment with the given Id. + /// The GUID for the Role Assignment. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetSqlRoleAssignmentAsync(string roleAssignmentId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + if (roleAssignmentId == null) + { + throw new ArgumentNullException(nameof(roleAssignmentId)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (accountName == null) + { + throw new ArgumentNullException(nameof(accountName)); + } + + using var message = CreateGetSqlRoleAssignmentRequest(roleAssignmentId, resourceGroupName, accountName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SqlRoleAssignmentGetResults value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SqlRoleAssignmentGetResults.DeserializeSqlRoleAssignmentGetResults(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Retrieves the properties of an existing Azure Cosmos DB SQL Role Assignment with the given Id. + /// The GUID for the Role Assignment. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The cancellation token to use. + /// , , or is null. + public Response GetSqlRoleAssignment(string roleAssignmentId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + if (roleAssignmentId == null) + { + throw new ArgumentNullException(nameof(roleAssignmentId)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (accountName == null) + { + throw new ArgumentNullException(nameof(accountName)); + } + + using var message = CreateGetSqlRoleAssignmentRequest(roleAssignmentId, resourceGroupName, accountName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SqlRoleAssignmentGetResults value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SqlRoleAssignmentGetResults.DeserializeSqlRoleAssignmentGetResults(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateUpdateSqlRoleAssignmentRequest(string roleAssignmentId, string resourceGroupName, string accountName, SqlRoleAssignmentCreateUpdateParameters createUpdateSqlRoleAssignmentParameters) + { + 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("/sqlRoleAssignments/", false); + uri.AppendPath(roleAssignmentId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(createUpdateSqlRoleAssignmentParameters); + request.Content = content; + return message; + } + + /// Creates or updates an Azure Cosmos DB SQL Role Assignment. + /// The GUID for the Role Assignment. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The properties required to create or update a Role Assignment. + /// The cancellation token to use. + /// , , , or is null. + public async Task CreateUpdateSqlRoleAssignmentAsync(string roleAssignmentId, string resourceGroupName, string accountName, SqlRoleAssignmentCreateUpdateParameters createUpdateSqlRoleAssignmentParameters, CancellationToken cancellationToken = default) + { + if (roleAssignmentId == null) + { + throw new ArgumentNullException(nameof(roleAssignmentId)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (accountName == null) + { + throw new ArgumentNullException(nameof(accountName)); + } + if (createUpdateSqlRoleAssignmentParameters == null) + { + throw new ArgumentNullException(nameof(createUpdateSqlRoleAssignmentParameters)); + } + + using var message = CreateCreateUpdateSqlRoleAssignmentRequest(roleAssignmentId, resourceGroupName, accountName, createUpdateSqlRoleAssignmentParameters); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Creates or updates an Azure Cosmos DB SQL Role Assignment. + /// The GUID for the Role Assignment. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The properties required to create or update a Role Assignment. + /// The cancellation token to use. + /// , , , or is null. + public Response CreateUpdateSqlRoleAssignment(string roleAssignmentId, string resourceGroupName, string accountName, SqlRoleAssignmentCreateUpdateParameters createUpdateSqlRoleAssignmentParameters, CancellationToken cancellationToken = default) + { + if (roleAssignmentId == null) + { + throw new ArgumentNullException(nameof(roleAssignmentId)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (accountName == null) + { + throw new ArgumentNullException(nameof(accountName)); + } + if (createUpdateSqlRoleAssignmentParameters == null) + { + throw new ArgumentNullException(nameof(createUpdateSqlRoleAssignmentParameters)); + } + + using var message = CreateCreateUpdateSqlRoleAssignmentRequest(roleAssignmentId, resourceGroupName, accountName, createUpdateSqlRoleAssignmentParameters); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteSqlRoleAssignmentRequest(string roleAssignmentId, string resourceGroupName, string accountName) + { + 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("/sqlRoleAssignments/", false); + uri.AppendPath(roleAssignmentId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Deletes an existing Azure Cosmos DB SQL Role Assignment. + /// The GUID for the Role Assignment. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The cancellation token to use. + /// , , or is null. + public async Task DeleteSqlRoleAssignmentAsync(string roleAssignmentId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + if (roleAssignmentId == null) + { + throw new ArgumentNullException(nameof(roleAssignmentId)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (accountName == null) + { + throw new ArgumentNullException(nameof(accountName)); + } + + using var message = CreateDeleteSqlRoleAssignmentRequest(roleAssignmentId, resourceGroupName, accountName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Deletes an existing Azure Cosmos DB SQL Role Assignment. + /// The GUID for the Role Assignment. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The cancellation token to use. + /// , , or is null. + public Response DeleteSqlRoleAssignment(string roleAssignmentId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + if (roleAssignmentId == null) + { + throw new ArgumentNullException(nameof(roleAssignmentId)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (accountName == null) + { + throw new ArgumentNullException(nameof(accountName)); + } + + using var message = CreateDeleteSqlRoleAssignmentRequest(roleAssignmentId, resourceGroupName, accountName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSqlRoleAssignmentsRequest(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("/sqlRoleAssignments", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Retrieves the list of all Azure Cosmos DB SQL Role Assignments. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The cancellation token to use. + /// or is null. + public async Task> ListSqlRoleAssignmentsAsync(string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (accountName == null) + { + throw new ArgumentNullException(nameof(accountName)); + } + + using var message = CreateListSqlRoleAssignmentsRequest(resourceGroupName, accountName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SqlRoleAssignmentListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SqlRoleAssignmentListResult.DeserializeSqlRoleAssignmentListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Retrieves the list of all Azure Cosmos DB SQL Role Assignments. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The cancellation token to use. + /// or is null. + public Response ListSqlRoleAssignments(string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (accountName == null) + { + throw new ArgumentNullException(nameof(accountName)); + } + + using var message = CreateListSqlRoleAssignmentsRequest(resourceGroupName, accountName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SqlRoleAssignmentListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SqlRoleAssignmentListResult.DeserializeSqlRoleAssignmentListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateRetrieveContinuousBackupInformationRequest(string resourceGroupName, string accountName, string databaseName, string containerName, ContinuousBackupRestoreLocation location) + { + 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("/containers/", false); + uri.AppendPath(containerName, true); + uri.AppendPath("/retrieveContinuousBackupInformation", 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(location); + request.Content = content; + return message; + } + + /// Retrieves continuous backup information for a container resource. + /// 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 name of the continuous backup restore location. + /// The cancellation token to use. + /// , , , , or is null. + public async Task RetrieveContinuousBackupInformationAsync(string resourceGroupName, string accountName, string databaseName, string containerName, ContinuousBackupRestoreLocation location, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (accountName == null) + { + throw new ArgumentNullException(nameof(accountName)); + } + if (databaseName == null) + { + throw new ArgumentNullException(nameof(databaseName)); + } + if (containerName == null) + { + throw new ArgumentNullException(nameof(containerName)); + } + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + + using var message = CreateRetrieveContinuousBackupInformationRequest(resourceGroupName, accountName, databaseName, containerName, location); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Retrieves continuous backup information for a container resource. + /// 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 name of the continuous backup restore location. + /// The cancellation token to use. + /// , , , , or is null. + public Response RetrieveContinuousBackupInformation(string resourceGroupName, string accountName, string databaseName, string containerName, ContinuousBackupRestoreLocation location, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (accountName == null) + { + throw new ArgumentNullException(nameof(accountName)); + } + if (databaseName == null) + { + throw new ArgumentNullException(nameof(databaseName)); + } + if (containerName == null) + { + throw new ArgumentNullException(nameof(containerName)); + } + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + + using var message = CreateRetrieveContinuousBackupInformationRequest(resourceGroupName, accountName, databaseName, containerName, location); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/SqlResourcesRetrieveContinuousBackupInformationOperation.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/SqlResourcesRetrieveContinuousBackupInformationOperation.cs new file mode 100644 index 0000000000000..e049378bfe1a8 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/SqlResourcesRetrieveContinuousBackupInformationOperation.cs @@ -0,0 +1,72 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.CosmosDB.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + /// Retrieves continuous backup information for a container resource. + public partial class SqlResourcesRetrieveContinuousBackupInformationOperation : Operation, IOperationSource + { + private readonly ArmOperationHelpers _operation; + + /// Initializes a new instance of SqlResourcesRetrieveContinuousBackupInformationOperation for mocking. + protected SqlResourcesRetrieveContinuousBackupInformationOperation() + { + } + + internal SqlResourcesRetrieveContinuousBackupInformationOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response) + { + _operation = new ArmOperationHelpers(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "SqlResourcesRetrieveContinuousBackupInformationOperation"); + } + /// + public override string Id => _operation.Id; + + /// + public override BackupInformation Value => _operation.Value; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override bool HasValue => _operation.HasValue; + + /// + public override Response GetRawResponse() => _operation.GetRawResponse(); + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); + + BackupInformation IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + return BackupInformation.DeserializeBackupInformation(document.RootElement); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + return BackupInformation.DeserializeBackupInformation(document.RootElement); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/TableResourcesOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/TableResourcesOperations.cs index 8b537569e46ae..c19e1d21d6a3b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/TableResourcesOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/TableResourcesOperations.cs @@ -32,9 +32,10 @@ protected TableResourcesOperations() /// The HTTP pipeline for sending and receiving REST requests and responses. /// The ID of the target subscription. /// server parameter. - internal TableResourcesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null) + /// Api Version. + internal TableResourcesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") { - RestClient = new TableResourcesRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint); + RestClient = new TableResourcesRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion); _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/TableResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/TableResourcesRestOperations.cs index e8550154ce17d..9906956bb0a67 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/TableResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/TableResourcesRestOperations.cs @@ -20,6 +20,7 @@ internal partial class TableResourcesRestOperations { private string subscriptionId; private Uri endpoint; + private string apiVersion; private ClientDiagnostics _clientDiagnostics; private HttpPipeline _pipeline; @@ -28,17 +29,23 @@ internal partial class TableResourcesRestOperations /// The HTTP pipeline for sending and receiving REST requests and responses. /// The ID of the target subscription. /// server parameter. - /// is null. - public TableResourcesRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null) + /// Api Version. + /// or is null. + public TableResourcesRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-06-15") { if (subscriptionId == null) { throw new ArgumentNullException(nameof(subscriptionId)); } endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } this.subscriptionId = subscriptionId; this.endpoint = endpoint; + this.apiVersion = apiVersion; _clientDiagnostics = clientDiagnostics; _pipeline = pipeline; } @@ -57,7 +64,7 @@ internal HttpMessage CreateListTablesRequest(string resourceGroupName, string ac uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); uri.AppendPath(accountName, true); uri.AppendPath("/tables", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -142,7 +149,7 @@ internal HttpMessage CreateGetTableRequest(string resourceGroupName, string acco uri.AppendPath(accountName, true); uri.AppendPath("/tables/", false); uri.AppendPath(tableName, true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -237,7 +244,7 @@ internal HttpMessage CreateCreateUpdateTableRequest(string resourceGroupName, st uri.AppendPath(accountName, true); uri.AppendPath("/tables/", false); uri.AppendPath(tableName, true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); @@ -338,7 +345,7 @@ internal HttpMessage CreateDeleteTableRequest(string resourceGroupName, string a uri.AppendPath(accountName, true); uri.AppendPath("/tables/", false); uri.AppendPath(tableName, true); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; return message; } @@ -425,7 +432,7 @@ internal HttpMessage CreateGetTableThroughputRequest(string resourceGroupName, s uri.AppendPath("/tables/", false); uri.AppendPath(tableName, true); uri.AppendPath("/throughputSettings/default", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -521,7 +528,7 @@ internal HttpMessage CreateUpdateTableThroughputRequest(string resourceGroupName uri.AppendPath("/tables/", false); uri.AppendPath(tableName, true); uri.AppendPath("/throughputSettings/default", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); @@ -623,7 +630,7 @@ internal HttpMessage CreateMigrateTableToAutoscaleRequest(string resourceGroupNa uri.AppendPath("/tables/", false); uri.AppendPath(tableName, true); uri.AppendPath("/throughputSettings/default/migrateToAutoscale", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -711,7 +718,7 @@ internal HttpMessage CreateMigrateTableToManualThroughputRequest(string resource uri.AppendPath("/tables/", false); uri.AppendPath(tableName, true); uri.AppendPath("/throughputSettings/default/migrateToManualThroughput", false); - uri.AppendQuery("api-version", "2020-04-01", true); + uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/autorest.md b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/autorest.md index 442d683a1a2f6..f8eb74b7aec08 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/autorest.md +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/autorest.md @@ -5,8 +5,8 @@ Run `dotnet build /t:GenerateCode` to generate code. ``` yaml azure-arm: true -require: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/86f4c7c4403845651ab9c027f7aa6fa392fd935c/specification/cosmos-db/resource-manager/readme.md +require: https://github.com/Azure/azure-rest-api-specs/blob/cde7f150e8d3bf3af2418cc347cae0fb2baed6a7/specification/cosmos-db/resource-manager/readme.md modelerfour: lenient-model-deduplication: true -``` \ No newline at end of file +```