From 13e33bb058715d98f676f7abb1e0e1523ebb695a Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Sat, 14 Sep 2024 09:05:13 +0000 Subject: [PATCH] CodeGen from PR 30578 in Azure/azure-rest-api-specs Merge e161f311bbc74ff99336c04e0ec6297525ad9ce9 into c41b76298becce0a8cfac4e682773d5d0c78dcb2 --- .../Microsoft.VoiceServices.Provisioning.sln | 50 + .../AccountResource.Serialization.cs | 208 ++ .../src/Generated/AccountResource.cs | 93 + .../AccountServiceDetails.Serialization.cs | 221 ++ .../src/Generated/AccountServiceDetails.cs | 85 + .../src/Generated/Accounts.cs | 2036 +++++++++++++ ...lProtectionAccountDetails.Serialization.cs | 151 + ...ureOperatorCallProtectionAccountDetails.cs | 76 + ...llProtectionNumberDetails.Serialization.cs | 136 + ...zureOperatorCallProtectionNumberDetails.cs | 72 + .../Generated/BatchNumbers.Serialization.cs | 146 + .../src/Generated/BatchNumbers.cs | 76 + .../BatchNumbersDelete.Serialization.cs | 146 + .../src/Generated/BatchNumbersDelete.cs | 76 + .../Generated/ContactDetails.Serialization.cs | 189 ++ .../src/Generated/ContactDetails.cs} | 49 +- .../CustomerRelationship.Serialization.cs | 165 + .../src/Generated/CustomerRelationship.cs} | 36 +- .../src/Generated/Docs/Accounts.xml | 2507 +++++++++++++++ .../Docs/TeamsRequestsForInformation.xml | 411 +++ .../Generated/Docs/VoiceServicesClient.xml | 181 ++ .../src/Generated/Internal/Argument.cs | 129 + .../Internal/ChangeTrackingDictionary.cs | 167 + .../Generated/Internal/ChangeTrackingList.cs | 153 + .../Internal/ModelSerializationExtensions.cs | 398 +++ .../src/Generated/Internal/Optional.cs | 51 + .../Internal/Utf8JsonRequestContent.cs | 55 + .../src/Generated/Location.Serialization.cs | 205 ++ .../src/Generated/Location.cs | 85 + ...icesProvisioningClientBuilderExtensions.cs | 35 + ...ftVoiceServicesProvisioningModelFactory.cs | 365 +++ .../NumberConfiguration.Serialization.cs | 139 + .../src/Generated/NumberConfiguration.cs} | 27 +- .../NumberIdentifier.Serialization.cs | 136 + .../src/Generated/NumberIdentifier.cs | 75 + .../NumberIdentifiers.Serialization.cs | 146 + .../src/Generated/NumberIdentifiers.cs} | 45 +- .../Generated/NumberResource.Serialization.cs | 214 ++ .../src/Generated/NumberResource.cs | 103 + .../NumberServiceDetails.Serialization.cs | 209 ++ .../src/Generated/NumberServiceDetails.cs | 81 + ...estForInformationResource.Serialization.cs | 347 +++ .../RequestForInformationResource.cs | 117 + .../Generated/ServiceProvisioningStatus.cs | 54 + ...amsAvailableCapabilities.Serialization.cs} | 110 +- .../Generated/TeamsAvailableCapabilities.cs} | 28 +- .../TeamsCapabilityPlan.Serialization.cs | 243 ++ .../src/Generated/TeamsCapabilityPlan.cs | 88 + .../TeamsCapabilityPlans.Serialization.cs | 149 + .../src/Generated/TeamsCapabilityPlans.cs} | 24 +- ...TeamsCivicAddressResource.Serialization.cs | 423 +++ .../Generated/TeamsCivicAddressResource.cs | 154 + .../src/Generated/TeamsConsentStatus.cs | 54 + ...irectRoutingAccountConfig.Serialization.cs | 152 + .../TeamsDirectRoutingAccountConfig.cs | 88 + ...rectRoutingAccountDetails.Serialization.cs | 191 ++ .../TeamsDirectRoutingAccountDetails.cs | 90 + ...irectRoutingNumberDetails.Serialization.cs | 136 + .../TeamsDirectRoutingNumberDetails.cs} | 34 +- ...irectRoutingSubdomainProvisioningStatus.cs | 54 + ...ectRoutingSubdomainTokens.Serialization.cs | 144 + .../TeamsDirectRoutingSubdomainTokens.cs | 82 + ...atorConnectAccountDetails.Serialization.cs | 159 + .../TeamsOperatorConnectAccountDetails.cs | 82 + ...eratorConnectNumberConfig.Serialization.cs | 287 ++ .../TeamsOperatorConnectNumberConfig.cs | 114 + ...ratorConnectNumberDetails.Serialization.cs | 166 + .../TeamsOperatorConnectNumberDetails.cs | 80 + ...PhoneMobileAccountDetails.Serialization.cs | 159 + .../TeamsPhoneMobileAccountDetails.cs | 82 + ...msPhoneMobileNumberConfig.Serialization.cs | 287 ++ .../Generated/TeamsPhoneMobileNumberConfig.cs | 114 + ...sPhoneMobileNumberDetails.Serialization.cs | 166 + .../TeamsPhoneMobileNumberDetails.cs | 80 + .../Generated/TeamsRequestsForInformation.cs | 447 +++ .../TelephoneNumberAssignmentStatus.cs | 51 + .../src/Generated/ValidationStatus.cs | 51 + .../src/Generated/VoiceServicesClient.cs | 234 ++ .../Generated/VoiceServicesClientOptions.cs | 37 + ...loudPeeringAccountDetails.Serialization.cs | 159 + .../ZoomPhoneCloudPeeringAccountDetails.cs | 82 + ...CloudPeeringNumberDetails.Serialization.cs | 136 + .../ZoomPhoneCloudPeeringNumberDetails.cs | 72 + ...icrosoft.VoiceServices.Provisioning.csproj | 19 + .../src/Properties/AssemblyInfo.cs | 6 + .../Generated/Samples/Samples_Accounts.cs | 2678 +++++++++++++++++ .../Samples_TeamsRequestsForInformation.cs | 456 +++ .../Samples/Samples_VoiceServicesClient.cs | 208 ++ ...ft.VoiceServices.Provisioning.Tests.csproj | 19 + .../tsp-location.yaml | 4 + .../Sample_CassandraClusterCollection.cs | 12 +- .../Sample_CassandraClusterResource.cs | 151 +- .../Sample_CassandraDataCenterCollection.cs | 10 +- .../Sample_CassandraDataCenterResource.cs | 6 +- .../Sample_CassandraKeyspaceCollection.cs | 10 +- .../Sample_CassandraKeyspaceResource.cs | 6 +- ...sandraKeyspaceThroughputSettingResource.cs | 8 +- .../Sample_CassandraTableCollection.cs | 11 +- .../Samples/Sample_CassandraTableResource.cs | 7 +- ...CassandraTableThroughputSettingResource.cs | 8 +- ...Sample_CassandraViewGetResultCollection.cs | 212 -- .../Sample_CassandraViewGetResultResource.cs | 121 - ..._CassandraViewThroughputSettingResource.cs | 162 - .../Sample_CosmosDBAccountCollection.cs | 37 +- .../Samples/Sample_CosmosDBAccountResource.cs | 73 +- .../Sample_CosmosDBLocationCollection.cs | 8 +- .../Sample_CosmosDBLocationResource.cs | 2 +- ...osDBPrivateEndpointConnectionCollection.cs | 10 +- ...smosDBPrivateEndpointConnectionResource.cs | 6 +- .../Sample_CosmosDBPrivateLinkResource.cs | 2 +- ...e_CosmosDBPrivateLinkResourceCollection.cs | 8 +- .../Sample_CosmosDBServiceCollection.cs | 34 +- .../Samples/Sample_CosmosDBServiceResource.cs | 24 +- ...osmosDBSqlClientEncryptionKeyCollection.cs | 12 +- ..._CosmosDBSqlClientEncryptionKeyResource.cs | 6 +- .../Sample_CosmosDBSqlContainerCollection.cs | 147 +- .../Sample_CosmosDBSqlContainerResource.cs | 173 +- ...DBSqlContainerThroughputSettingResource.cs | 95 +- .../Sample_CosmosDBSqlDatabaseCollection.cs | 62 +- .../Sample_CosmosDBSqlDatabaseResource.cs | 88 +- ...sDBSqlDatabaseThroughputSettingResource.cs | 93 +- ...ple_CosmosDBSqlRoleAssignmentCollection.cs | 10 +- ...ample_CosmosDBSqlRoleAssignmentResource.cs | 6 +- ...ple_CosmosDBSqlRoleDefinitionCollection.cs | 10 +- ...ample_CosmosDBSqlRoleDefinitionResource.cs | 6 +- ...le_CosmosDBSqlStoredProcedureCollection.cs | 10 +- ...mple_CosmosDBSqlStoredProcedureResource.cs | 6 +- .../Sample_CosmosDBSqlTriggerCollection.cs | 10 +- .../Sample_CosmosDBSqlTriggerResource.cs | 6 +- ...osmosDBSqlUserDefinedFunctionCollection.cs | 10 +- ..._CosmosDBSqlUserDefinedFunctionResource.cs | 6 +- .../Samples/Sample_CosmosDBTableCollection.cs | 10 +- .../Samples/Sample_CosmosDBTableResource.cs | 8 +- ...CosmosDBThroughputPoolAccountCollection.cs | 204 -- ...e_CosmosDBThroughputPoolAccountResource.cs | 115 - ...Sample_CosmosDBThroughputPoolCollection.cs | 202 -- .../Sample_CosmosDBThroughputPoolResource.cs | 145 - ...le_CosmosTableThroughputSettingResource.cs | 8 +- ...mple_DataTransferJobGetResultCollection.cs | 204 -- ...Sample_DataTransferJobGetResultResource.cs | 215 -- ...Sample_GraphResourceGetResultCollection.cs | 211 -- .../Sample_GraphResourceGetResultResource.cs | 122 - .../Sample_GremlinDatabaseCollection.cs | 10 +- .../Samples/Sample_GremlinDatabaseResource.cs | 6 +- ...remlinDatabaseThroughputSettingResource.cs | 8 +- .../Samples/Sample_GremlinGraphCollection.cs | 10 +- .../Samples/Sample_GremlinGraphResource.cs | 8 +- ...e_GremlinGraphThroughputSettingResource.cs | 8 +- .../Sample_MongoDBCollectionCollection.cs | 64 +- .../Sample_MongoDBCollectionResource.cs | 93 +- ...goDBCollectionThroughputSettingResource.cs | 95 +- .../Sample_MongoDBDatabaseCollection.cs | 62 +- .../Samples/Sample_MongoDBDatabaseResource.cs | 88 +- ...ongoDBDatabaseThroughputSettingResource.cs | 93 +- .../Sample_MongoDBRoleDefinitionCollection.cs | 10 +- .../Sample_MongoDBRoleDefinitionResource.cs | 6 +- .../Sample_MongoDBUserDefinitionCollection.cs | 10 +- .../Sample_MongoDBUserDefinitionResource.cs | 6 +- ...ecurityPerimeterConfigurationCollection.cs | 163 - ...kSecurityPerimeterConfigurationResource.cs | 77 - ...ple_RestorableCosmosDBAccountCollection.cs | 8 +- ...ample_RestorableCosmosDBAccountResource.cs | 26 +- .../src/Generated/ArmCosmosDBModelFactory.cs | 800 +---- .../Generated/CassandraClusterCollection.cs | 20 +- .../src/Generated/CassandraClusterResource.cs | 397 +-- .../CassandraDataCenterCollection.cs | 20 +- .../Generated/CassandraDataCenterResource.cs | 12 +- .../Generated/CassandraKeyspaceCollection.cs | 20 +- .../CassandraKeyspaceData.Serialization.cs | 33 - .../src/Generated/CassandraKeyspaceData.cs | 7 +- .../Generated/CassandraKeyspaceResource.cs | 97 +- ...sandraKeyspaceThroughputSettingResource.cs | 28 +- .../src/Generated/CassandraTableCollection.cs | 20 +- .../CassandraTableData.Serialization.cs | 33 - .../src/Generated/CassandraTableData.cs | 7 +- .../src/Generated/CassandraTableResource.cs | 24 +- ...CassandraTableThroughputSettingResource.cs | 28 +- .../CassandraViewGetResultCollection.cs | 492 --- ...assandraViewGetResultData.Serialization.cs | 436 --- .../Generated/CassandraViewGetResultData.cs | 94 - ...ndraViewGetResultResource.Serialization.cs | 26 - .../CassandraViewGetResultResource.cs | 715 ----- ...ThroughputSettingResource.Serialization.cs | 26 - .../CassandraViewThroughputSettingResource.cs | 792 ----- .../Generated/CosmosDBAccountCollection.cs | 20 +- .../CosmosDBAccountData.Serialization.cs | 271 +- .../src/Generated/CosmosDBAccountData.cs | 75 +- .../src/Generated/CosmosDBAccountResource.cs | 383 +-- .../Generated/CosmosDBLocationCollection.cs | 16 +- .../src/Generated/CosmosDBLocationResource.cs | 8 +- ...osDBPrivateEndpointConnectionCollection.cs | 20 +- ...smosDBPrivateEndpointConnectionResource.cs | 12 +- .../Generated/CosmosDBPrivateLinkResource.cs | 4 +- .../CosmosDBPrivateLinkResourceCollection.cs | 16 +- .../Generated/CosmosDBServiceCollection.cs | 20 +- .../src/Generated/CosmosDBServiceResource.cs | 12 +- ...osmosDBSqlClientEncryptionKeyCollection.cs | 20 +- .../CosmosDBSqlClientEncryptionKeyResource.cs | 8 +- .../CosmosDBSqlContainerCollection.cs | 20 +- .../CosmosDBSqlContainerData.Serialization.cs | 33 - .../src/Generated/CosmosDBSqlContainerData.cs | 7 +- .../Generated/CosmosDBSqlContainerResource.cs | 132 +- ...DBSqlContainerThroughputSettingResource.cs | 212 +- .../CosmosDBSqlDatabaseCollection.cs | 20 +- .../CosmosDBSqlDatabaseData.Serialization.cs | 33 - .../src/Generated/CosmosDBSqlDatabaseData.cs | 7 +- .../Generated/CosmosDBSqlDatabaseResource.cs | 212 +- ...sDBSqlDatabaseThroughputSettingResource.cs | 212 +- .../CosmosDBSqlRoleAssignmentCollection.cs | 20 +- .../CosmosDBSqlRoleAssignmentResource.cs | 12 +- .../CosmosDBSqlRoleDefinitionCollection.cs | 20 +- .../CosmosDBSqlRoleDefinitionResource.cs | 12 +- .../CosmosDBSqlStoredProcedureCollection.cs | 20 +- ...sDBSqlStoredProcedureData.Serialization.cs | 33 - .../CosmosDBSqlStoredProcedureData.cs | 7 +- .../CosmosDBSqlStoredProcedureResource.cs | 24 +- .../Generated/CosmosDBSqlTriggerCollection.cs | 20 +- .../CosmosDBSqlTriggerData.Serialization.cs | 33 - .../src/Generated/CosmosDBSqlTriggerData.cs | 7 +- .../Generated/CosmosDBSqlTriggerResource.cs | 24 +- ...osmosDBSqlUserDefinedFunctionCollection.cs | 20 +- ...qlUserDefinedFunctionData.Serialization.cs | 33 - .../CosmosDBSqlUserDefinedFunctionData.cs | 7 +- .../CosmosDBSqlUserDefinedFunctionResource.cs | 24 +- .../src/Generated/CosmosDBTableCollection.cs | 20 +- .../CosmosDBTableData.Serialization.cs | 33 - .../src/Generated/CosmosDBTableData.cs | 7 +- .../src/Generated/CosmosDBTableResource.cs | 28 +- ...CosmosDBThroughputPoolAccountCollection.cs | 498 --- ...ThroughputPoolAccountData.Serialization.cs | 383 --- .../CosmosDBThroughputPoolAccountData.cs | 91 - ...ughputPoolAccountResource.Serialization.cs | 26 - .../CosmosDBThroughputPoolAccountResource.cs | 347 --- .../CosmosDBThroughputPoolCollection.cs | 499 --- ...osmosDBThroughputPoolData.Serialization.cs | 403 --- .../Generated/CosmosDBThroughputPoolData.cs | 89 - ...sDBThroughputPoolResource.Serialization.cs | 26 - .../CosmosDBThroughputPoolResource.cs | 417 --- .../CosmosTableThroughputSettingResource.cs | 28 +- .../DataTransferJobGetResultCollection.cs | 498 --- ...aTransferJobGetResultData.Serialization.cs | 606 ---- .../Generated/DataTransferJobGetResultData.cs | 142 - ...nsferJobGetResultResource.Serialization.cs | 26 - .../DataTransferJobGetResultResource.cs | 572 ---- .../Extensions/CosmosDBExtensions.cs | 350 +-- .../Extensions/MockableCosmosDBArmClient.cs | 108 +- .../MockableCosmosDBResourceGroupResource.cs | 77 +- .../MockableCosmosDBSubscriptionResource.cs | 80 +- .../MockableCosmosDBTenantResource.cs | 4 +- .../GraphResourceGetResultCollection.cs | 492 --- ...raphResourceGetResultData.Serialization.cs | 442 --- .../Generated/GraphResourceGetResultData.cs | 107 - ...ResourceGetResultResource.Serialization.cs | 26 - .../GraphResourceGetResultResource.cs | 707 ----- .../Generated/GremlinDatabaseCollection.cs | 20 +- .../GremlinDatabaseData.Serialization.cs | 33 - .../src/Generated/GremlinDatabaseData.cs | 7 +- .../src/Generated/GremlinDatabaseResource.cs | 28 +- ...remlinDatabaseThroughputSettingResource.cs | 28 +- .../src/Generated/GremlinGraphCollection.cs | 20 +- .../GremlinGraphData.Serialization.cs | 33 - .../src/Generated/GremlinGraphData.cs | 7 +- .../src/Generated/GremlinGraphResource.cs | 28 +- .../GremlinGraphThroughputSettingResource.cs | 28 +- ...eyspaceThroughputSettingOperationSource.cs | 1 - ...raTableThroughputSettingOperationSource.cs | 1 - .../CassandraViewGetResultOperationSource.cs | 38 - ...draViewThroughputSettingOperationSource.cs | 38 - ...ntainerThroughputSettingOperationSource.cs | 1 - ...atabaseThroughputSettingOperationSource.cs | 1 - ...sDBThroughputPoolAccountOperationSource.cs | 38 - .../CosmosDBThroughputPoolOperationSource.cs | 38 - ...osTableThroughputSettingOperationSource.cs | 1 - .../GraphResourceGetResultOperationSource.cs | 38 - ...atabaseThroughputSettingOperationSource.cs | 1 - ...inGraphThroughputSettingOperationSource.cs | 1 - ...lectionThroughputSettingOperationSource.cs | 1 - ...atabaseThroughputSettingOperationSource.cs | 1 - ...ionStorageInfoCollectionOperationSource.cs | 30 - ...tionThroughputInfoResultOperationSource.cs | 30 - .../Models/AccessRule.Serialization.cs | 193 -- .../Generated/Models/AccessRuleDirection.cs | 51 - .../AccessRuleProperties.Serialization.cs | 509 ---- .../Generated/Models/AccessRuleProperties.cs | 103 - .../src/Generated/Models/ApiProperties.cs | 4 +- ...ataTransferDataSourceSink.Serialization.cs | 210 -- .../AzureBlobDataTransferDataSourceSink.cs | 51 - ...ataTransferDataSourceSink.Serialization.cs | 192 -- .../BaseCosmosDataTransferDataSourceSink.cs | 40 - .../src/Generated/Models/CapacityMode.cs | 54 - ...ModeChangeTransitionState.Serialization.cs | 319 -- .../CapacityModeChangeTransitionState.cs | 91 - .../Models/CapacityModeTransitionStatus.cs | 60 - .../Models/CassandraAutoReplicateForm.cs | 54 - ...ClusterBackupResourceInfo.Serialization.cs | 292 -- .../CassandraClusterBackupResourceInfo.cs | 86 - ...ndraClusterBackupSchedule.Serialization.cs | 227 -- .../Models/CassandraClusterBackupState.cs | 57 - .../CassandraClusterCommand.Serialization.cs | 470 --- .../Models/CassandraClusterCommand.cs | 140 - .../Models/CassandraClusterCommandStatus.cs | 63 - ...ClusterDataCenterNodeItem.Serialization.cs | 32 - .../CassandraClusterDataCenterNodeItem.cs | 7 +- ...assandraClusterProperties.Serialization.cs | 266 -- .../Models/CassandraClusterProperties.cs | 39 +- .../Generated/Models/CassandraClusterType.cs | 51 - .../CassandraCommandPostBody.Serialization.cs | 14 +- .../Models/CassandraCommandPostBody.cs | 10 +- ...paceCreateOrUpdateContent.Serialization.cs | 33 - .../CassandraKeyspaceCreateOrUpdateContent.cs | 7 +- ...ableCreateOrUpdateContent.Serialization.cs | 33 - .../CassandraTableCreateOrUpdateContent.cs | 7 +- ...aViewGetPropertiesOptions.Serialization.cs | 192 -- .../CassandraViewGetPropertiesOptions.cs | 29 - ...ViewGetPropertiesResource.Serialization.cs | 291 -- .../CassandraViewGetPropertiesResource.cs | 55 - ...sultCreateOrUpdateContent.Serialization.cs | 428 --- ...andraViewGetResultCreateOrUpdateContent.cs | 95 - .../CassandraViewListResult.Serialization.cs | 178 -- .../CassandraViewResource.Serialization.cs | 191 -- .../Generated/Models/CassandraViewResource.cs | 84 - .../Models/ContinuousModeBackupPolicy.cs | 2 +- .../Models/ContinuousModeProperties.cs | 4 +- ...ataTransferDataSourceSink.Serialization.cs | 245 -- ...smosCassandraDataTransferDataSourceSink.cs | 55 - ...ountCreateOrUpdateContent.Serialization.cs | 240 +- .../CosmosDBAccountCreateOrUpdateContent.cs | 70 +- .../CosmosDBAccountPatch.Serialization.cs | 118 +- .../Generated/Models/CosmosDBAccountPatch.cs | 60 +- ...BAccountRestoreParameters.Serialization.cs | 37 +- .../CosmosDBAccountRestoreParameters.cs | 7 +- .../CosmosDBErrorResult.Serialization.cs | 197 -- .../Models/CosmosDBMinimalTlsVersion.cs | 2 +- .../Generated/Models/CosmosDBServerVersion.cs | 5 +- ...inerCreateOrUpdateContent.Serialization.cs | 33 - ...smosDBSqlContainerCreateOrUpdateContent.cs | 7 +- ...BSqlContainerResourceInfo.Serialization.cs | 31 - .../CosmosDBSqlContainerResourceInfo.cs | 7 +- ...baseCreateOrUpdateContent.Serialization.cs | 33 - ...osmosDBSqlDatabaseCreateOrUpdateContent.cs | 7 +- ...dureCreateOrUpdateContent.Serialization.cs | 33 - ...SqlStoredProcedureCreateOrUpdateContent.cs | 7 +- ...ggerCreateOrUpdateContent.Serialization.cs | 33 - ...CosmosDBSqlTriggerCreateOrUpdateContent.cs | 7 +- ...tionCreateOrUpdateContent.Serialization.cs | 33 - ...serDefinedFunctionCreateOrUpdateContent.cs | 7 +- .../src/Generated/Models/CosmosDBStatus.cs | 12 - ...ableCreateOrUpdateContent.Serialization.cs | 33 - .../CosmosDBTableCreateOrUpdateContent.cs | 7 +- ...smosDBThroughputPoolPatch.Serialization.cs | 156 - ...ataTransferDataSourceSink.Serialization.cs | 245 -- .../CosmosMongoDataTransferDataSourceSink.cs | 55 - ...ataTransferDataSourceSink.Serialization.cs | 245 -- .../CosmosSqlDataTransferDataSourceSink.cs | 55 - .../Generated/Models/DataTransferComponent.cs | 57 - ...ataTransferDataSourceSink.Serialization.cs | 145 - .../Models/DataTransferDataSourceSink.cs | 69 - ...ataTransferJobFeedResults.Serialization.cs | 212 -- .../Models/DataTransferJobFeedResults.cs | 70 - ...sultCreateOrUpdateContent.Serialization.cs | 260 -- ...ansferJobGetResultCreateOrUpdateContent.cs | 82 - .../Generated/Models/DataTransferJobMode.cs | 51 - ...DataTransferJobProperties.Serialization.cs | 467 --- .../Models/DataTransferJobProperties.cs | 153 - .../Generated/Models/DefaultPriorityLevel.cs | 51 - .../DiagnosticLogSettings.Serialization.cs | 159 - .../EnableFullTextQuery.Serialization.cs | 30 - .../Generated/Models/EnableFullTextQuery.cs | 20 - ...BSqlContainerResourceInfo.Serialization.cs | 31 - ...xtendedCosmosDBSqlContainerResourceInfo.cs | 3 +- ...ourceGetPropertiesOptions.Serialization.cs | 192 -- .../GraphResourceGetPropertiesOptions.cs | 29 - ...sultCreateOrUpdateContent.Serialization.cs | 434 --- ...hResourceGetResultCreateOrUpdateContent.cs | 108 - .../GraphResourcesListResult.Serialization.cs | 178 -- .../Models/GraphResourcesListResult.cs | 66 - ...baseCreateOrUpdateContent.Serialization.cs | 33 - .../GremlinDatabaseCreateOrUpdateContent.cs | 7 +- ...raphCreateOrUpdateContent.Serialization.cs | 33 - .../GremlinGraphCreateOrUpdateContent.cs | 7 +- .../src/Generated/Models/IssueType.cs | 57 - .../Models/ListBackups.Serialization.cs | 178 -- .../Models/ListCommands.Serialization.cs | 178 -- ...aterializedViewDefinition.Serialization.cs | 225 -- .../Models/MaterializedViewDefinition.cs | 89 - ...tionCreateOrUpdateContent.Serialization.cs | 33 - .../MongoDBCollectionCreateOrUpdateContent.cs | 7 +- ...baseCreateOrUpdateContent.Serialization.cs | 33 - .../MongoDBDatabaseCreateOrUpdateContent.cs | 7 +- .../NetworkSecurityPerimeter.Serialization.cs | 219 -- ...erConfigurationListResult.Serialization.cs | 208 -- ...erConfigurationProperties.Serialization.cs | 304 -- ...ecurityPerimeterConfigurationProperties.cs | 87 - ...PerimeterConfigurationProvisioningState.cs | 66 - .../NetworkSecurityProfile.Serialization.cs | 339 --- .../Models/NetworkSecurityProfile.cs | 88 - ...sicalPartitionStorageInfo.Serialization.cs | 193 -- ...tionStorageInfoCollection.Serialization.cs | 178 -- .../PhysicalPartitionStorageInfoCollection.cs | 67 - ...nThroughputInfoProperties.Serialization.cs | 178 -- ...ysicalPartitionThroughputInfoProperties.cs | 67 - ...ionThroughputInfoResource.Serialization.cs | 190 -- ...itionThroughputInfoResult.Serialization.cs | 409 --- .../PhysicalPartitionThroughputInfoResult.cs | 96 - ...oResultPropertiesResource.Serialization.cs | 178 -- ...nThroughputInfoResultPropertiesResource.cs | 28 - .../Models/ProvisioningIssue.Serialization.cs | 193 -- .../src/Generated/Models/ProvisioningIssue.cs | 71 - ...ovisioningIssueProperties.Serialization.cs | 343 --- .../Models/ProvisioningIssueProperties.cs | 89 - ...ibuteThroughputParameters.Serialization.cs | 397 --- .../RedistributeThroughputParameters.cs | 90 - ...oughputPropertiesResource.Serialization.cs | 232 -- ...edistributeThroughputPropertiesResource.cs | 92 - .../ResourceAssociation.Serialization.cs | 193 -- .../Models/ResourceAssociationAccessMode.cs | 54 - ...opertiesResourceContainer.Serialization.cs | 31 - ...SqlContainerPropertiesResourceContainer.cs | 3 +- ...rieveThroughputParameters.Serialization.cs | 402 --- .../Models/RetrieveThroughputParameters.cs | 98 - ...oughputPropertiesResource.Serialization.cs | 172 -- .../Models/ScheduledEventStrategy.cs | 54 - .../src/Generated/Models/Severity.cs | 51 - .../Generated/Models/ThroughputPolicyType.cs | 54 - ...putPoolAccountsListResult.Serialization.cs | 212 -- ...ThroughputPoolsListResult.Serialization.cs | 212 -- ...oughputSettingsUpdateData.Serialization.cs | 33 - .../Models/ThroughputSettingsUpdateData.cs | 7 +- .../UnknownDataTransferDataSourceSink.cs | 29 - .../Generated/MongoDBCollectionCollection.cs | 20 +- .../MongoDBCollectionData.Serialization.cs | 33 - .../src/Generated/MongoDBCollectionData.cs | 7 +- .../Generated/MongoDBCollectionResource.cs | 120 +- ...goDBCollectionThroughputSettingResource.cs | 212 +- .../Generated/MongoDBDatabaseCollection.cs | 20 +- .../MongoDBDatabaseData.Serialization.cs | 33 - .../src/Generated/MongoDBDatabaseData.cs | 7 +- .../src/Generated/MongoDBDatabaseResource.cs | 120 +- ...ongoDBDatabaseThroughputSettingResource.cs | 212 +- .../MongoDBRoleDefinitionCollection.cs | 20 +- .../MongoDBRoleDefinitionResource.cs | 12 +- .../MongoDBUserDefinitionCollection.cs | 20 +- .../MongoDBUserDefinitionResource.cs | 12 +- ...ecurityPerimeterConfigurationCollection.cs | 395 --- ...erimeterConfigurationData.Serialization.cs | 268 -- ...eterConfigurationResource.Serialization.cs | 26 - ...kSecurityPerimeterConfigurationResource.cs | 255 -- .../CassandraClustersRestOperations.cs | 448 +-- .../CassandraDataCentersRestOperations.cs | 22 +- .../CassandraResourcesRestOperations.cs | 917 +----- ...CollectionPartitionRegionRestOperations.cs | 6 +- .../CollectionPartitionRestOperations.cs | 10 +- .../CollectionRegionRestOperations.cs | 6 +- .../CollectionRestOperations.cs | 14 +- .../DataTransferJobsRestOperations.cs | 837 ------ .../DatabaseAccountRegionRestOperations.cs | 6 +- .../DatabaseAccountsRestOperations.cs | 66 +- .../RestOperations/DatabaseRestOperations.cs | 14 +- .../GraphResourcesRestOperations.cs | 430 --- .../GremlinResourcesRestOperations.cs | 70 +- .../RestOperations/LocationsRestOperations.cs | 10 +- .../MongoDBResourcesRestOperations.cs | 738 +---- ...tyPerimeterConfigurationsRestOperations.cs | 413 --- ...PartitionKeyRangeIdRegionRestOperations.cs | 6 +- .../PartitionKeyRangeIdRestOperations.cs | 6 +- .../PercentileRestOperations.cs | 6 +- .../PercentileSourceTargetRestOperations.cs | 6 +- .../PercentileTargetRestOperations.cs | 6 +- ...rivateEndpointConnectionsRestOperations.cs | 18 +- .../PrivateLinkResourcesRestOperations.cs | 10 +- ...estorableDatabaseAccountsRestOperations.cs | 14 +- ...estorableGremlinDatabasesRestOperations.cs | 6 +- .../RestorableGremlinGraphsRestOperations.cs | 6 +- ...estorableGremlinResourcesRestOperations.cs | 6 +- ...torableMongodbCollectionsRestOperations.cs | 6 +- ...estorableMongodbDatabasesRestOperations.cs | 6 +- ...estorableMongodbResourcesRestOperations.cs | 6 +- .../RestorableSqlContainersRestOperations.cs | 6 +- .../RestorableSqlDatabasesRestOperations.cs | 6 +- .../RestorableSqlResourcesRestOperations.cs | 6 +- .../RestorableTableResourcesRestOperations.cs | 6 +- .../RestorableTablesRestOperations.cs | 6 +- .../RestOperations/ServiceRestOperations.cs | 18 +- .../SqlResourcesRestOperations.cs | 1048 ++----- .../TableResourcesRestOperations.cs | 38 +- .../ThroughputPoolAccountRestOperations.cs | 334 -- .../ThroughputPoolAccountsRestOperations.cs | 217 -- .../ThroughputPoolRestOperations.cs | 403 --- .../ThroughputPoolsRestOperations.cs | 359 --- .../RestorableCosmosDBAccountCollection.cs | 16 +- ...orableCosmosDBAccountData.Serialization.cs | 42 +- .../RestorableCosmosDBAccountData.cs | 12 +- .../RestorableCosmosDBAccountResource.cs | 48 +- .../ThroughputSettingData.Serialization.cs | 33 - .../src/Generated/ThroughputSettingData.cs | 7 +- .../src/autorest.md | 2 +- .../tsp-location.yaml | 7 +- ...ing.EventGrid.Namespaces.netstandard2.0.cs | 142 +- ...g.EventGrid.SystemEvents.netstandard2.0.cs | 558 ++-- ...atMessageDeletedEventData.Serialization.cs | 26 +- .../AcsChatMessageDeletedEventData.cs | 10 +- ...eDeletedInThreadEventData.Serialization.cs | 26 +- .../AcsChatMessageDeletedInThreadEventData.cs | 10 +- ...hatMessageEditedEventData.Serialization.cs | 26 +- .../AcsChatMessageEditedEventData.cs | 9 +- ...geEditedInThreadEventData.Serialization.cs | 26 +- .../AcsChatMessageEditedInThreadEventData.cs | 9 +- ...essageEventBaseProperties.Serialization.cs | 13 +- .../AcsChatMessageEventBaseProperties.cs | 8 +- ...entInThreadBaseProperties.Serialization.cs | 13 +- ...sChatMessageEventInThreadBaseProperties.cs | 8 +- ...tMessageReceivedEventData.Serialization.cs | 13 +- .../AcsChatMessageReceivedEventData.cs | 5 +- ...ReceivedInThreadEventData.Serialization.cs | 13 +- ...AcsChatMessageReceivedInThreadEventData.cs | 5 +- ...antAddedToThreadEventData.Serialization.cs | 13 +- ...csChatParticipantAddedToThreadEventData.cs | 8 +- ...ToThreadWithUserEventData.Serialization.cs | 26 +- ...rticipantAddedToThreadWithUserEventData.cs | 9 +- ...emovedFromThreadEventData.Serialization.cs | 13 +- ...atParticipantRemovedFromThreadEventData.cs | 8 +- ...omThreadWithUserEventData.Serialization.cs | 26 +- ...ipantRemovedFromThreadWithUserEventData.cs | 9 +- ...hatThreadCreatedEventData.Serialization.cs | 13 +- .../AcsChatThreadCreatedEventData.cs | 5 +- ...dCreatedWithUserEventData.Serialization.cs | 13 +- .../AcsChatThreadCreatedWithUserEventData.cs | 5 +- ...hatThreadDeletedEventData.Serialization.cs | 26 +- .../AcsChatThreadDeletedEventData.cs | 9 +- ...ThreadEventBaseProperties.Serialization.cs | 13 +- .../AcsChatThreadEventBaseProperties.cs | 9 +- ...entInThreadBaseProperties.Serialization.cs | 13 +- ...csChatThreadEventInThreadBaseProperties.cs | 13 +- ...ropertiesUpdatedEventData.Serialization.cs | 26 +- ...AcsChatThreadPropertiesUpdatedEventData.cs | 9 +- ...esUpdatedPerUserEventData.Serialization.cs | 26 +- ...ThreadPropertiesUpdatedPerUserEventData.cs | 9 +- ...dWithUserDeletedEventData.Serialization.cs | 26 +- .../AcsChatThreadWithUserDeletedEventData.cs | 9 +- ...ryReportReceivedEventData.Serialization.cs | 32 +- ...AcsEmailDeliveryReportReceivedEventData.cs | 12 +- ...ngReportReceivedEventData.Serialization.cs | 32 +- ...gagementTrackingReportReceivedEventData.cs | 17 +- ...eryStatusUpdatedEventData.Serialization.cs | 39 +- ...csMessageDeliveryStatusUpdatedEventData.cs | 14 +- .../AcsMessageEventData.Serialization.cs | 13 +- .../src/Generated/AcsMessageEventData.cs | 8 +- ...MessageInteractiveContent.Serialization.cs | 13 +- .../Generated/AcsMessageInteractiveContent.cs | 8 +- ...sMessageReceivedEventData.Serialization.cs | 13 +- .../Generated/AcsMessageReceivedEventData.cs | 5 +- ...ileStatusUpdatedEventData.Serialization.cs | 52 +- .../AcsRecordingFileStatusUpdatedEventData.cs | 20 +- ...outerJobReceivedEventData.Serialization.cs | 26 +- .../AcsRouterJobReceivedEventData.cs | 12 +- ...SchedulingFailedEventData.Serialization.cs | 13 +- .../AcsRouterJobSchedulingFailedEventData.cs | 8 +- ...ingForActivationEventData.Serialization.cs | 13 +- ...sRouterJobWaitingForActivationEventData.cs | 8 +- ...orkerOfferIssuedEventData.Serialization.cs | 26 +- .../AcsRouterWorkerOfferIssuedEventData.cs | 12 +- .../AcsRouterWorkerSelector.Serialization.cs | 39 +- .../src/Generated/AcsRouterWorkerSelector.cs | 16 +- ...DeliveryAttemptProperties.Serialization.cs | 13 +- .../AcsSmsDeliveryAttemptProperties.cs | 13 +- ...ryReportReceivedEventData.Serialization.cs | 13 +- .../AcsSmsDeliveryReportReceivedEventData.cs | 8 +- .../AcsSmsReceivedEventData.Serialization.cs | 13 +- .../src/Generated/AcsSmsReceivedEventData.cs | 13 +- .../AppEventTypeDetail.Serialization.cs | 13 +- .../src/Generated/AppEventTypeDetail.cs | 13 +- ...ervicePlanEventTypeDetail.Serialization.cs | 39 +- .../AppServicePlanEventTypeDetail.cs | 21 +- ...municationIdentifierModel.Serialization.cs | 13 +- .../Generated/CommunicationIdentifierModel.cs | 8 +- ...RegistryArtifactEventData.Serialization.cs | 13 +- .../ContainerRegistryArtifactEventData.cs | 8 +- ...stryChartDeletedEventData.Serialization.cs | 13 +- .../ContainerRegistryChartDeletedEventData.cs | 5 +- ...istryChartPushedEventData.Serialization.cs | 13 +- .../ContainerRegistryChartPushedEventData.cs | 5 +- ...ontainerRegistryEventData.Serialization.cs | 13 +- .../Generated/ContainerRegistryEventData.cs | 8 +- ...stryImageDeletedEventData.Serialization.cs | 13 +- .../ContainerRegistryImageDeletedEventData.cs | 5 +- ...istryImagePushedEventData.Serialization.cs | 13 +- .../ContainerRegistryImagePushedEventData.cs | 5 +- ...BoxCopyCompletedEventData.Serialization.cs | 26 +- .../DataBoxCopyCompletedEventData.cs | 17 +- ...taBoxCopyStartedEventData.Serialization.cs | 26 +- .../Generated/DataBoxCopyStartedEventData.cs | 17 +- ...oxOrderCompletedEventData.Serialization.cs | 26 +- .../DataBoxOrderCompletedEventData.cs | 17 +- ...reatedOrUpdatedEventData.Serialization.cs} | 83 +- ...ridMqttClientCreatedOrUpdatedEventData.cs} | 30 +- ...ttClientDeletedEventData.Serialization.cs} | 42 +- ...=> EventGridMqttClientDeletedEventData.cs} | 10 +- ...EventGridMqttClientDisconnectionReason.cs} | 44 +- ...tGridMqttClientEventData.Serialization.cs} | 42 +- ...ata.cs => EventGridMqttClientEventData.cs} | 10 +- ...essionConnectedEventData.Serialization.cs} | 42 +- ...ridMqttClientSessionConnectedEventData.cs} | 10 +- ...ionDisconnectedEventData.Serialization.cs} | 57 +- ...MqttClientSessionDisconnectedEventData.cs} | 22 +- ...ntState.cs => EventGridMqttClientState.cs} | 26 +- .../EventGridSystemEventsModelFactory.cs | 234 +- ...ptureFileCreatedEventData.Serialization.cs | 26 +- .../EventHubCaptureFileCreatedEventData.cs | 17 +- ...rResourceCreatedEventData.Serialization.cs | 13 +- .../HealthcareFhirResourceCreatedEventData.cs | 13 +- ...rResourceDeletedEventData.Serialization.cs | 13 +- .../HealthcareFhirResourceDeletedEventData.cs | 13 +- ...rResourceUpdatedEventData.Serialization.cs | 13 +- .../HealthcareFhirResourceUpdatedEventData.cs | 13 +- ...setDriftDetectedEventData.Serialization.cs | 26 +- ...ngServicesDatasetDriftDetectedEventData.cs | 17 +- ...MediaJobCanceledEventData.Serialization.cs | 26 +- .../Generated/MediaJobCanceledEventData.cs | 6 +- ...ediaJobCancelingEventData.Serialization.cs | 26 +- .../Generated/MediaJobCancelingEventData.cs | 6 +- .../Generated/MediaJobError.Serialization.cs | 39 +- .../src/Generated/MediaJobError.cs | 16 +- .../MediaJobErroredEventData.Serialization.cs | 26 +- .../src/Generated/MediaJobErroredEventData.cs | 6 +- ...MediaJobFinishedEventData.Serialization.cs | 26 +- .../Generated/MediaJobFinishedEventData.cs | 6 +- .../Generated/MediaJobOutput.Serialization.cs | 7 +- .../src/Generated/MediaJobOutput.cs | 8 +- .../MediaJobOutputAsset.Serialization.cs | 13 +- .../src/Generated/MediaJobOutputAsset.cs | 5 +- ...obOutputCanceledEventData.Serialization.cs | 13 +- .../MediaJobOutputCanceledEventData.cs | 5 +- ...bOutputCancelingEventData.Serialization.cs | 13 +- .../MediaJobOutputCancelingEventData.cs | 5 +- ...JobOutputErroredEventData.Serialization.cs | 13 +- .../MediaJobOutputErroredEventData.cs | 5 +- ...obOutputFinishedEventData.Serialization.cs | 13 +- .../MediaJobOutputFinishedEventData.cs | 5 +- ...OutputProcessingEventData.Serialization.cs | 13 +- .../MediaJobOutputProcessingEventData.cs | 5 +- ...bOutputScheduledEventData.Serialization.cs | 13 +- .../MediaJobOutputScheduledEventData.cs | 5 +- ...utputStateChangeEventData.Serialization.cs | 13 +- .../MediaJobOutputStateChangeEventData.cs | 8 +- ...diaJobProcessingEventData.Serialization.cs | 26 +- .../Generated/MediaJobProcessingEventData.cs | 6 +- ...ediaJobScheduledEventData.Serialization.cs | 26 +- .../Generated/MediaJobScheduledEventData.cs | 6 +- ...iaJobStateChangeEventData.Serialization.cs | 26 +- .../Generated/MediaJobStateChangeEventData.cs | 12 +- ...ftTeamsAppIdentifierModel.Serialization.cs | 13 +- .../MicrosoftTeamsAppIdentifierModel.cs | 8 +- ...tTeamsUserIdentifierModel.Serialization.cs | 13 +- .../MicrosoftTeamsUserIdentifierModel.cs | 8 +- ...licyStateChangedEventData.Serialization.cs | 13 +- ...licyInsightsPolicyStateChangedEventData.cs | 13 +- ...licyStateCreatedEventData.Serialization.cs | 13 +- ...licyInsightsPolicyStateCreatedEventData.cs | 13 +- ...licyStateDeletedEventData.Serialization.cs | 13 +- ...licyInsightsPolicyStateDeletedEventData.cs | 13 +- ...ortRdbCompletedEventData.Serialization.cs} | 55 +- ...cs => RedisExportRdbCompletedEventData.cs} | 19 +- ...ortRdbCompletedEventData.Serialization.cs} | 55 +- ...cs => RedisImportRdbCompletedEventData.cs} | 19 +- ...atchingCompletedEventData.Serialization.cs | 13 +- .../RedisPatchingCompletedEventData.cs | 13 +- ...ScalingCompletedEventData.Serialization.cs | 13 +- .../RedisScalingCompletedEventData.cs | 13 +- ...cationsOperationalDetails.Serialization.cs | 13 +- ...ResourceNotificationsOperationalDetails.cs | 13 +- ...nectionConnectedEventData.Serialization.cs | 13 +- ...rviceClientConnectionConnectedEventData.cs | 13 +- ...tionDisconnectedEventData.Serialization.cs | 13 +- ...ceClientConnectionDisconnectedEventData.cs | 13 +- .../src/Generated/StorageBlobAccessTier.cs | 60 + ...orageBlobCreatedEventData.Serialization.cs | 9 + .../Generated/StorageBlobCreatedEventData.cs | 10 +- ...yPolicyCompletedEventData.Serialization.cs | 13 +- ...geBlobInventoryPolicyCompletedEventData.cs | 13 +- ...eBlobTierChangedEventData.Serialization.cs | 18 + .../StorageBlobTierChangedEventData.cs | 16 +- ...ignmentCompletedEventData.Serialization.cs | 26 +- ...StorageTaskAssignmentCompletedEventData.cs | 12 +- ...AssignmentQueuedEventData.Serialization.cs | 13 +- .../StorageTaskAssignmentQueuedEventData.cs | 13 +- ...ageTaskCompletedEventData.Serialization.cs | 26 +- .../StorageTaskCompletedEventData.cs | 12 +- ...torageTaskQueuedEventData.Serialization.cs | 13 +- .../Generated/StorageTaskQueuedEventData.cs | 13 +- .../Generated/SystemEventsClientOptions.cs | 8 +- .../UnknownMediaJobOutput.Serialization.cs | 13 +- .../src/Generated/UnknownMediaJobOutput.cs | 2 +- .../tsp-location.yaml | 5 +- .../Azure.Messaging.EventGrid.Namespaces.sln | 54 + .../Azure.Messaging.EventGridV2/CHANGELOG.md | 11 + .../Directory.Build.props | 6 + .../Azure.Messaging.EventGridV2/README.md | 107 + ...ing.EventGrid.Namespaces.netstandard2.0.cs | 126 + ...zure.Messaging.EventGrid.Namespaces.csproj | 20 + .../AcknowledgeRequest.Serialization.cs | 145 + .../src/Generated/AcknowledgeRequest.cs} | 39 +- .../AcknowledgeResult.Serialization.cs | 163 + .../src/Generated/AcknowledgeResult.cs | 83 + ...ssagingEventGridNamespacesClientOptions.cs | 40 + .../BrokerProperties.Serialization.cs | 143 + .../src/Generated/BrokerProperties.cs | 81 + .../src/Generated/CloudEvent.Serialization.cs | 255 ++ .../src/Generated/CloudEvent.cs | 164 + .../src/Generated/EventGridReceiverClient.cs | 840 ++++++ .../src/Generated/EventGridSenderClient.cs | 375 +++ .../FailedLockToken.Serialization.cs} | 81 +- .../src/Generated/FailedLockToken.cs | 82 + .../src/Generated/Internal/Argument.cs | 129 + .../Internal/ChangeTrackingDictionary.cs | 167 + .../Generated/Internal/ChangeTrackingList.cs | 153 + .../Internal/ModelSerializationExtensions.cs | 398 +++ .../src/Generated/Internal/Optional.cs | 51 + .../Internal/RequestContentHelper.cs | 136 + .../Internal/Utf8JsonRequestContent.cs | 55 + ...ntGridNamespacesClientBuilderExtensions.cs | 73 + ...essagingEventGridNamespacesModelFactory.cs | 73 + .../Generated/PublishResult.Serialization.cs | 127 + .../src/Generated/PublishResult.cs} | 21 +- .../Generated/ReceiveDetails.Serialization.cs | 143 + .../src/Generated/ReceiveDetails.cs | 82 + .../Generated/ReceiveResult.Serialization.cs | 145 + .../src/Generated/ReceiveResult.cs} | 36 +- .../Generated/RejectRequest.Serialization.cs | 145 + .../src/Generated/RejectRequest.cs} | 39 +- .../Generated/RejectResult.Serialization.cs | 163 + .../src/Generated/RejectResult.cs | 83 + .../src/Generated/ReleaseDelay.cs | 60 + .../Generated/ReleaseRequest.Serialization.cs | 145 + .../src/Generated/ReleaseRequest.cs} | 39 +- .../Generated/ReleaseResult.Serialization.cs | 163 + .../src/Generated/ReleaseResult.cs | 83 + .../RenewLocksRequest.Serialization.cs | 145 + .../src/Generated/RenewLocksRequest.cs} | 34 +- .../RenewLocksResult.Serialization.cs | 163 + .../src/Generated/RenewLocksResult.cs | 83 + .../src/Properties/AssemblyInfo.cs | 11 + .../tsp-location.yaml | 4 + .../FabricCapacitiesRestOperations.cs | 4 + .../tsp-location.yaml | 3 +- .../tsp-location.yaml | 7 +- ...Communication.ProgrammableConnectivity.sln | 56 + .../CHANGELOG.md | 11 + .../Directory.Build.props | 6 + .../README.md | 107 + ...ProgrammableConnectivity.netstandard2.0.cs | 241 ++ ...munication.ProgrammableConnectivity.csproj | 19 + ...ableConnectivityClientBuilderExtensions.cs | 35 + ...ionProgrammableConnectivityModelFactory.cs | 87 + .../src/Generated/DeviceLocation.cs | 199 ++ ...cationVerificationContent.Serialization.cs | 173 ++ .../DeviceLocationVerificationContent.cs | 100 + ...ocationVerificationResult.Serialization.cs | 135 + .../DeviceLocationVerificationResult.cs} | 30 +- .../src/Generated/DeviceNetwork.cs | 199 ++ .../src/Generated/Docs/DeviceLocation.xml | 185 ++ .../src/Generated/Docs/DeviceNetwork.xml | 117 + .../src/Generated/Docs/NumberVerification.xml | 249 ++ .../src/Generated/Docs/SimSwap.xml | 273 ++ .../src/Generated/Internal/Argument.cs | 129 + .../Internal/ChangeTrackingDictionary.cs | 167 + .../Generated/Internal/ChangeTrackingList.cs | 153 + .../Internal/ModelSerializationExtensions.cs | 398 +++ .../src/Generated/Internal/Optional.cs | 51 + .../Internal/Utf8JsonRequestContent.cs | 55 + .../Generated/Ipv4Address.Serialization.cs | 143 + .../src/Generated/Ipv4Address.cs} | 46 +- .../Generated/Ipv6Address.Serialization.cs | 143 + .../src/Generated/Ipv6Address.cs | 81 + .../Generated/LocationDevice.Serialization.cs | 179 ++ .../src/Generated/LocationDevice.cs | 77 + .../NetworkIdentifier.Serialization.cs | 143 + .../src/Generated/NetworkIdentifier.cs | 91 + .../NetworkRetrievalResult.Serialization.cs | 135 + .../src/Generated/NetworkRetrievalResult.cs} | 43 +- .../src/Generated/NumberVerification.cs | 347 +++ .../NumberVerificationResult.Serialization.cs | 135 + .../Generated/NumberVerificationResult.cs} | 35 +- ...rificationWithCodeContent.Serialization.cs | 135 + .../NumberVerificationWithCodeContent.cs | 75 + ...icationWithoutCodeContent.Serialization.cs | 165 + .../NumberVerificationWithoutCodeContent.cs | 90 + .../ProgrammableConnectivityClient.cs | 99 + .../ProgrammableConnectivityClientOptions.cs | 37 + .../src/Generated/SimSwap.cs | 332 ++ .../SimSwapRetrievalContent.Serialization.cs | 146 + .../src/Generated/SimSwapRetrievalContent.cs | 79 + .../SimSwapRetrievalResult.Serialization.cs | 142 + .../src/Generated/SimSwapRetrievalResult.cs} | 23 +- ...imSwapVerificationContent.Serialization.cs | 161 + .../Generated/SimSwapVerificationContent.cs | 83 + ...SimSwapVerificationResult.Serialization.cs | 135 + .../Generated/SimSwapVerificationResult.cs | 72 + .../src/Properties/AssemblyInfo.cs | 11 + ...tion.ProgrammableConnectivity.Tests.csproj | 20 + .../Samples/Samples_DeviceLocation.cs | 211 ++ .../Samples/Samples_DeviceNetwork.cs | 143 + .../Samples/Samples_NumberVerification.cs | 287 ++ .../Generated/Samples/Samples_SimSwap.cs | 311 ++ .../tsp-location.yaml | 4 + sdk/programmableconnectivity/ci.yml | 35 + 805 files changed, 36534 insertions(+), 43720 deletions(-) create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/Microsoft.VoiceServices.Provisioning.sln create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AccountResource.Serialization.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AccountResource.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AccountServiceDetails.Serialization.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AccountServiceDetails.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Accounts.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AzureOperatorCallProtectionAccountDetails.Serialization.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AzureOperatorCallProtectionAccountDetails.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AzureOperatorCallProtectionNumberDetails.Serialization.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AzureOperatorCallProtectionNumberDetails.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/BatchNumbers.Serialization.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/BatchNumbers.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/BatchNumbersDelete.Serialization.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/BatchNumbersDelete.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ContactDetails.Serialization.cs rename sdk/{cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupSchedule.cs => 2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ContactDetails.cs} (54%) create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/CustomerRelationship.Serialization.cs rename sdk/{cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBThroughputPoolPatch.cs => 2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/CustomerRelationship.cs} (61%) create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Docs/Accounts.xml create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Docs/TeamsRequestsForInformation.xml create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Docs/VoiceServicesClient.xml create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/Argument.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/ChangeTrackingDictionary.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/ChangeTrackingList.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/ModelSerializationExtensions.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/Optional.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/Utf8JsonRequestContent.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Location.Serialization.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Location.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/MicrosoftVoiceServicesProvisioningClientBuilderExtensions.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/MicrosoftVoiceServicesProvisioningModelFactory.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberConfiguration.Serialization.cs rename sdk/{cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationListResult.cs => 2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberConfiguration.cs} (61%) create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberIdentifier.Serialization.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberIdentifier.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberIdentifiers.Serialization.cs rename sdk/{cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeter.cs => 2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberIdentifiers.cs} (58%) create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberResource.Serialization.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberResource.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberServiceDetails.Serialization.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberServiceDetails.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/RequestForInformationResource.Serialization.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/RequestForInformationResource.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ServiceProvisioningStatus.cs rename sdk/{cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownDataTransferDataSourceSink.Serialization.cs => 2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsAvailableCapabilities.Serialization.cs} (50%) rename sdk/{cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolsListResult.cs => 2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsAvailableCapabilities.cs} (63%) create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCapabilityPlan.Serialization.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCapabilityPlan.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCapabilityPlans.Serialization.cs rename sdk/{cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewListResult.cs => 2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCapabilityPlans.cs} (66%) create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCivicAddressResource.Serialization.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCivicAddressResource.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsConsentStatus.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingAccountConfig.Serialization.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingAccountConfig.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingAccountDetails.Serialization.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingAccountDetails.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingNumberDetails.Serialization.cs rename sdk/{cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolAccountsListResult.cs => 2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingNumberDetails.cs} (61%) create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingSubdomainProvisioningStatus.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingSubdomainTokens.Serialization.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingSubdomainTokens.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectAccountDetails.Serialization.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectAccountDetails.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectNumberConfig.Serialization.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectNumberConfig.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectNumberDetails.Serialization.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectNumberDetails.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileAccountDetails.Serialization.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileAccountDetails.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileNumberConfig.Serialization.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileNumberConfig.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileNumberDetails.Serialization.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileNumberDetails.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsRequestsForInformation.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TelephoneNumberAssignmentStatus.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ValidationStatus.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/VoiceServicesClient.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/VoiceServicesClientOptions.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ZoomPhoneCloudPeeringAccountDetails.Serialization.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ZoomPhoneCloudPeeringAccountDetails.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ZoomPhoneCloudPeeringNumberDetails.Serialization.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ZoomPhoneCloudPeeringNumberDetails.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Microsoft.VoiceServices.Provisioning.csproj create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Properties/AssemblyInfo.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/tests/Generated/Samples/Samples_Accounts.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/tests/Generated/Samples/Samples_TeamsRequestsForInformation.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/tests/Generated/Samples/Samples_VoiceServicesClient.cs create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/tests/Microsoft.VoiceServices.Provisioning.Tests.csproj create mode 100644 sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/tsp-location.yaml delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewGetResultCollection.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewGetResultResource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewThroughputSettingResource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolAccountCollection.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolAccountResource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolCollection.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolResource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_DataTransferJobGetResultCollection.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_DataTransferJobGetResultResource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GraphResourceGetResultCollection.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GraphResourceGetResultResource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationCollection.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationResource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultCollection.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultData.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultData.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultResource.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultResource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewThroughputSettingResource.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewThroughputSettingResource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountCollection.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountData.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountData.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountResource.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountResource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolCollection.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolData.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolData.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolResource.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolResource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultCollection.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultData.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultData.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultResource.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultResource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultCollection.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultData.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultData.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultResource.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultResource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraViewGetResultOperationSource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraViewThroughputSettingOperationSource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBThroughputPoolAccountOperationSource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBThroughputPoolOperationSource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GraphResourceGetResultOperationSource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/PhysicalPartitionStorageInfoCollectionOperationSource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/PhysicalPartitionThroughputInfoResultOperationSource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRule.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRuleDirection.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRuleProperties.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRuleProperties.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AzureBlobDataTransferDataSourceSink.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AzureBlobDataTransferDataSourceSink.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BaseCosmosDataTransferDataSourceSink.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BaseCosmosDataTransferDataSourceSink.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityMode.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityModeChangeTransitionState.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityModeChangeTransitionState.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityModeTransitionStatus.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraAutoReplicateForm.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupResourceInfo.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupResourceInfo.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupSchedule.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupState.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterCommand.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterCommand.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterCommandStatus.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterType.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesOptions.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesOptions.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesResource.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesResource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetResultCreateOrUpdateContent.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetResultCreateOrUpdateContent.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewListResult.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewResource.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewResource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosCassandraDataTransferDataSourceSink.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosCassandraDataTransferDataSourceSink.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBErrorResult.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBThroughputPoolPatch.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosMongoDataTransferDataSourceSink.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosMongoDataTransferDataSourceSink.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosSqlDataTransferDataSourceSink.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosSqlDataTransferDataSourceSink.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferComponent.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferDataSourceSink.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferDataSourceSink.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobFeedResults.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobFeedResults.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobGetResultCreateOrUpdateContent.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobGetResultCreateOrUpdateContent.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobMode.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobProperties.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobProperties.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DefaultPriorityLevel.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DiagnosticLogSettings.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/EnableFullTextQuery.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/EnableFullTextQuery.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetPropertiesOptions.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetPropertiesOptions.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetResultCreateOrUpdateContent.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetResultCreateOrUpdateContent.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourcesListResult.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourcesListResult.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/IssueType.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListBackups.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListCommands.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewDefinition.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewDefinition.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeter.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationListResult.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationProperties.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationProperties.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationProvisioningState.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityProfile.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityProfile.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfo.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfoCollection.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfoCollection.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoProperties.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoProperties.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResource.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResult.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResult.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResultPropertiesResource.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResultPropertiesResource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssue.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssue.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssueProperties.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssueProperties.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputParameters.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputParameters.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputPropertiesResource.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputPropertiesResource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceAssociation.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceAssociationAccessMode.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputParameters.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputParameters.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputPropertiesResource.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ScheduledEventStrategy.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Severity.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPolicyType.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolAccountsListResult.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolsListResult.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownDataTransferDataSourceSink.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationData.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationResource.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DataTransferJobsRestOperations.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/GraphResourcesRestOperations.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationsRestOperations.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolAccountRestOperations.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolAccountsRestOperations.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolRestOperations.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolsRestOperations.cs rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{EventGridMQTTClientCreatedOrUpdatedEventData.Serialization.cs => EventGridMqttClientCreatedOrUpdatedEventData.Serialization.cs} (72%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{EventGridMQTTClientCreatedOrUpdatedEventData.cs => EventGridMqttClientCreatedOrUpdatedEventData.cs} (66%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{EventGridMQTTClientDeletedEventData.Serialization.cs => EventGridMqttClientDeletedEventData.Serialization.cs} (77%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{EventGridMQTTClientDeletedEventData.cs => EventGridMqttClientDeletedEventData.cs} (81%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{EventGridMQTTClientDisconnectionReason.cs => EventGridMqttClientDisconnectionReason.cs} (64%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{EventGridMQTTClientEventData.Serialization.cs => EventGridMqttClientEventData.Serialization.cs} (78%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{EventGridMQTTClientEventData.cs => EventGridMqttClientEventData.cs} (93%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{EventGridMQTTClientSessionConnectedEventData.Serialization.cs => EventGridMqttClientSessionConnectedEventData.Serialization.cs} (81%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{EventGridMQTTClientSessionConnectedEventData.cs => EventGridMqttClientSessionConnectedEventData.cs} (88%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{EventGridMQTTClientSessionDisconnectedEventData.Serialization.cs => EventGridMqttClientSessionDisconnectedEventData.Serialization.cs} (77%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{EventGridMQTTClientSessionDisconnectedEventData.cs => EventGridMqttClientSessionDisconnectedEventData.cs} (72%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{EventGridMQTTClientState.cs => EventGridMqttClientState.cs} (59%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{RedisExportRDBCompletedEventData.Serialization.cs => RedisExportRdbCompletedEventData.Serialization.cs} (72%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{RedisExportRDBCompletedEventData.cs => RedisExportRdbCompletedEventData.cs} (78%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{RedisImportRDBCompletedEventData.Serialization.cs => RedisImportRdbCompletedEventData.Serialization.cs} (72%) rename sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/{RedisImportRDBCompletedEventData.cs => RedisImportRdbCompletedEventData.cs} (78%) create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobAccessTier.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/Azure.Messaging.EventGrid.Namespaces.sln create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/CHANGELOG.md create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/Directory.Build.props create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/README.md create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/api/Azure.Messaging.EventGrid.Namespaces.netstandard2.0.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Azure.Messaging.EventGrid.Namespaces.csproj create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/AcknowledgeRequest.Serialization.cs rename sdk/{cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRule.cs => eventgrid/Azure.Messaging.EventGridV2/src/Generated/AcknowledgeRequest.cs} (63%) create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/AcknowledgeResult.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/AcknowledgeResult.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/AzureMessagingEventGridNamespacesClientOptions.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/BrokerProperties.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/BrokerProperties.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/CloudEvent.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/CloudEvent.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/EventGridReceiverClient.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/EventGridSenderClient.cs rename sdk/{cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MergeParameters.Serialization.cs => eventgrid/Azure.Messaging.EventGridV2/src/Generated/FailedLockToken.Serialization.cs} (52%) create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/FailedLockToken.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/Argument.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/ChangeTrackingDictionary.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/ChangeTrackingList.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/ModelSerializationExtensions.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/Optional.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/RequestContentHelper.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/Utf8JsonRequestContent.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/MessagingEventGridNamespacesClientBuilderExtensions.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/MessagingEventGridNamespacesModelFactory.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/PublishResult.Serialization.cs rename sdk/{cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListCommands.cs => eventgrid/Azure.Messaging.EventGridV2/src/Generated/PublishResult.cs} (68%) create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReceiveDetails.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReceiveDetails.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReceiveResult.Serialization.cs rename sdk/{cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputPropertiesResource.cs => eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReceiveResult.cs} (60%) create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RejectRequest.Serialization.cs rename sdk/{cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceAssociation.cs => eventgrid/Azure.Messaging.EventGridV2/src/Generated/RejectRequest.cs} (64%) create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RejectResult.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RejectResult.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReleaseDelay.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReleaseRequest.Serialization.cs rename sdk/{cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBErrorResult.cs => eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReleaseRequest.cs} (62%) create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReleaseResult.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReleaseResult.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RenewLocksRequest.Serialization.cs rename sdk/{cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListBackups.cs => eventgrid/Azure.Messaging.EventGridV2/src/Generated/RenewLocksRequest.cs} (59%) create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RenewLocksResult.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RenewLocksResult.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/src/Properties/AssemblyInfo.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGridV2/tsp-location.yaml create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/Azure.Communication.ProgrammableConnectivity.sln create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/CHANGELOG.md create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/Directory.Build.props create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/README.md create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/api/Azure.Communication.ProgrammableConnectivity.netstandard2.0.cs create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Azure.Communication.ProgrammableConnectivity.csproj create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/CommunicationProgrammableConnectivityClientBuilderExtensions.cs create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/CommunicationProgrammableConnectivityModelFactory.cs create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/DeviceLocation.cs create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/DeviceLocationVerificationContent.Serialization.cs create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/DeviceLocationVerificationContent.cs create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/DeviceLocationVerificationResult.Serialization.cs rename sdk/{cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DiagnosticLogSettings.cs => programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/DeviceLocationVerificationResult.cs} (62%) create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/DeviceNetwork.cs create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Docs/DeviceLocation.xml create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Docs/DeviceNetwork.xml create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Docs/NumberVerification.xml create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Docs/SimSwap.xml create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Internal/Argument.cs create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Internal/ChangeTrackingDictionary.cs create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Internal/ChangeTrackingList.cs create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Internal/ModelSerializationExtensions.cs create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Internal/Optional.cs create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Internal/Utf8JsonRequestContent.cs create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Ipv4Address.Serialization.cs rename sdk/{cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResource.cs => programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Ipv4Address.cs} (56%) create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Ipv6Address.Serialization.cs create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Ipv6Address.cs create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/LocationDevice.Serialization.cs create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/LocationDevice.cs create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NetworkIdentifier.Serialization.cs create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NetworkIdentifier.cs create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NetworkRetrievalResult.Serialization.cs rename sdk/{cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationData.cs => programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NetworkRetrievalResult.cs} (57%) create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NumberVerification.cs create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NumberVerificationResult.Serialization.cs rename sdk/{cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfo.cs => programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NumberVerificationResult.cs} (58%) create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NumberVerificationWithCodeContent.Serialization.cs create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NumberVerificationWithCodeContent.cs create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NumberVerificationWithoutCodeContent.Serialization.cs create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NumberVerificationWithoutCodeContent.cs create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/ProgrammableConnectivityClient.cs create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/ProgrammableConnectivityClientOptions.cs create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/SimSwap.cs create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/SimSwapRetrievalContent.Serialization.cs create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/SimSwapRetrievalContent.cs create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/SimSwapRetrievalResult.Serialization.cs rename sdk/{cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MergeParameters.cs => programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/SimSwapRetrievalResult.cs} (68%) create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/SimSwapVerificationContent.Serialization.cs create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/SimSwapVerificationContent.cs create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/SimSwapVerificationResult.Serialization.cs create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/SimSwapVerificationResult.cs create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Properties/AssemblyInfo.cs create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/tests/Azure.Communication.ProgrammableConnectivity.Tests.csproj create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/tests/Generated/Samples/Samples_DeviceLocation.cs create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/tests/Generated/Samples/Samples_DeviceNetwork.cs create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/tests/Generated/Samples/Samples_NumberVerification.cs create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/tests/Generated/Samples/Samples_SimSwap.cs create mode 100644 sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/tsp-location.yaml create mode 100644 sdk/programmableconnectivity/ci.yml diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/Microsoft.VoiceServices.Provisioning.sln b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/Microsoft.VoiceServices.Provisioning.sln new file mode 100644 index 000000000000..ea653dd6b539 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/Microsoft.VoiceServices.Provisioning.sln @@ -0,0 +1,50 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.VoiceServices.Provisioning", "src\Microsoft.VoiceServices.Provisioning.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.VoiceServices.Provisioning.Tests", "tests\Microsoft.VoiceServices.Provisioning.Tests.csproj", "{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AccountResource.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AccountResource.Serialization.cs new file mode 100644 index 000000000000..7f8f899e06cc --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AccountResource.Serialization.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class AccountResource : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AccountResource)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(ServiceProvisioningStatus)) + { + writer.WritePropertyName("serviceProvisioningStatus"u8); + writer.WriteStringValue(ServiceProvisioningStatus.Value.ToString()); + } + if (options.Format != "W" && Optional.IsCollectionDefined(ServiceProvisioningErrors)) + { + writer.WritePropertyName("serviceProvisioningErrors"u8); + writer.WriteStartArray(); + foreach (var item in ServiceProvisioningErrors) + { + JsonSerializer.Serialize(writer, item); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsDefined(CorrelationId)) + { + writer.WritePropertyName("correlationId"u8); + writer.WriteStringValue(CorrelationId); + } + if (Optional.IsDefined(ServiceDetails)) + { + writer.WritePropertyName("serviceDetails"u8); + writer.WriteObjectValue(ServiceDetails, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + AccountResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AccountResource)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAccountResource(document.RootElement, options); + } + + internal static AccountResource DeserializeAccountResource(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ServiceProvisioningStatus? serviceProvisioningStatus = default; + IReadOnlyList serviceProvisioningErrors = default; + string name = default; + string correlationId = default; + AccountServiceDetails serviceDetails = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("serviceProvisioningStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serviceProvisioningStatus = new ServiceProvisioningStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("serviceProvisioningErrors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + serviceProvisioningErrors = array; + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("correlationId"u8)) + { + correlationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("serviceDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serviceDetails = AccountServiceDetails.DeserializeAccountServiceDetails(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AccountResource( + serviceProvisioningStatus, + serviceProvisioningErrors ?? new ChangeTrackingList(), + name, + correlationId, + serviceDetails, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AccountResource)} does not support writing '{options.Format}' format."); + } + } + + AccountResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAccountResource(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AccountResource)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AccountResource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAccountResource(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AccountResource.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AccountResource.cs new file mode 100644 index 000000000000..dddd960e8051 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AccountResource.cs @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// An account represents a group of numbers, typically associated with an enterprise. + public partial class AccountResource + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Name of the account. + /// is null. + public AccountResource(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + ServiceProvisioningErrors = new ChangeTrackingList(); + Name = name; + } + + /// Initializes a new instance of . + /// The status of the provisioning action associated with this resource. + /// Any errors pertaining to the provisioning of this resource. + /// Name of the account. + /// A user defined identifier used for correlating with external systems. + /// The details of the account. + /// Keeps track of any properties unknown to the library. + internal AccountResource(ServiceProvisioningStatus? serviceProvisioningStatus, IReadOnlyList serviceProvisioningErrors, string name, string correlationId, AccountServiceDetails serviceDetails, IDictionary serializedAdditionalRawData) + { + ServiceProvisioningStatus = serviceProvisioningStatus; + ServiceProvisioningErrors = serviceProvisioningErrors; + Name = name; + CorrelationId = correlationId; + ServiceDetails = serviceDetails; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AccountResource() + { + } + + /// The status of the provisioning action associated with this resource. + public ServiceProvisioningStatus? ServiceProvisioningStatus { get; } + /// Any errors pertaining to the provisioning of this resource. + public IReadOnlyList ServiceProvisioningErrors { get; } + /// Name of the account. + public string Name { get; set; } + /// A user defined identifier used for correlating with external systems. + public string CorrelationId { get; set; } + /// The details of the account. + public AccountServiceDetails ServiceDetails { get; set; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AccountServiceDetails.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AccountServiceDetails.Serialization.cs new file mode 100644 index 000000000000..75ab8aa1bd65 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AccountServiceDetails.Serialization.cs @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class AccountServiceDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AccountServiceDetails)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(TeamsTenantId)) + { + writer.WritePropertyName("teamsTenantId"u8); + writer.WriteStringValue(TeamsTenantId); + } + if (Optional.IsDefined(TeamsOperatorConnect)) + { + writer.WritePropertyName("teamsOperatorConnect"u8); + writer.WriteObjectValue(TeamsOperatorConnect, options); + } + if (Optional.IsDefined(TeamsDirectRouting)) + { + writer.WritePropertyName("teamsDirectRouting"u8); + writer.WriteObjectValue(TeamsDirectRouting, options); + } + if (Optional.IsDefined(TeamsPhoneMobile)) + { + writer.WritePropertyName("teamsPhoneMobile"u8); + writer.WriteObjectValue(TeamsPhoneMobile, options); + } + if (Optional.IsDefined(ZoomPhoneCloudPeering)) + { + writer.WritePropertyName("zoomPhoneCloudPeering"u8); + writer.WriteObjectValue(ZoomPhoneCloudPeering, options); + } + if (Optional.IsDefined(AzureOperatorCallProtection)) + { + writer.WritePropertyName("azureOperatorCallProtection"u8); + writer.WriteObjectValue(AzureOperatorCallProtection, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + AccountServiceDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AccountServiceDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAccountServiceDetails(document.RootElement, options); + } + + internal static AccountServiceDetails DeserializeAccountServiceDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string teamsTenantId = default; + TeamsOperatorConnectAccountDetails teamsOperatorConnect = default; + TeamsDirectRoutingAccountDetails teamsDirectRouting = default; + TeamsPhoneMobileAccountDetails teamsPhoneMobile = default; + ZoomPhoneCloudPeeringAccountDetails zoomPhoneCloudPeering = default; + AzureOperatorCallProtectionAccountDetails azureOperatorCallProtection = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("teamsTenantId"u8)) + { + teamsTenantId = property.Value.GetString(); + continue; + } + if (property.NameEquals("teamsOperatorConnect"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + teamsOperatorConnect = TeamsOperatorConnectAccountDetails.DeserializeTeamsOperatorConnectAccountDetails(property.Value, options); + continue; + } + if (property.NameEquals("teamsDirectRouting"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + teamsDirectRouting = TeamsDirectRoutingAccountDetails.DeserializeTeamsDirectRoutingAccountDetails(property.Value, options); + continue; + } + if (property.NameEquals("teamsPhoneMobile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + teamsPhoneMobile = TeamsPhoneMobileAccountDetails.DeserializeTeamsPhoneMobileAccountDetails(property.Value, options); + continue; + } + if (property.NameEquals("zoomPhoneCloudPeering"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + zoomPhoneCloudPeering = ZoomPhoneCloudPeeringAccountDetails.DeserializeZoomPhoneCloudPeeringAccountDetails(property.Value, options); + continue; + } + if (property.NameEquals("azureOperatorCallProtection"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureOperatorCallProtection = AzureOperatorCallProtectionAccountDetails.DeserializeAzureOperatorCallProtectionAccountDetails(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AccountServiceDetails( + teamsTenantId, + teamsOperatorConnect, + teamsDirectRouting, + teamsPhoneMobile, + zoomPhoneCloudPeering, + azureOperatorCallProtection, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AccountServiceDetails)} does not support writing '{options.Format}' format."); + } + } + + AccountServiceDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAccountServiceDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AccountServiceDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AccountServiceDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAccountServiceDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AccountServiceDetails.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AccountServiceDetails.cs new file mode 100644 index 000000000000..bb7b248c3374 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AccountServiceDetails.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// Details of the backend services associated with this Account. + public partial class AccountServiceDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public AccountServiceDetails() + { + } + + /// Initializes a new instance of . + /// The Microsoft Teams Tenant ID of the Account. This can only be updated if no Operator Connect or Teams Phone Mobile numbers are configured in this account. + /// Details for the Teams Operator Connect service on this Account. + /// Details for the Teams Direct Routing service on this Account. + /// Details for the Teams Phone Mobile service on this Account. + /// Details for the Zoom Phone Cloud Peering service on this Account. + /// Details for the Azure Operator Call Protection service on this Account. + /// Keeps track of any properties unknown to the library. + internal AccountServiceDetails(string teamsTenantId, TeamsOperatorConnectAccountDetails teamsOperatorConnect, TeamsDirectRoutingAccountDetails teamsDirectRouting, TeamsPhoneMobileAccountDetails teamsPhoneMobile, ZoomPhoneCloudPeeringAccountDetails zoomPhoneCloudPeering, AzureOperatorCallProtectionAccountDetails azureOperatorCallProtection, IDictionary serializedAdditionalRawData) + { + TeamsTenantId = teamsTenantId; + TeamsOperatorConnect = teamsOperatorConnect; + TeamsDirectRouting = teamsDirectRouting; + TeamsPhoneMobile = teamsPhoneMobile; + ZoomPhoneCloudPeering = zoomPhoneCloudPeering; + AzureOperatorCallProtection = azureOperatorCallProtection; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The Microsoft Teams Tenant ID of the Account. This can only be updated if no Operator Connect or Teams Phone Mobile numbers are configured in this account. + public string TeamsTenantId { get; set; } + /// Details for the Teams Operator Connect service on this Account. + public TeamsOperatorConnectAccountDetails TeamsOperatorConnect { get; set; } + /// Details for the Teams Direct Routing service on this Account. + public TeamsDirectRoutingAccountDetails TeamsDirectRouting { get; set; } + /// Details for the Teams Phone Mobile service on this Account. + public TeamsPhoneMobileAccountDetails TeamsPhoneMobile { get; set; } + /// Details for the Zoom Phone Cloud Peering service on this Account. + public ZoomPhoneCloudPeeringAccountDetails ZoomPhoneCloudPeering { get; set; } + /// Details for the Azure Operator Call Protection service on this Account. + public AzureOperatorCallProtectionAccountDetails AzureOperatorCallProtection { get; set; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Accounts.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Accounts.cs new file mode 100644 index 000000000000..902a7a63468b --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Accounts.cs @@ -0,0 +1,2036 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Microsoft.VoiceServices.Provisioning +{ + // Data plane generated sub-client. + /// The Accounts sub-client. + public partial class Accounts + { + private static readonly string[] AuthorizationScopes = new string[] { "https://func-voiceservice-rp-prod-eastuseuap.azurewebsites.net/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of Accounts for mocking. + protected Accounts() + { + } + + /// Initializes a new instance of Accounts. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The token credential to copy. + /// The to use. + /// The API version to use for this operation. + internal Accounts(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, TokenCredential tokenCredential, Uri endpoint, string apiVersion) + { + ClientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + _tokenCredential = tokenCredential; + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + /// Get Account. + /// Name of the account. + /// The content to send as the request conditions of the request. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Get details of a specific Account using its Name. An Account represents an Enterprise or collection of users. + /// + public virtual async Task> GetAccountResourceAsync(string accountName, RequestConditions requestConditions = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetAccountResourceAsync(accountName, requestConditions, context).ConfigureAwait(false); + return Response.FromValue(AccountResource.FromResponse(response), response); + } + + /// Get Account. + /// Name of the account. + /// The content to send as the request conditions of the request. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Get details of a specific Account using its Name. An Account represents an Enterprise or collection of users. + /// + public virtual Response GetAccountResource(string accountName, RequestConditions requestConditions = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetAccountResource(accountName, requestConditions, context); + return Response.FromValue(AccountResource.FromResponse(response), response); + } + + /// + /// [Protocol Method] Get Account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetAccountResourceAsync(string accountName, RequestConditions requestConditions, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.GetAccountResource"); + scope.Start(); + try + { + using HttpMessage message = CreateGetAccountResourceRequest(accountName, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Get Account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetAccountResource(string accountName, RequestConditions requestConditions, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.GetAccountResource"); + scope.Start(); + try + { + using HttpMessage message = CreateGetAccountResourceRequest(accountName, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Create or Replace Account. + /// Name of the account. + /// The resource instance. + /// The content to send as the request conditions of the request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Create or replace the details of an Account. + /// + public virtual async Task> CreateOrReplaceAsync(string accountName, AccountResource resource, RequestConditions requestConditions = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNull(resource, nameof(resource)); + + using RequestContent content = resource.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await CreateOrReplaceAsync(accountName, content, requestConditions, context).ConfigureAwait(false); + return Response.FromValue(AccountResource.FromResponse(response), response); + } + + /// Create or Replace Account. + /// Name of the account. + /// The resource instance. + /// The content to send as the request conditions of the request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Create or replace the details of an Account. + /// + public virtual Response CreateOrReplace(string accountName, AccountResource resource, RequestConditions requestConditions = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNull(resource, nameof(resource)); + + using RequestContent content = resource.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = CreateOrReplace(accountName, content, requestConditions, context); + return Response.FromValue(AccountResource.FromResponse(response), response); + } + + /// + /// [Protocol Method] Create or Replace Account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// The content to send as the body of the request. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task CreateOrReplaceAsync(string accountName, RequestContent content, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.CreateOrReplace"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrReplaceRequest(accountName, content, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Create or Replace Account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// The content to send as the body of the request. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response CreateOrReplace(string accountName, RequestContent content, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.CreateOrReplace"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrReplaceRequest(accountName, content, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Delete Account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Name of the account. + /// Whether to delete the child Number resources of the Account, defaults to false. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task DeleteAsync(string accountName, bool? deleteNumbers = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.Delete"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteRequest(accountName, deleteNumbers, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Delete Account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Name of the account. + /// Whether to delete the child Number resources of the Account, defaults to false. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Delete(string accountName, bool? deleteNumbers = null, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.Delete"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteRequest(accountName, deleteNumbers, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Create or update Numbers. + /// Name of the account. + /// Batch of numbers to create or replace. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Create or update up to 100 Numbers on the specified account. + /// + public virtual async Task> CreateOrUpdateNumbersAsync(string accountName, BatchNumbers body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await CreateOrUpdateNumbersAsync(accountName, content, context).ConfigureAwait(false); + return Response.FromValue(BatchNumbers.FromResponse(response), response); + } + + /// Create or update Numbers. + /// Name of the account. + /// Batch of numbers to create or replace. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Create or update up to 100 Numbers on the specified account. + /// + public virtual Response CreateOrUpdateNumbers(string accountName, BatchNumbers body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = CreateOrUpdateNumbers(accountName, content, context); + return Response.FromValue(BatchNumbers.FromResponse(response), response); + } + + /// + /// [Protocol Method] Create or update Numbers. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task CreateOrUpdateNumbersAsync(string accountName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.CreateOrUpdateNumbers"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrUpdateNumbersRequest(accountName, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Create or update Numbers. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response CreateOrUpdateNumbers(string accountName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.CreateOrUpdateNumbers"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrUpdateNumbersRequest(accountName, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Delete Numbers. + /// Name of the account. + /// Batch numbers to delete. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Delete up to 100 Numbers on the specified account. + /// + public virtual async Task DeleteNumbersAsync(string accountName, BatchNumbersDelete body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await DeleteNumbersAsync(accountName, content, context).ConfigureAwait(false); + return response; + } + + /// Delete Numbers. + /// Name of the account. + /// Batch numbers to delete. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Delete up to 100 Numbers on the specified account. + /// + public virtual Response DeleteNumbers(string accountName, BatchNumbersDelete body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = DeleteNumbers(accountName, content, context); + return response; + } + + /// + /// [Protocol Method] Delete Numbers. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task DeleteNumbersAsync(string accountName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.DeleteNumbers"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteNumbersRequest(accountName, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Delete Numbers. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response DeleteNumbers(string accountName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.DeleteNumbers"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteNumbersRequest(accountName, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Get Number. + /// Name of the account. + /// Telephone number in E.164 format. + /// The content to send as the request conditions of the request. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Get details of a specific Number using its telephone number. + /// + public virtual async Task> GetNumberAsync(string accountName, string telephoneNumber, RequestConditions requestConditions = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(telephoneNumber, nameof(telephoneNumber)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetNumberAsync(accountName, telephoneNumber, requestConditions, context).ConfigureAwait(false); + return Response.FromValue(NumberResource.FromResponse(response), response); + } + + /// Get Number. + /// Name of the account. + /// Telephone number in E.164 format. + /// The content to send as the request conditions of the request. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Get details of a specific Number using its telephone number. + /// + public virtual Response GetNumber(string accountName, string telephoneNumber, RequestConditions requestConditions = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(telephoneNumber, nameof(telephoneNumber)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetNumber(accountName, telephoneNumber, requestConditions, context); + return Response.FromValue(NumberResource.FromResponse(response), response); + } + + /// + /// [Protocol Method] Get Number. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// Telephone number in E.164 format. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetNumberAsync(string accountName, string telephoneNumber, RequestConditions requestConditions, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(telephoneNumber, nameof(telephoneNumber)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.GetNumber"); + scope.Start(); + try + { + using HttpMessage message = CreateGetNumberRequest(accountName, telephoneNumber, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Get Number. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// Telephone number in E.164 format. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetNumber(string accountName, string telephoneNumber, RequestConditions requestConditions, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(telephoneNumber, nameof(telephoneNumber)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.GetNumber"); + scope.Start(); + try + { + using HttpMessage message = CreateGetNumberRequest(accountName, telephoneNumber, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Create or replace Number. + /// Name of the account. + /// Telephone number in E.164 format. + /// The resource instance. + /// The content to send as the request conditions of the request. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Create or replace the details of a Number. + /// + public virtual async Task> CreateOrReplaceNumberAsync(string accountName, string telephoneNumber, NumberResource resource, RequestConditions requestConditions = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(telephoneNumber, nameof(telephoneNumber)); + Argument.AssertNotNull(resource, nameof(resource)); + + using RequestContent content = resource.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await CreateOrReplaceNumberAsync(accountName, telephoneNumber, content, requestConditions, context).ConfigureAwait(false); + return Response.FromValue(NumberResource.FromResponse(response), response); + } + + /// Create or replace Number. + /// Name of the account. + /// Telephone number in E.164 format. + /// The resource instance. + /// The content to send as the request conditions of the request. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Create or replace the details of a Number. + /// + public virtual Response CreateOrReplaceNumber(string accountName, string telephoneNumber, NumberResource resource, RequestConditions requestConditions = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(telephoneNumber, nameof(telephoneNumber)); + Argument.AssertNotNull(resource, nameof(resource)); + + using RequestContent content = resource.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = CreateOrReplaceNumber(accountName, telephoneNumber, content, requestConditions, context); + return Response.FromValue(NumberResource.FromResponse(response), response); + } + + /// + /// [Protocol Method] Create or replace Number. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// Telephone number in E.164 format. + /// The content to send as the body of the request. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task CreateOrReplaceNumberAsync(string accountName, string telephoneNumber, RequestContent content, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(telephoneNumber, nameof(telephoneNumber)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.CreateOrReplaceNumber"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrReplaceNumberRequest(accountName, telephoneNumber, content, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Create or replace Number. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// Telephone number in E.164 format. + /// The content to send as the body of the request. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response CreateOrReplaceNumber(string accountName, string telephoneNumber, RequestContent content, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(telephoneNumber, nameof(telephoneNumber)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.CreateOrReplaceNumber"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrReplaceNumberRequest(accountName, telephoneNumber, content, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Delete Number. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Name of the account. + /// Telephone number in E.164 format. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task DeleteNumberAsync(string accountName, string telephoneNumber, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(telephoneNumber, nameof(telephoneNumber)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.DeleteNumber"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteNumberRequest(accountName, telephoneNumber, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Delete Number. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Name of the account. + /// Telephone number in E.164 format. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response DeleteNumber(string accountName, string telephoneNumber, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(telephoneNumber, nameof(telephoneNumber)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.DeleteNumber"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteNumberRequest(accountName, telephoneNumber, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Get Teams Usages. + /// Name of the account. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Get a list of Teams capability plans on the specified account. + /// + public virtual async Task> GetTeamsCapabilityPlansAsync(string accountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetTeamsCapabilityPlansAsync(accountName, context).ConfigureAwait(false); + return Response.FromValue(TeamsCapabilityPlans.FromResponse(response), response); + } + + /// Get Teams Usages. + /// Name of the account. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Get a list of Teams capability plans on the specified account. + /// + public virtual Response GetTeamsCapabilityPlans(string accountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetTeamsCapabilityPlans(accountName, context); + return Response.FromValue(TeamsCapabilityPlans.FromResponse(response), response); + } + + /// + /// [Protocol Method] Get Teams Usages. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetTeamsCapabilityPlansAsync(string accountName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.GetTeamsCapabilityPlans"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTeamsCapabilityPlansRequest(accountName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Get Teams Usages. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetTeamsCapabilityPlans(string accountName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.GetTeamsCapabilityPlans"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTeamsCapabilityPlansRequest(accountName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Get Teams Available Capabilities. + /// Name of the account. + /// List identifiers for a Number resource. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Get a list of Teams Available Capabilities on the specified account. + /// + public virtual async Task> GetTeamsAvailableCapabilitiesAsync(string accountName, NumberIdentifiers body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetTeamsAvailableCapabilitiesAsync(accountName, content, context).ConfigureAwait(false); + return Response.FromValue(TeamsAvailableCapabilities.FromResponse(response), response); + } + + /// Get Teams Available Capabilities. + /// Name of the account. + /// List identifiers for a Number resource. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Get a list of Teams Available Capabilities on the specified account. + /// + public virtual Response GetTeamsAvailableCapabilities(string accountName, NumberIdentifiers body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetTeamsAvailableCapabilities(accountName, content, context); + return Response.FromValue(TeamsAvailableCapabilities.FromResponse(response), response); + } + + /// + /// [Protocol Method] Get Teams Available Capabilities. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetTeamsAvailableCapabilitiesAsync(string accountName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.GetTeamsAvailableCapabilities"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTeamsAvailableCapabilitiesRequest(accountName, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Get Teams Available Capabilities. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetTeamsAvailableCapabilities(string accountName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.GetTeamsAvailableCapabilities"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTeamsAvailableCapabilitiesRequest(accountName, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Get Teams Civic Address. + /// Name of the account. + /// The ID of the civic address. + /// The content to send as the request conditions of the request. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Get details of a specific Teams Civic Address using its ID. + /// + public virtual async Task> GetTeamsCivicAddressAsync(string accountName, string civicAddressId, RequestConditions requestConditions = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(civicAddressId, nameof(civicAddressId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetTeamsCivicAddressAsync(accountName, civicAddressId, requestConditions, context).ConfigureAwait(false); + return Response.FromValue(TeamsCivicAddressResource.FromResponse(response), response); + } + + /// Get Teams Civic Address. + /// Name of the account. + /// The ID of the civic address. + /// The content to send as the request conditions of the request. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Get details of a specific Teams Civic Address using its ID. + /// + public virtual Response GetTeamsCivicAddress(string accountName, string civicAddressId, RequestConditions requestConditions = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(civicAddressId, nameof(civicAddressId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetTeamsCivicAddress(accountName, civicAddressId, requestConditions, context); + return Response.FromValue(TeamsCivicAddressResource.FromResponse(response), response); + } + + /// + /// [Protocol Method] Get Teams Civic Address. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// The ID of the civic address. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetTeamsCivicAddressAsync(string accountName, string civicAddressId, RequestConditions requestConditions, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(civicAddressId, nameof(civicAddressId)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.GetTeamsCivicAddress"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTeamsCivicAddressRequest(accountName, civicAddressId, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Get Teams Civic Address. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// The ID of the civic address. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetTeamsCivicAddress(string accountName, string civicAddressId, RequestConditions requestConditions, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(civicAddressId, nameof(civicAddressId)); + + using var scope = ClientDiagnostics.CreateScope("Accounts.GetTeamsCivicAddress"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTeamsCivicAddressRequest(accountName, civicAddressId, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Get list of Accounts. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// Whether to return a count of the total number of records available for this request. + /// The cancellation token to use. + /// Get list of Accounts with details. An Account represents an Enterprise or collection of users. + /// + public virtual AsyncPageable GetAccountResourcesAsync(int? maxCount = null, int? skip = null, int? maxpagesize = null, string filter = null, bool? countRecords = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAccountResourcesRequest(maxCount, skip, maxpagesize, filter, countRecords, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAccountResourcesNextPageRequest(nextLink, maxCount, skip, maxpagesize, filter, countRecords, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => AccountResource.DeserializeAccountResource(e), ClientDiagnostics, _pipeline, "Accounts.GetAccountResources", "value", "nextLink", context); + } + + /// Get list of Accounts. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// Whether to return a count of the total number of records available for this request. + /// The cancellation token to use. + /// Get list of Accounts with details. An Account represents an Enterprise or collection of users. + /// + public virtual Pageable GetAccountResources(int? maxCount = null, int? skip = null, int? maxpagesize = null, string filter = null, bool? countRecords = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAccountResourcesRequest(maxCount, skip, maxpagesize, filter, countRecords, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAccountResourcesNextPageRequest(nextLink, maxCount, skip, maxpagesize, filter, countRecords, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => AccountResource.DeserializeAccountResource(e), ClientDiagnostics, _pipeline, "Accounts.GetAccountResources", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Get list of Accounts + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// Whether to return a count of the total number of records available for this request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetAccountResourcesAsync(int? maxCount, int? skip, int? maxpagesize, string filter, bool? countRecords, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAccountResourcesRequest(maxCount, skip, maxpagesize, filter, countRecords, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAccountResourcesNextPageRequest(nextLink, maxCount, skip, maxpagesize, filter, countRecords, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "Accounts.GetAccountResources", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Get list of Accounts + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// Whether to return a count of the total number of records available for this request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetAccountResources(int? maxCount, int? skip, int? maxpagesize, string filter, bool? countRecords, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAccountResourcesRequest(maxCount, skip, maxpagesize, filter, countRecords, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAccountResourcesNextPageRequest(nextLink, maxCount, skip, maxpagesize, filter, countRecords, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "Accounts.GetAccountResources", "value", "nextLink", context); + } + + /// Get Numbers. + /// Name of the account. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// Whether to return a count of the total number of records available for this request. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Get a list of Numbers on the specified account. + /// + public virtual AsyncPageable GetNumbersAsync(string accountName, int? maxCount = null, int? skip = null, int? maxpagesize = null, string filter = null, bool? countRecords = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetNumbersRequest(accountName, maxCount, skip, maxpagesize, filter, countRecords, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetNumbersNextPageRequest(nextLink, accountName, maxCount, skip, maxpagesize, filter, countRecords, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => NumberResource.DeserializeNumberResource(e), ClientDiagnostics, _pipeline, "Accounts.GetNumbers", "value", "nextLink", context); + } + + /// Get Numbers. + /// Name of the account. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// Whether to return a count of the total number of records available for this request. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Get a list of Numbers on the specified account. + /// + public virtual Pageable GetNumbers(string accountName, int? maxCount = null, int? skip = null, int? maxpagesize = null, string filter = null, bool? countRecords = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetNumbersRequest(accountName, maxCount, skip, maxpagesize, filter, countRecords, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetNumbersNextPageRequest(nextLink, accountName, maxCount, skip, maxpagesize, filter, countRecords, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => NumberResource.DeserializeNumberResource(e), ClientDiagnostics, _pipeline, "Accounts.GetNumbers", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Get Numbers. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// Whether to return a count of the total number of records available for this request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetNumbersAsync(string accountName, int? maxCount, int? skip, int? maxpagesize, string filter, bool? countRecords, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetNumbersRequest(accountName, maxCount, skip, maxpagesize, filter, countRecords, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetNumbersNextPageRequest(nextLink, accountName, maxCount, skip, maxpagesize, filter, countRecords, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "Accounts.GetNumbers", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Get Numbers. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// Whether to return a count of the total number of records available for this request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetNumbers(string accountName, int? maxCount, int? skip, int? maxpagesize, string filter, bool? countRecords, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetNumbersRequest(accountName, maxCount, skip, maxpagesize, filter, countRecords, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetNumbersNextPageRequest(nextLink, accountName, maxCount, skip, maxpagesize, filter, countRecords, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "Accounts.GetNumbers", "value", "nextLink", context); + } + + /// Get Teams Civic Addresses. + /// Name of the account. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// Whether to return a count of the total number of records available for this request. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Get a list of Teams Civic Addresses on the specified account. + /// + public virtual AsyncPageable GetTeamsCivicAddressesAsync(string accountName, int? maxCount = null, int? skip = null, int? maxpagesize = null, string filter = null, bool? countRecords = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTeamsCivicAddressesRequest(accountName, maxCount, skip, maxpagesize, filter, countRecords, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTeamsCivicAddressesNextPageRequest(nextLink, accountName, maxCount, skip, maxpagesize, filter, countRecords, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => TeamsCivicAddressResource.DeserializeTeamsCivicAddressResource(e), ClientDiagnostics, _pipeline, "Accounts.GetTeamsCivicAddresses", "value", "nextLink", context); + } + + /// Get Teams Civic Addresses. + /// Name of the account. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// Whether to return a count of the total number of records available for this request. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Get a list of Teams Civic Addresses on the specified account. + /// + public virtual Pageable GetTeamsCivicAddresses(string accountName, int? maxCount = null, int? skip = null, int? maxpagesize = null, string filter = null, bool? countRecords = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTeamsCivicAddressesRequest(accountName, maxCount, skip, maxpagesize, filter, countRecords, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTeamsCivicAddressesNextPageRequest(nextLink, accountName, maxCount, skip, maxpagesize, filter, countRecords, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => TeamsCivicAddressResource.DeserializeTeamsCivicAddressResource(e), ClientDiagnostics, _pipeline, "Accounts.GetTeamsCivicAddresses", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Get Teams Civic Addresses. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// Whether to return a count of the total number of records available for this request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetTeamsCivicAddressesAsync(string accountName, int? maxCount, int? skip, int? maxpagesize, string filter, bool? countRecords, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTeamsCivicAddressesRequest(accountName, maxCount, skip, maxpagesize, filter, countRecords, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTeamsCivicAddressesNextPageRequest(nextLink, accountName, maxCount, skip, maxpagesize, filter, countRecords, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "Accounts.GetTeamsCivicAddresses", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Get Teams Civic Addresses. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Name of the account. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// Whether to return a count of the total number of records available for this request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetTeamsCivicAddresses(string accountName, int? maxCount, int? skip, int? maxpagesize, string filter, bool? countRecords, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTeamsCivicAddressesRequest(accountName, maxCount, skip, maxpagesize, filter, countRecords, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTeamsCivicAddressesNextPageRequest(nextLink, accountName, maxCount, skip, maxpagesize, filter, countRecords, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "Accounts.GetTeamsCivicAddresses", "value", "nextLink", context); + } + + internal HttpMessage CreateGetAccountResourcesRequest(int? maxCount, int? skip, int? maxpagesize, string filter, bool? countRecords, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/accounts", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + if (filter != null) + { + uri.AppendQuery("filter", filter, true); + } + if (countRecords != null) + { + uri.AppendQuery("countRecords", countRecords.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetAccountResourceRequest(string accountName, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + return message; + } + + internal HttpMessage CreateCreateOrReplaceRequest(string accountName, RequestContent content, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200201); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Repeatability-Request-ID", Guid.NewGuid()); + request.Headers.Add("Repeatability-First-Sent", DateTimeOffset.Now, "R"); + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateDeleteRequest(string accountName, bool? deleteNumbers, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier204); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendQuery("api-version", _apiVersion, true); + if (deleteNumbers != null) + { + uri.AppendQuery("deleteNumbers", deleteNumbers.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Repeatability-Request-ID", Guid.NewGuid()); + request.Headers.Add("Repeatability-First-Sent", DateTimeOffset.Now, "R"); + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + return message; + } + + internal HttpMessage CreateCreateOrUpdateNumbersRequest(string accountName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath(":createOrUpdateNumbers", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Repeatability-Request-ID", Guid.NewGuid()); + request.Headers.Add("Repeatability-First-Sent", DateTimeOffset.Now, "R"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateDeleteNumbersRequest(string accountName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier204); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath(":deleteNumbers", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Repeatability-Request-ID", Guid.NewGuid()); + request.Headers.Add("Repeatability-First-Sent", DateTimeOffset.Now, "R"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetNumbersRequest(string accountName, int? maxCount, int? skip, int? maxpagesize, string filter, bool? countRecords, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/numbers", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + if (filter != null) + { + uri.AppendQuery("filter", filter, true); + } + if (countRecords != null) + { + uri.AppendQuery("countRecords", countRecords.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetNumberRequest(string accountName, string telephoneNumber, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/numbers/", false); + uri.AppendPath(telephoneNumber, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + return message; + } + + internal HttpMessage CreateCreateOrReplaceNumberRequest(string accountName, string telephoneNumber, RequestContent content, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200201); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/numbers/", false); + uri.AppendPath(telephoneNumber, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Repeatability-Request-ID", Guid.NewGuid()); + request.Headers.Add("Repeatability-First-Sent", DateTimeOffset.Now, "R"); + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateDeleteNumberRequest(string accountName, string telephoneNumber, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier204); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/numbers/", false); + uri.AppendPath(telephoneNumber, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Repeatability-Request-ID", Guid.NewGuid()); + request.Headers.Add("Repeatability-First-Sent", DateTimeOffset.Now, "R"); + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + return message; + } + + internal HttpMessage CreateGetTeamsCapabilityPlansRequest(string accountName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath(":getTeamsCapabilityPlans", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Repeatability-Request-ID", Guid.NewGuid()); + request.Headers.Add("Repeatability-First-Sent", DateTimeOffset.Now, "R"); + return message; + } + + internal HttpMessage CreateGetTeamsAvailableCapabilitiesRequest(string accountName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath(":getTeamsAvailableCapabilities", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Repeatability-Request-ID", Guid.NewGuid()); + request.Headers.Add("Repeatability-First-Sent", DateTimeOffset.Now, "R"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetTeamsCivicAddressesRequest(string accountName, int? maxCount, int? skip, int? maxpagesize, string filter, bool? countRecords, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/teamsCivicAddresses", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + if (filter != null) + { + uri.AppendQuery("filter", filter, true); + } + if (countRecords != null) + { + uri.AppendQuery("countRecords", countRecords.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTeamsCivicAddressRequest(string accountName, string civicAddressId, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/teamsCivicAddresses/", false); + uri.AppendPath(civicAddressId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + return message; + } + + internal HttpMessage CreateGetAccountResourcesNextPageRequest(string nextLink, int? maxCount, int? skip, int? maxpagesize, string filter, bool? countRecords, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetNumbersNextPageRequest(string nextLink, string accountName, int? maxCount, int? skip, int? maxpagesize, string filter, bool? countRecords, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTeamsCivicAddressesNextPageRequest(string nextLink, string accountName, int? maxCount, int? skip, int? maxpagesize, string filter, bool? countRecords, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + private static ResponseClassifier _responseClassifier200201; + private static ResponseClassifier ResponseClassifier200201 => _responseClassifier200201 ??= new StatusCodeClassifier(stackalloc ushort[] { 200, 201 }); + private static ResponseClassifier _responseClassifier204; + private static ResponseClassifier ResponseClassifier204 => _responseClassifier204 ??= new StatusCodeClassifier(stackalloc ushort[] { 204 }); + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AzureOperatorCallProtectionAccountDetails.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AzureOperatorCallProtectionAccountDetails.Serialization.cs new file mode 100644 index 000000000000..23600447e65d --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AzureOperatorCallProtectionAccountDetails.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class AzureOperatorCallProtectionAccountDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureOperatorCallProtectionAccountDetails)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled); + if (options.Format != "W" && Optional.IsDefined(NumberCount)) + { + writer.WritePropertyName("numberCount"u8); + writer.WriteNumberValue(NumberCount.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + AzureOperatorCallProtectionAccountDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureOperatorCallProtectionAccountDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureOperatorCallProtectionAccountDetails(document.RootElement, options); + } + + internal static AzureOperatorCallProtectionAccountDetails DeserializeAzureOperatorCallProtectionAccountDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool enabled = default; + long? numberCount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enabled"u8)) + { + enabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("numberCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberCount = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureOperatorCallProtectionAccountDetails(enabled, numberCount, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AzureOperatorCallProtectionAccountDetails)} does not support writing '{options.Format}' format."); + } + } + + AzureOperatorCallProtectionAccountDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAzureOperatorCallProtectionAccountDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureOperatorCallProtectionAccountDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AzureOperatorCallProtectionAccountDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAzureOperatorCallProtectionAccountDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AzureOperatorCallProtectionAccountDetails.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AzureOperatorCallProtectionAccountDetails.cs new file mode 100644 index 000000000000..ff69e1df2883 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AzureOperatorCallProtectionAccountDetails.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// Account details specific to Azure Operator Call Protection. + public partial class AzureOperatorCallProtectionAccountDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Boolean indicating if the service is enabled on this Account. + public AzureOperatorCallProtectionAccountDetails(bool enabled) + { + Enabled = enabled; + } + + /// Initializes a new instance of . + /// Boolean indicating if the service is enabled on this Account. + /// The count of telephone numbers associated with this account that have this backend service enabled. + /// Keeps track of any properties unknown to the library. + internal AzureOperatorCallProtectionAccountDetails(bool enabled, long? numberCount, IDictionary serializedAdditionalRawData) + { + Enabled = enabled; + NumberCount = numberCount; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AzureOperatorCallProtectionAccountDetails() + { + } + + /// Boolean indicating if the service is enabled on this Account. + public bool Enabled { get; set; } + /// The count of telephone numbers associated with this account that have this backend service enabled. + public long? NumberCount { get; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AzureOperatorCallProtectionNumberDetails.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AzureOperatorCallProtectionNumberDetails.Serialization.cs new file mode 100644 index 000000000000..48a9cc10cb77 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AzureOperatorCallProtectionNumberDetails.Serialization.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class AzureOperatorCallProtectionNumberDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureOperatorCallProtectionNumberDetails)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + AzureOperatorCallProtectionNumberDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureOperatorCallProtectionNumberDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureOperatorCallProtectionNumberDetails(document.RootElement, options); + } + + internal static AzureOperatorCallProtectionNumberDetails DeserializeAzureOperatorCallProtectionNumberDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool enabled = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enabled"u8)) + { + enabled = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureOperatorCallProtectionNumberDetails(enabled, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AzureOperatorCallProtectionNumberDetails)} does not support writing '{options.Format}' format."); + } + } + + AzureOperatorCallProtectionNumberDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAzureOperatorCallProtectionNumberDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureOperatorCallProtectionNumberDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AzureOperatorCallProtectionNumberDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAzureOperatorCallProtectionNumberDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AzureOperatorCallProtectionNumberDetails.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AzureOperatorCallProtectionNumberDetails.cs new file mode 100644 index 000000000000..11c9d47dbe8a --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/AzureOperatorCallProtectionNumberDetails.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// Details for the Azure Operator Call Protection service on this Number. + public partial class AzureOperatorCallProtectionNumberDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Boolean indicating if the service is enabled on this Number. + public AzureOperatorCallProtectionNumberDetails(bool enabled) + { + Enabled = enabled; + } + + /// Initializes a new instance of . + /// Boolean indicating if the service is enabled on this Number. + /// Keeps track of any properties unknown to the library. + internal AzureOperatorCallProtectionNumberDetails(bool enabled, IDictionary serializedAdditionalRawData) + { + Enabled = enabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AzureOperatorCallProtectionNumberDetails() + { + } + + /// Boolean indicating if the service is enabled on this Number. + public bool Enabled { get; set; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/BatchNumbers.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/BatchNumbers.Serialization.cs new file mode 100644 index 000000000000..e83dda55446e --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/BatchNumbers.Serialization.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class BatchNumbers : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BatchNumbers)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("numbers"u8); + writer.WriteStartArray(); + foreach (var item in Numbers) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + BatchNumbers IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BatchNumbers)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBatchNumbers(document.RootElement, options); + } + + internal static BatchNumbers DeserializeBatchNumbers(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList numbers = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("numbers"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NumberResource.DeserializeNumberResource(item, options)); + } + numbers = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BatchNumbers(numbers, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BatchNumbers)} does not support writing '{options.Format}' format."); + } + } + + BatchNumbers IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBatchNumbers(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BatchNumbers)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static BatchNumbers FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeBatchNumbers(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/BatchNumbers.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/BatchNumbers.cs new file mode 100644 index 000000000000..2ccea9bd7181 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/BatchNumbers.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// List of telephone numbers to be uploaded to an account via a PUT request. + public partial class BatchNumbers + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The list of numbers to upload. At most 100 can be uploaded in one request. + /// is null. + public BatchNumbers(IEnumerable numbers) + { + Argument.AssertNotNull(numbers, nameof(numbers)); + + Numbers = numbers.ToList(); + } + + /// Initializes a new instance of . + /// The list of numbers to upload. At most 100 can be uploaded in one request. + /// Keeps track of any properties unknown to the library. + internal BatchNumbers(IList numbers, IDictionary serializedAdditionalRawData) + { + Numbers = numbers; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BatchNumbers() + { + } + + /// The list of numbers to upload. At most 100 can be uploaded in one request. + public IList Numbers { get; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/BatchNumbersDelete.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/BatchNumbersDelete.Serialization.cs new file mode 100644 index 000000000000..7b2b00762c05 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/BatchNumbersDelete.Serialization.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class BatchNumbersDelete : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BatchNumbersDelete)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("numbers"u8); + writer.WriteStartArray(); + foreach (var item in Numbers) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + BatchNumbersDelete IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BatchNumbersDelete)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBatchNumbersDelete(document.RootElement, options); + } + + internal static BatchNumbersDelete DeserializeBatchNumbersDelete(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList numbers = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("numbers"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NumberIdentifier.DeserializeNumberIdentifier(item, options)); + } + numbers = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BatchNumbersDelete(numbers, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BatchNumbersDelete)} does not support writing '{options.Format}' format."); + } + } + + BatchNumbersDelete IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBatchNumbersDelete(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BatchNumbersDelete)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static BatchNumbersDelete FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeBatchNumbersDelete(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/BatchNumbersDelete.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/BatchNumbersDelete.cs new file mode 100644 index 000000000000..f43d15b08138 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/BatchNumbersDelete.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// A list of telephone numbers to delete. + public partial class BatchNumbersDelete + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The list of number to delete. At most 100 can be deleted in one request. + /// is null. + public BatchNumbersDelete(IEnumerable numbers) + { + Argument.AssertNotNull(numbers, nameof(numbers)); + + Numbers = numbers.ToList(); + } + + /// Initializes a new instance of . + /// The list of number to delete. At most 100 can be deleted in one request. + /// Keeps track of any properties unknown to the library. + internal BatchNumbersDelete(IList numbers, IDictionary serializedAdditionalRawData) + { + Numbers = numbers; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BatchNumbersDelete() + { + } + + /// The list of number to delete. At most 100 can be deleted in one request. + public IList Numbers { get; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ContactDetails.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ContactDetails.Serialization.cs new file mode 100644 index 000000000000..c80debdcf447 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ContactDetails.Serialization.cs @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class ContactDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContactDetails)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W") + { + writer.WritePropertyName("fullName"u8); + writer.WriteStringValue(FullName); + } + if (options.Format != "W") + { + writer.WritePropertyName("email"u8); + writer.WriteStringValue(Email); + } + if (options.Format != "W" && Optional.IsDefined(TelephoneNumber)) + { + writer.WritePropertyName("telephoneNumber"u8); + writer.WriteStringValue(TelephoneNumber); + } + if (options.Format != "W" && Optional.IsDefined(CompanyName)) + { + writer.WritePropertyName("companyName"u8); + writer.WriteStringValue(CompanyName); + } + if (options.Format != "W" && Optional.IsDefined(CompanySize)) + { + writer.WritePropertyName("companySize"u8); + writer.WriteStringValue(CompanySize); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ContactDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContactDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContactDetails(document.RootElement, options); + } + + internal static ContactDetails DeserializeContactDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string fullName = default; + string email = default; + string telephoneNumber = default; + string companyName = default; + string companySize = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("fullName"u8)) + { + fullName = property.Value.GetString(); + continue; + } + if (property.NameEquals("email"u8)) + { + email = property.Value.GetString(); + continue; + } + if (property.NameEquals("telephoneNumber"u8)) + { + telephoneNumber = property.Value.GetString(); + continue; + } + if (property.NameEquals("companyName"u8)) + { + companyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("companySize"u8)) + { + companySize = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContactDetails( + fullName, + email, + telephoneNumber, + companyName, + companySize, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ContactDetails)} does not support writing '{options.Format}' format."); + } + } + + ContactDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeContactDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContactDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ContactDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeContactDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupSchedule.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ContactDetails.cs similarity index 54% rename from sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupSchedule.cs rename to sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ContactDetails.cs index 82a98b5c58dc..237740f97fd7 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupSchedule.cs +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ContactDetails.cs @@ -8,10 +8,10 @@ using System; using System.Collections.Generic; -namespace Azure.ResourceManager.CosmosDB.Models +namespace Microsoft.VoiceServices.Provisioning { - /// The CassandraClusterBackupSchedule. - public partial class CassandraClusterBackupSchedule + /// Contact details for an individual. + public partial class ContactDetails { /// /// Keeps track of any properties unknown to the library. @@ -45,32 +45,37 @@ public partial class CassandraClusterBackupSchedule /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public CassandraClusterBackupSchedule() + /// Initializes a new instance of . + internal ContactDetails() { } - /// Initializes a new instance of . - /// The unique identifier of backup schedule. - /// The cron expression that defines when you want to back up your data. - /// The retention period (hours) of the backups. If you want to retain data forever, set retention to 0. + /// Initializes a new instance of . + /// The full name of the contact detail. + /// The email of the contact detail. + /// The telephone number of the contact detail. + /// The company name of the contact detail. + /// The company size of the contact detail. /// Keeps track of any properties unknown to the library. - internal CassandraClusterBackupSchedule(string scheduleName, string cronExpression, int? retentionInHours, IDictionary serializedAdditionalRawData) + internal ContactDetails(string fullName, string email, string telephoneNumber, string companyName, string companySize, IDictionary serializedAdditionalRawData) { - ScheduleName = scheduleName; - CronExpression = cronExpression; - RetentionInHours = retentionInHours; + FullName = fullName; + Email = email; + TelephoneNumber = telephoneNumber; + CompanyName = companyName; + CompanySize = companySize; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The unique identifier of backup schedule. - [WirePath("scheduleName")] - public string ScheduleName { get; set; } - /// The cron expression that defines when you want to back up your data. - [WirePath("cronExpression")] - public string CronExpression { get; set; } - /// The retention period (hours) of the backups. If you want to retain data forever, set retention to 0. - [WirePath("retentionInHours")] - public int? RetentionInHours { get; set; } + /// The full name of the contact detail. + public string FullName { get; } + /// The email of the contact detail. + public string Email { get; } + /// The telephone number of the contact detail. + public string TelephoneNumber { get; } + /// The company name of the contact detail. + public string CompanyName { get; } + /// The company size of the contact detail. + public string CompanySize { get; } } } diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/CustomerRelationship.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/CustomerRelationship.Serialization.cs new file mode 100644 index 000000000000..2b1c902dc0c8 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/CustomerRelationship.Serialization.cs @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class CustomerRelationship : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomerRelationship)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status); + } + if (options.Format != "W" && Optional.IsDefined(LastModifiedOn)) + { + writer.WritePropertyName("lastModifiedOn"u8); + writer.WriteStringValue(LastModifiedOn.Value, "O"); + } + if (Optional.IsDefined(Comment)) + { + writer.WritePropertyName("comment"u8); + writer.WriteStringValue(Comment); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + CustomerRelationship IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomerRelationship)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCustomerRelationship(document.RootElement, options); + } + + internal static CustomerRelationship DeserializeCustomerRelationship(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string status = default; + DateTimeOffset? lastModifiedOn = default; + string comment = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("status"u8)) + { + status = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastModifiedOn"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastModifiedOn = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("comment"u8)) + { + comment = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CustomerRelationship(status, lastModifiedOn, comment, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CustomerRelationship)} does not support writing '{options.Format}' format."); + } + } + + CustomerRelationship IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCustomerRelationship(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CustomerRelationship)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static CustomerRelationship FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCustomerRelationship(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBThroughputPoolPatch.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/CustomerRelationship.cs similarity index 61% rename from sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBThroughputPoolPatch.cs rename to sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/CustomerRelationship.cs index b1d54c8f96ce..69c90759873f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBThroughputPoolPatch.cs +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/CustomerRelationship.cs @@ -8,10 +8,10 @@ using System; using System.Collections.Generic; -namespace Azure.ResourceManager.CosmosDB.Models +namespace Microsoft.VoiceServices.Provisioning { - /// Represents a throughput pool resource for updates. - public partial class CosmosDBThroughputPoolPatch + /// Details of a customer relationship. + public partial class CustomerRelationship { /// /// Keeps track of any properties unknown to the library. @@ -45,27 +45,29 @@ public partial class CosmosDBThroughputPoolPatch /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public CosmosDBThroughputPoolPatch() + /// Initializes a new instance of . + public CustomerRelationship() { } - /// Initializes a new instance of . - /// A provisioning state of the ThroughputPool. - /// Value for throughput to be shared among CosmosDB resources in the pool. + /// Initializes a new instance of . + /// The status of the customer relationship. + /// The time (ISO8601 format) when the customer relationship is last modified. + /// The comment of the customer relationship. /// Keeps track of any properties unknown to the library. - internal CosmosDBThroughputPoolPatch(CosmosDBStatus? provisioningState, int? maxThroughput, IDictionary serializedAdditionalRawData) + internal CustomerRelationship(string status, DateTimeOffset? lastModifiedOn, string comment, IDictionary serializedAdditionalRawData) { - ProvisioningState = provisioningState; - MaxThroughput = maxThroughput; + Status = status; + LastModifiedOn = lastModifiedOn; + Comment = comment; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// A provisioning state of the ThroughputPool. - [WirePath("properties.provisioningState")] - public CosmosDBStatus? ProvisioningState { get; set; } - /// Value for throughput to be shared among CosmosDB resources in the pool. - [WirePath("properties.maxThroughput")] - public int? MaxThroughput { get; set; } + /// The status of the customer relationship. + public string Status { get; set; } + /// The time (ISO8601 format) when the customer relationship is last modified. + public DateTimeOffset? LastModifiedOn { get; } + /// The comment of the customer relationship. + public string Comment { get; set; } } } diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Docs/Accounts.xml b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Docs/Accounts.xml new file mode 100644 index 000000000000..003ba76aa560 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Docs/Accounts.xml @@ -0,0 +1,2507 @@ + + + + + +This sample shows how to call GetAccountResourceAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = await client.GetAccountResourceAsync(""); +]]> +This sample shows how to call GetAccountResourceAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = await client.GetAccountResourceAsync("", requestConditions: null); +]]> + + + +This sample shows how to call GetAccountResource. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = client.GetAccountResource(""); +]]> +This sample shows how to call GetAccountResource with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = client.GetAccountResource("", requestConditions: null); +]]> + + + +This sample shows how to call GetAccountResourceAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = await client.GetAccountResourceAsync("", null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +]]> +This sample shows how to call GetAccountResourceAsync with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = await client.GetAccountResourceAsync("", null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("correlationId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsTenantId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("syncEnabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("numberCount").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("syncEnabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("numberCount").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("callScreening").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomain").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region1Token").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region2Token").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("subdomainStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("syncEnabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("numberCount").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("syncEnabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("numberCount").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("numberCount").ToString()); +]]> + + + +This sample shows how to call GetAccountResource and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = client.GetAccountResource("", null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +]]> +This sample shows how to call GetAccountResource with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = client.GetAccountResource("", null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("correlationId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsTenantId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("syncEnabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("numberCount").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("syncEnabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("numberCount").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("callScreening").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomain").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region1Token").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region2Token").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("subdomainStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("syncEnabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("numberCount").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("syncEnabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("numberCount").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("numberCount").ToString()); +]]> + + + +This sample shows how to call CreateOrReplaceAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +AccountResource resource = new AccountResource(""); +Response response = await client.CreateOrReplaceAsync("", resource); +]]> +This sample shows how to call CreateOrReplaceAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +AccountResource resource = new AccountResource("") +{ + CorrelationId = "", + ServiceDetails = new AccountServiceDetails + { + TeamsTenantId = "", + TeamsOperatorConnect = new TeamsOperatorConnectAccountDetails(true, true), + TeamsDirectRouting = new TeamsDirectRoutingAccountDetails(true, true) + { + Configuration = new TeamsDirectRoutingAccountConfig(true, "", new TeamsDirectRoutingSubdomainTokens("", "")), + }, + TeamsPhoneMobile = new TeamsPhoneMobileAccountDetails(true, true), + ZoomPhoneCloudPeering = new ZoomPhoneCloudPeeringAccountDetails(true, true), + AzureOperatorCallProtection = new AzureOperatorCallProtectionAccountDetails(true), + }, +}; +Response response = await client.CreateOrReplaceAsync("", resource, requestConditions: null); +]]> + + + +This sample shows how to call CreateOrReplace. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +AccountResource resource = new AccountResource(""); +Response response = client.CreateOrReplace("", resource); +]]> +This sample shows how to call CreateOrReplace with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +AccountResource resource = new AccountResource("") +{ + CorrelationId = "", + ServiceDetails = new AccountServiceDetails + { + TeamsTenantId = "", + TeamsOperatorConnect = new TeamsOperatorConnectAccountDetails(true, true), + TeamsDirectRouting = new TeamsDirectRoutingAccountDetails(true, true) + { + Configuration = new TeamsDirectRoutingAccountConfig(true, "", new TeamsDirectRoutingSubdomainTokens("", "")), + }, + TeamsPhoneMobile = new TeamsPhoneMobileAccountDetails(true, true), + ZoomPhoneCloudPeering = new ZoomPhoneCloudPeeringAccountDetails(true, true), + AzureOperatorCallProtection = new AzureOperatorCallProtectionAccountDetails(true), + }, +}; +Response response = client.CreateOrReplace("", resource, requestConditions: null); +]]> + + + +This sample shows how to call CreateOrReplaceAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +using RequestContent content = RequestContent.Create(new +{ + name = "", +}); +Response response = await client.CreateOrReplaceAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +]]> +This sample shows how to call CreateOrReplaceAsync with all parameters and request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +using RequestContent content = RequestContent.Create(new +{ + name = "", + correlationId = "", + serviceDetails = new + { + teamsTenantId = "", + teamsOperatorConnect = new + { + syncEnabled = true, + enabled = true, + }, + teamsDirectRouting = new + { + syncEnabled = true, + enabled = true, + configuration = new + { + callScreening = true, + subdomain = "", + subdomainTokens = new + { + region1Token = "", + region2Token = "", + }, + }, + }, + teamsPhoneMobile = new + { + syncEnabled = true, + enabled = true, + }, + zoomPhoneCloudPeering = new + { + syncEnabled = true, + enabled = true, + }, + azureOperatorCallProtection = new + { + enabled = true, + }, + }, +}); +Response response = await client.CreateOrReplaceAsync("", content, requestConditions: null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("correlationId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsTenantId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("syncEnabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("numberCount").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("syncEnabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("numberCount").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("callScreening").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomain").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region1Token").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region2Token").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("subdomainStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("syncEnabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("numberCount").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("syncEnabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("numberCount").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("numberCount").ToString()); +]]> + + + +This sample shows how to call CreateOrReplace and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +using RequestContent content = RequestContent.Create(new +{ + name = "", +}); +Response response = client.CreateOrReplace("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +]]> +This sample shows how to call CreateOrReplace with all parameters and request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +using RequestContent content = RequestContent.Create(new +{ + name = "", + correlationId = "", + serviceDetails = new + { + teamsTenantId = "", + teamsOperatorConnect = new + { + syncEnabled = true, + enabled = true, + }, + teamsDirectRouting = new + { + syncEnabled = true, + enabled = true, + configuration = new + { + callScreening = true, + subdomain = "", + subdomainTokens = new + { + region1Token = "", + region2Token = "", + }, + }, + }, + teamsPhoneMobile = new + { + syncEnabled = true, + enabled = true, + }, + zoomPhoneCloudPeering = new + { + syncEnabled = true, + enabled = true, + }, + azureOperatorCallProtection = new + { + enabled = true, + }, + }, +}); +Response response = client.CreateOrReplace("", content, requestConditions: null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("correlationId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsTenantId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("syncEnabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("numberCount").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("syncEnabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("numberCount").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("callScreening").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomain").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region1Token").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region2Token").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("subdomainStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("syncEnabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("numberCount").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("syncEnabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("numberCount").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("numberCount").ToString()); +]]> + + + +This sample shows how to call DeleteAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = await client.DeleteAsync(""); + +Console.WriteLine(response.Status); +]]> +This sample shows how to call DeleteAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = await client.DeleteAsync("", deleteNumbers: true, requestConditions: null); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call Delete. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = client.Delete(""); + +Console.WriteLine(response.Status); +]]> +This sample shows how to call Delete with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = client.Delete("", deleteNumbers: true, requestConditions: null); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call CreateOrUpdateNumbersAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +BatchNumbers body = new BatchNumbers(new NumberResource[] +{ + new NumberResource("", "", new NumberServiceDetails()) +}); +Response response = await client.CreateOrUpdateNumbersAsync("", body); +]]> +This sample shows how to call CreateOrUpdateNumbersAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +BatchNumbers body = new BatchNumbers(new NumberResource[] +{ + new NumberResource("", "", new NumberServiceDetails + { + TeamsOperatorConnect = new TeamsOperatorConnectNumberDetails(true) + { + AssignmentStatus = TelephoneNumberAssignmentStatus.Assigned, + Configuration = new TeamsOperatorConnectNumberConfig("", new string[]{""}) + { + AdditionalUsages = {""}, + CivicAddressId = "", + LocationId = "", + AllowTenantAddressUpdate = true, + DisplayedCountryCode = "", + }, + }, + TeamsDirectRouting = new TeamsDirectRoutingNumberDetails(true), + TeamsPhoneMobile = new TeamsPhoneMobileNumberDetails(true) + { + AssignmentStatus = TelephoneNumberAssignmentStatus.Assigned, + Configuration = new TeamsPhoneMobileNumberConfig("", new string[]{""}) + { + AdditionalUsages = {""}, + CivicAddressId = "", + LocationId = "", + AllowTenantAddressUpdate = true, + DisplayedCountryCode = "", + }, + }, + ZoomPhoneCloudPeering = new ZoomPhoneCloudPeeringNumberDetails(true), + AzureOperatorCallProtection = new AzureOperatorCallProtectionNumberDetails(true), + }) + { + Configuration = new NumberConfiguration + { + CustomSipHeader = "", + }, + } +}); +Response response = await client.CreateOrUpdateNumbersAsync("", body); +]]> + + + +This sample shows how to call CreateOrUpdateNumbers. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +BatchNumbers body = new BatchNumbers(new NumberResource[] +{ + new NumberResource("", "", new NumberServiceDetails()) +}); +Response response = client.CreateOrUpdateNumbers("", body); +]]> +This sample shows how to call CreateOrUpdateNumbers with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +BatchNumbers body = new BatchNumbers(new NumberResource[] +{ + new NumberResource("", "", new NumberServiceDetails + { + TeamsOperatorConnect = new TeamsOperatorConnectNumberDetails(true) + { + AssignmentStatus = TelephoneNumberAssignmentStatus.Assigned, + Configuration = new TeamsOperatorConnectNumberConfig("", new string[]{""}) + { + AdditionalUsages = {""}, + CivicAddressId = "", + LocationId = "", + AllowTenantAddressUpdate = true, + DisplayedCountryCode = "", + }, + }, + TeamsDirectRouting = new TeamsDirectRoutingNumberDetails(true), + TeamsPhoneMobile = new TeamsPhoneMobileNumberDetails(true) + { + AssignmentStatus = TelephoneNumberAssignmentStatus.Assigned, + Configuration = new TeamsPhoneMobileNumberConfig("", new string[]{""}) + { + AdditionalUsages = {""}, + CivicAddressId = "", + LocationId = "", + AllowTenantAddressUpdate = true, + DisplayedCountryCode = "", + }, + }, + ZoomPhoneCloudPeering = new ZoomPhoneCloudPeeringNumberDetails(true), + AzureOperatorCallProtection = new AzureOperatorCallProtectionNumberDetails(true), + }) + { + Configuration = new NumberConfiguration + { + CustomSipHeader = "", + }, + } +}); +Response response = client.CreateOrUpdateNumbers("", body); +]]> + + + +This sample shows how to call CreateOrUpdateNumbersAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +using RequestContent content = RequestContent.Create(new +{ + numbers = new object[] + { + new + { + telephoneNumber = "", + accountName = "", + serviceDetails = new object(), + } + }, +}); +Response response = await client.CreateOrUpdateNumbersAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("telephoneNumber").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").ToString()); +]]> +This sample shows how to call CreateOrUpdateNumbersAsync with all parameters and request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +using RequestContent content = RequestContent.Create(new +{ + numbers = new object[] + { + new + { + telephoneNumber = "", + accountName = "", + serviceDetails = new + { + teamsOperatorConnect = new + { + enabled = true, + assignmentStatus = "assigned", + configuration = new + { + usage = "", + choosableCapabilities = new object[] + { + "" + }, + additionalUsages = new object[] + { + "" + }, + civicAddressId = "", + locationId = "", + allowTenantAddressUpdate = true, + displayedCountryCode = "", + }, + }, + teamsDirectRouting = new + { + enabled = true, + }, + teamsPhoneMobile = new + { + enabled = true, + assignmentStatus = "assigned", + configuration = new + { + usage = "", + choosableCapabilities = new object[] + { + "" + }, + additionalUsages = new object[] + { + "" + }, + civicAddressId = "", + locationId = "", + allowTenantAddressUpdate = true, + displayedCountryCode = "", + }, + }, + zoomPhoneCloudPeering = new + { + enabled = true, + }, + azureOperatorCallProtection = new + { + enabled = true, + }, + }, + configuration = new + { + customSipHeader = "", + }, + } + }, +}); +Response response = await client.CreateOrUpdateNumbersAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningStatus").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("telephoneNumber").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("assignmentStatus").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("civicAddressId").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("locationId").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("assignmentStatus").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("civicAddressId").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("locationId").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("configuration").GetProperty("customSipHeader").ToString()); +]]> + + + +This sample shows how to call CreateOrUpdateNumbers and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +using RequestContent content = RequestContent.Create(new +{ + numbers = new object[] + { + new + { + telephoneNumber = "", + accountName = "", + serviceDetails = new object(), + } + }, +}); +Response response = client.CreateOrUpdateNumbers("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("telephoneNumber").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").ToString()); +]]> +This sample shows how to call CreateOrUpdateNumbers with all parameters and request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +using RequestContent content = RequestContent.Create(new +{ + numbers = new object[] + { + new + { + telephoneNumber = "", + accountName = "", + serviceDetails = new + { + teamsOperatorConnect = new + { + enabled = true, + assignmentStatus = "assigned", + configuration = new + { + usage = "", + choosableCapabilities = new object[] + { + "" + }, + additionalUsages = new object[] + { + "" + }, + civicAddressId = "", + locationId = "", + allowTenantAddressUpdate = true, + displayedCountryCode = "", + }, + }, + teamsDirectRouting = new + { + enabled = true, + }, + teamsPhoneMobile = new + { + enabled = true, + assignmentStatus = "assigned", + configuration = new + { + usage = "", + choosableCapabilities = new object[] + { + "" + }, + additionalUsages = new object[] + { + "" + }, + civicAddressId = "", + locationId = "", + allowTenantAddressUpdate = true, + displayedCountryCode = "", + }, + }, + zoomPhoneCloudPeering = new + { + enabled = true, + }, + azureOperatorCallProtection = new + { + enabled = true, + }, + }, + configuration = new + { + customSipHeader = "", + }, + } + }, +}); +Response response = client.CreateOrUpdateNumbers("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningStatus").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("telephoneNumber").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("assignmentStatus").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("civicAddressId").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("locationId").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("assignmentStatus").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("civicAddressId").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("locationId").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("configuration").GetProperty("customSipHeader").ToString()); +]]> + + + +This sample shows how to call DeleteNumbersAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +BatchNumbersDelete body = new BatchNumbersDelete(new NumberIdentifier[] +{ + new NumberIdentifier("") +}); +Response response = await client.DeleteNumbersAsync("", body); +]]> +This sample shows how to call DeleteNumbersAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +BatchNumbersDelete body = new BatchNumbersDelete(new NumberIdentifier[] +{ + new NumberIdentifier("") +}); +Response response = await client.DeleteNumbersAsync("", body); +]]> + + + +This sample shows how to call DeleteNumbers. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +BatchNumbersDelete body = new BatchNumbersDelete(new NumberIdentifier[] +{ + new NumberIdentifier("") +}); +Response response = client.DeleteNumbers("", body); +]]> +This sample shows how to call DeleteNumbers with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +BatchNumbersDelete body = new BatchNumbersDelete(new NumberIdentifier[] +{ + new NumberIdentifier("") +}); +Response response = client.DeleteNumbers("", body); +]]> + + + +This sample shows how to call DeleteNumbersAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +using RequestContent content = RequestContent.Create(new +{ + numbers = new object[] + { + new + { + telephoneNumber = "", + } + }, +}); +Response response = await client.DeleteNumbersAsync("", content); + +Console.WriteLine(response.Status); +]]> +This sample shows how to call DeleteNumbersAsync with all parameters and request content. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +using RequestContent content = RequestContent.Create(new +{ + numbers = new object[] + { + new + { + telephoneNumber = "", + } + }, +}); +Response response = await client.DeleteNumbersAsync("", content); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call DeleteNumbers. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +using RequestContent content = RequestContent.Create(new +{ + numbers = new object[] + { + new + { + telephoneNumber = "", + } + }, +}); +Response response = client.DeleteNumbers("", content); + +Console.WriteLine(response.Status); +]]> +This sample shows how to call DeleteNumbers with all parameters and request content. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +using RequestContent content = RequestContent.Create(new +{ + numbers = new object[] + { + new + { + telephoneNumber = "", + } + }, +}); +Response response = client.DeleteNumbers("", content); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call GetNumberAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = await client.GetNumberAsync("", ""); +]]> +This sample shows how to call GetNumberAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = await client.GetNumberAsync("", "", requestConditions: null); +]]> + + + +This sample shows how to call GetNumber. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = client.GetNumber("", ""); +]]> +This sample shows how to call GetNumber with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = client.GetNumber("", "", requestConditions: null); +]]> + + + +This sample shows how to call GetNumberAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = await client.GetNumberAsync("", "", null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); +Console.WriteLine(result.GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").ToString()); +]]> +This sample shows how to call GetNumberAsync with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = await client.GetNumberAsync("", "", null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); +Console.WriteLine(result.GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("assignmentStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("civicAddressId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("locationId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("assignmentStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("civicAddressId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("locationId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("configuration").GetProperty("customSipHeader").ToString()); +]]> + + + +This sample shows how to call GetNumber and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = client.GetNumber("", "", null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); +Console.WriteLine(result.GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").ToString()); +]]> +This sample shows how to call GetNumber with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = client.GetNumber("", "", null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); +Console.WriteLine(result.GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("assignmentStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("civicAddressId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("locationId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("assignmentStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("civicAddressId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("locationId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("configuration").GetProperty("customSipHeader").ToString()); +]]> + + + +This sample shows how to call CreateOrReplaceNumberAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +NumberResource resource = new NumberResource("", "", new NumberServiceDetails()); +Response response = await client.CreateOrReplaceNumberAsync("", "", resource); +]]> +This sample shows how to call CreateOrReplaceNumberAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +NumberResource resource = new NumberResource("", "", new NumberServiceDetails +{ + TeamsOperatorConnect = new TeamsOperatorConnectNumberDetails(true) + { + AssignmentStatus = TelephoneNumberAssignmentStatus.Assigned, + Configuration = new TeamsOperatorConnectNumberConfig("", new string[] { "" }) + { + AdditionalUsages = { "" }, + CivicAddressId = "", + LocationId = "", + AllowTenantAddressUpdate = true, + DisplayedCountryCode = "", + }, + }, + TeamsDirectRouting = new TeamsDirectRoutingNumberDetails(true), + TeamsPhoneMobile = new TeamsPhoneMobileNumberDetails(true) + { + AssignmentStatus = TelephoneNumberAssignmentStatus.Assigned, + Configuration = new TeamsPhoneMobileNumberConfig("", new string[] { "" }) + { + AdditionalUsages = { "" }, + CivicAddressId = "", + LocationId = "", + AllowTenantAddressUpdate = true, + DisplayedCountryCode = "", + }, + }, + ZoomPhoneCloudPeering = new ZoomPhoneCloudPeeringNumberDetails(true), + AzureOperatorCallProtection = new AzureOperatorCallProtectionNumberDetails(true), +}) +{ + Configuration = new NumberConfiguration + { + CustomSipHeader = "", + }, +}; +Response response = await client.CreateOrReplaceNumberAsync("", "", resource, requestConditions: null); +]]> + + + +This sample shows how to call CreateOrReplaceNumber. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +NumberResource resource = new NumberResource("", "", new NumberServiceDetails()); +Response response = client.CreateOrReplaceNumber("", "", resource); +]]> +This sample shows how to call CreateOrReplaceNumber with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +NumberResource resource = new NumberResource("", "", new NumberServiceDetails +{ + TeamsOperatorConnect = new TeamsOperatorConnectNumberDetails(true) + { + AssignmentStatus = TelephoneNumberAssignmentStatus.Assigned, + Configuration = new TeamsOperatorConnectNumberConfig("", new string[] { "" }) + { + AdditionalUsages = { "" }, + CivicAddressId = "", + LocationId = "", + AllowTenantAddressUpdate = true, + DisplayedCountryCode = "", + }, + }, + TeamsDirectRouting = new TeamsDirectRoutingNumberDetails(true), + TeamsPhoneMobile = new TeamsPhoneMobileNumberDetails(true) + { + AssignmentStatus = TelephoneNumberAssignmentStatus.Assigned, + Configuration = new TeamsPhoneMobileNumberConfig("", new string[] { "" }) + { + AdditionalUsages = { "" }, + CivicAddressId = "", + LocationId = "", + AllowTenantAddressUpdate = true, + DisplayedCountryCode = "", + }, + }, + ZoomPhoneCloudPeering = new ZoomPhoneCloudPeeringNumberDetails(true), + AzureOperatorCallProtection = new AzureOperatorCallProtectionNumberDetails(true), +}) +{ + Configuration = new NumberConfiguration + { + CustomSipHeader = "", + }, +}; +Response response = client.CreateOrReplaceNumber("", "", resource, requestConditions: null); +]]> + + + +This sample shows how to call CreateOrReplaceNumberAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +using RequestContent content = RequestContent.Create(new +{ + telephoneNumber = "", + accountName = "", + serviceDetails = new object(), +}); +Response response = await client.CreateOrReplaceNumberAsync("", "", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); +Console.WriteLine(result.GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").ToString()); +]]> +This sample shows how to call CreateOrReplaceNumberAsync with all parameters and request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +using RequestContent content = RequestContent.Create(new +{ + telephoneNumber = "", + accountName = "", + serviceDetails = new + { + teamsOperatorConnect = new + { + enabled = true, + assignmentStatus = "assigned", + configuration = new + { + usage = "", + choosableCapabilities = new object[] + { + "" + }, + additionalUsages = new object[] + { + "" + }, + civicAddressId = "", + locationId = "", + allowTenantAddressUpdate = true, + displayedCountryCode = "", + }, + }, + teamsDirectRouting = new + { + enabled = true, + }, + teamsPhoneMobile = new + { + enabled = true, + assignmentStatus = "assigned", + configuration = new + { + usage = "", + choosableCapabilities = new object[] + { + "" + }, + additionalUsages = new object[] + { + "" + }, + civicAddressId = "", + locationId = "", + allowTenantAddressUpdate = true, + displayedCountryCode = "", + }, + }, + zoomPhoneCloudPeering = new + { + enabled = true, + }, + azureOperatorCallProtection = new + { + enabled = true, + }, + }, + configuration = new + { + customSipHeader = "", + }, +}); +Response response = await client.CreateOrReplaceNumberAsync("", "", content, requestConditions: null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); +Console.WriteLine(result.GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("assignmentStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("civicAddressId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("locationId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("assignmentStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("civicAddressId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("locationId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("configuration").GetProperty("customSipHeader").ToString()); +]]> + + + +This sample shows how to call CreateOrReplaceNumber and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +using RequestContent content = RequestContent.Create(new +{ + telephoneNumber = "", + accountName = "", + serviceDetails = new object(), +}); +Response response = client.CreateOrReplaceNumber("", "", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); +Console.WriteLine(result.GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").ToString()); +]]> +This sample shows how to call CreateOrReplaceNumber with all parameters and request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +using RequestContent content = RequestContent.Create(new +{ + telephoneNumber = "", + accountName = "", + serviceDetails = new + { + teamsOperatorConnect = new + { + enabled = true, + assignmentStatus = "assigned", + configuration = new + { + usage = "", + choosableCapabilities = new object[] + { + "" + }, + additionalUsages = new object[] + { + "" + }, + civicAddressId = "", + locationId = "", + allowTenantAddressUpdate = true, + displayedCountryCode = "", + }, + }, + teamsDirectRouting = new + { + enabled = true, + }, + teamsPhoneMobile = new + { + enabled = true, + assignmentStatus = "assigned", + configuration = new + { + usage = "", + choosableCapabilities = new object[] + { + "" + }, + additionalUsages = new object[] + { + "" + }, + civicAddressId = "", + locationId = "", + allowTenantAddressUpdate = true, + displayedCountryCode = "", + }, + }, + zoomPhoneCloudPeering = new + { + enabled = true, + }, + azureOperatorCallProtection = new + { + enabled = true, + }, + }, + configuration = new + { + customSipHeader = "", + }, +}); +Response response = client.CreateOrReplaceNumber("", "", content, requestConditions: null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); +Console.WriteLine(result.GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("assignmentStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("civicAddressId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("locationId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("assignmentStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("civicAddressId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("locationId").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); +Console.WriteLine(result.GetProperty("configuration").GetProperty("customSipHeader").ToString()); +]]> + + + +This sample shows how to call DeleteNumberAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = await client.DeleteNumberAsync("", ""); + +Console.WriteLine(response.Status); +]]> +This sample shows how to call DeleteNumberAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = await client.DeleteNumberAsync("", "", requestConditions: null); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call DeleteNumber. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = client.DeleteNumber("", ""); + +Console.WriteLine(response.Status); +]]> +This sample shows how to call DeleteNumber with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = client.DeleteNumber("", "", requestConditions: null); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call GetTeamsCapabilityPlansAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = await client.GetTeamsCapabilityPlansAsync(""); +]]> +This sample shows how to call GetTeamsCapabilityPlansAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = await client.GetTeamsCapabilityPlansAsync(""); +]]> + + + +This sample shows how to call GetTeamsCapabilityPlans. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = client.GetTeamsCapabilityPlans(""); +]]> +This sample shows how to call GetTeamsCapabilityPlans with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = client.GetTeamsCapabilityPlans(""); +]]> + + + +This sample shows how to call GetTeamsCapabilityPlansAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = await client.GetTeamsCapabilityPlansAsync("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("supportsTollFree").ToString()); +]]> +This sample shows how to call GetTeamsCapabilityPlansAsync with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = await client.GetTeamsCapabilityPlansAsync("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("offerTypes")[0].ToString()); +Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("mandatoryCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("choosableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("supportsTollFree").ToString()); +]]> + + + +This sample shows how to call GetTeamsCapabilityPlans and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = client.GetTeamsCapabilityPlans("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("supportsTollFree").ToString()); +]]> +This sample shows how to call GetTeamsCapabilityPlans with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = client.GetTeamsCapabilityPlans("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("offerTypes")[0].ToString()); +Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("usage").ToString()); +Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("mandatoryCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("choosableCapabilities")[0].ToString()); +Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("supportsTollFree").ToString()); +]]> + + + +This sample shows how to call GetTeamsAvailableCapabilitiesAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +NumberIdentifiers body = new NumberIdentifiers(new NumberIdentifier[] +{ + new NumberIdentifier("") +}); +Response response = await client.GetTeamsAvailableCapabilitiesAsync("", body); +]]> +This sample shows how to call GetTeamsAvailableCapabilitiesAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +NumberIdentifiers body = new NumberIdentifiers(new NumberIdentifier[] +{ + new NumberIdentifier("") +}); +Response response = await client.GetTeamsAvailableCapabilitiesAsync("", body); +]]> + + + +This sample shows how to call GetTeamsAvailableCapabilities. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +NumberIdentifiers body = new NumberIdentifiers(new NumberIdentifier[] +{ + new NumberIdentifier("") +}); +Response response = client.GetTeamsAvailableCapabilities("", body); +]]> +This sample shows how to call GetTeamsAvailableCapabilities with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +NumberIdentifiers body = new NumberIdentifiers(new NumberIdentifier[] +{ + new NumberIdentifier("") +}); +Response response = client.GetTeamsAvailableCapabilities("", body); +]]> + + + +This sample shows how to call GetTeamsAvailableCapabilitiesAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +using RequestContent content = RequestContent.Create(new +{ + numbers = new object[] + { + new + { + telephoneNumber = "", + } + }, +}); +Response response = await client.GetTeamsAvailableCapabilitiesAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("availableCapabilities")[0].ToString()); +]]> +This sample shows how to call GetTeamsAvailableCapabilitiesAsync with all parameters and request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +using RequestContent content = RequestContent.Create(new +{ + numbers = new object[] + { + new + { + telephoneNumber = "", + } + }, +}); +Response response = await client.GetTeamsAvailableCapabilitiesAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("availableCapabilities")[0].ToString()); +]]> + + + +This sample shows how to call GetTeamsAvailableCapabilities and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +using RequestContent content = RequestContent.Create(new +{ + numbers = new object[] + { + new + { + telephoneNumber = "", + } + }, +}); +Response response = client.GetTeamsAvailableCapabilities("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("availableCapabilities")[0].ToString()); +]]> +This sample shows how to call GetTeamsAvailableCapabilities with all parameters and request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +using RequestContent content = RequestContent.Create(new +{ + numbers = new object[] + { + new + { + telephoneNumber = "", + } + }, +}); +Response response = client.GetTeamsAvailableCapabilities("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("availableCapabilities")[0].ToString()); +]]> + + + +This sample shows how to call GetTeamsCivicAddressAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = await client.GetTeamsCivicAddressAsync("", ""); +]]> +This sample shows how to call GetTeamsCivicAddressAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = await client.GetTeamsCivicAddressAsync("", "", requestConditions: null); +]]> + + + +This sample shows how to call GetTeamsCivicAddress. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = client.GetTeamsCivicAddress("", ""); +]]> +This sample shows how to call GetTeamsCivicAddress with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = client.GetTeamsCivicAddress("", "", requestConditions: null); +]]> + + + +This sample shows how to call GetTeamsCivicAddressAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = await client.GetTeamsCivicAddressAsync("", "", null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("defaultLocationId").ToString()); +]]> +This sample shows how to call GetTeamsCivicAddressAsync with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = await client.GetTeamsCivicAddressAsync("", "", null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("country").ToString()); +Console.WriteLine(result.GetProperty("houseNumber").ToString()); +Console.WriteLine(result.GetProperty("houseNumberSuffix").ToString()); +Console.WriteLine(result.GetProperty("preDirectional").ToString()); +Console.WriteLine(result.GetProperty("streetName").ToString()); +Console.WriteLine(result.GetProperty("streetSuffix").ToString()); +Console.WriteLine(result.GetProperty("postDirectional").ToString()); +Console.WriteLine(result.GetProperty("stateOrProvince").ToString()); +Console.WriteLine(result.GetProperty("countyOrDistrict").ToString()); +Console.WriteLine(result.GetProperty("cityOrTown").ToString()); +Console.WriteLine(result.GetProperty("cityOrTownAlias").ToString()); +Console.WriteLine(result.GetProperty("postalOrZipCode").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("companyName").ToString()); +Console.WriteLine(result.GetProperty("companyId").ToString()); +Console.WriteLine(result.GetProperty("defaultLocationId").ToString()); +Console.WriteLine(result.GetProperty("validationStatus").ToString()); +Console.WriteLine(result.GetProperty("tenantId").ToString()); +Console.WriteLine(result.GetProperty("partnerId").ToString()); +Console.WriteLine(result.GetProperty("locations")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("locations")[0].GetProperty("civicAddressId").ToString()); +Console.WriteLine(result.GetProperty("locations")[0].GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("locations")[0].GetProperty("additionalInfo").ToString()); +Console.WriteLine(result.GetProperty("locations")[0].GetProperty("isDefault").ToString()); +Console.WriteLine(result.GetProperty("locations")[0].GetProperty("elin").ToString()); +Console.WriteLine(result.GetProperty("latitude").ToString()); +Console.WriteLine(result.GetProperty("longitude").ToString()); +]]> + + + +This sample shows how to call GetTeamsCivicAddress and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = client.GetTeamsCivicAddress("", "", null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("defaultLocationId").ToString()); +]]> +This sample shows how to call GetTeamsCivicAddress with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +Response response = client.GetTeamsCivicAddress("", "", null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("country").ToString()); +Console.WriteLine(result.GetProperty("houseNumber").ToString()); +Console.WriteLine(result.GetProperty("houseNumberSuffix").ToString()); +Console.WriteLine(result.GetProperty("preDirectional").ToString()); +Console.WriteLine(result.GetProperty("streetName").ToString()); +Console.WriteLine(result.GetProperty("streetSuffix").ToString()); +Console.WriteLine(result.GetProperty("postDirectional").ToString()); +Console.WriteLine(result.GetProperty("stateOrProvince").ToString()); +Console.WriteLine(result.GetProperty("countyOrDistrict").ToString()); +Console.WriteLine(result.GetProperty("cityOrTown").ToString()); +Console.WriteLine(result.GetProperty("cityOrTownAlias").ToString()); +Console.WriteLine(result.GetProperty("postalOrZipCode").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("companyName").ToString()); +Console.WriteLine(result.GetProperty("companyId").ToString()); +Console.WriteLine(result.GetProperty("defaultLocationId").ToString()); +Console.WriteLine(result.GetProperty("validationStatus").ToString()); +Console.WriteLine(result.GetProperty("tenantId").ToString()); +Console.WriteLine(result.GetProperty("partnerId").ToString()); +Console.WriteLine(result.GetProperty("locations")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("locations")[0].GetProperty("civicAddressId").ToString()); +Console.WriteLine(result.GetProperty("locations")[0].GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("locations")[0].GetProperty("additionalInfo").ToString()); +Console.WriteLine(result.GetProperty("locations")[0].GetProperty("isDefault").ToString()); +Console.WriteLine(result.GetProperty("locations")[0].GetProperty("elin").ToString()); +Console.WriteLine(result.GetProperty("latitude").ToString()); +Console.WriteLine(result.GetProperty("longitude").ToString()); +]]> + + + +This sample shows how to call GetAccountResourcesAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +await foreach (AccountResource item in client.GetAccountResourcesAsync()) +{ +} +]]> +This sample shows how to call GetAccountResourcesAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +await foreach (AccountResource item in client.GetAccountResourcesAsync(maxCount: 1234, skip: 1234, maxpagesize: 1234, filter: "", countRecords: true)) +{ +} +]]> + + + +This sample shows how to call GetAccountResources. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +foreach (AccountResource item in client.GetAccountResources()) +{ +} +]]> +This sample shows how to call GetAccountResources with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +foreach (AccountResource item in client.GetAccountResources(maxCount: 1234, skip: 1234, maxpagesize: 1234, filter: "", countRecords: true)) +{ +} +]]> + + + +This sample shows how to call GetAccountResourcesAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +await foreach (BinaryData item in client.GetAccountResourcesAsync(null, null, null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); +} +]]> +This sample shows how to call GetAccountResourcesAsync with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +await foreach (BinaryData item in client.GetAccountResourcesAsync(1234, 1234, 1234, "", true, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("correlationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsTenantId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("callScreening").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomain").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region1Token").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region2Token").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("subdomainStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("numberCount").ToString()); +} +]]> + + + +This sample shows how to call GetAccountResources and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +foreach (BinaryData item in client.GetAccountResources(null, null, null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); +} +]]> +This sample shows how to call GetAccountResources with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +foreach (BinaryData item in client.GetAccountResources(1234, 1234, 1234, "", true, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("correlationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsTenantId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("callScreening").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomain").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region1Token").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region2Token").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("subdomainStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("numberCount").ToString()); +} +]]> + + + +This sample shows how to call GetNumbersAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +await foreach (NumberResource item in client.GetNumbersAsync("")) +{ +} +]]> +This sample shows how to call GetNumbersAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +await foreach (NumberResource item in client.GetNumbersAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234, filter: "", countRecords: true)) +{ +} +]]> + + + +This sample shows how to call GetNumbers. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +foreach (NumberResource item in client.GetNumbers("")) +{ +} +]]> +This sample shows how to call GetNumbers with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +foreach (NumberResource item in client.GetNumbers("", maxCount: 1234, skip: 1234, maxpagesize: 1234, filter: "", countRecords: true)) +{ +} +]]> + + + +This sample shows how to call GetNumbersAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +await foreach (BinaryData item in client.GetNumbersAsync("", null, null, null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").ToString()); +} +]]> +This sample shows how to call GetNumbersAsync with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +await foreach (BinaryData item in client.GetNumbersAsync("", 1234, 1234, 1234, "", true, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("configuration").GetProperty("customSipHeader").ToString()); +} +]]> + + + +This sample shows how to call GetNumbers and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +foreach (BinaryData item in client.GetNumbers("", null, null, null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").ToString()); +} +]]> +This sample shows how to call GetNumbers with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +foreach (BinaryData item in client.GetNumbers("", 1234, 1234, 1234, "", true, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("configuration").GetProperty("customSipHeader").ToString()); +} +]]> + + + +This sample shows how to call GetTeamsCivicAddressesAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +await foreach (TeamsCivicAddressResource item in client.GetTeamsCivicAddressesAsync("")) +{ +} +]]> +This sample shows how to call GetTeamsCivicAddressesAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +await foreach (TeamsCivicAddressResource item in client.GetTeamsCivicAddressesAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234, filter: "", countRecords: true)) +{ +} +]]> + + + +This sample shows how to call GetTeamsCivicAddresses. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +foreach (TeamsCivicAddressResource item in client.GetTeamsCivicAddresses("")) +{ +} +]]> +This sample shows how to call GetTeamsCivicAddresses with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +foreach (TeamsCivicAddressResource item in client.GetTeamsCivicAddresses("", maxCount: 1234, skip: 1234, maxpagesize: 1234, filter: "", countRecords: true)) +{ +} +]]> + + + +This sample shows how to call GetTeamsCivicAddressesAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +await foreach (BinaryData item in client.GetTeamsCivicAddressesAsync("", null, null, null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("defaultLocationId").ToString()); +} +]]> +This sample shows how to call GetTeamsCivicAddressesAsync with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +await foreach (BinaryData item in client.GetTeamsCivicAddressesAsync("", 1234, 1234, 1234, "", true, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("country").ToString()); + Console.WriteLine(result.GetProperty("houseNumber").ToString()); + Console.WriteLine(result.GetProperty("houseNumberSuffix").ToString()); + Console.WriteLine(result.GetProperty("preDirectional").ToString()); + Console.WriteLine(result.GetProperty("streetName").ToString()); + Console.WriteLine(result.GetProperty("streetSuffix").ToString()); + Console.WriteLine(result.GetProperty("postDirectional").ToString()); + Console.WriteLine(result.GetProperty("stateOrProvince").ToString()); + Console.WriteLine(result.GetProperty("countyOrDistrict").ToString()); + Console.WriteLine(result.GetProperty("cityOrTown").ToString()); + Console.WriteLine(result.GetProperty("cityOrTownAlias").ToString()); + Console.WriteLine(result.GetProperty("postalOrZipCode").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("companyName").ToString()); + Console.WriteLine(result.GetProperty("companyId").ToString()); + Console.WriteLine(result.GetProperty("defaultLocationId").ToString()); + Console.WriteLine(result.GetProperty("validationStatus").ToString()); + Console.WriteLine(result.GetProperty("tenantId").ToString()); + Console.WriteLine(result.GetProperty("partnerId").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("additionalInfo").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("isDefault").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("elin").ToString()); + Console.WriteLine(result.GetProperty("latitude").ToString()); + Console.WriteLine(result.GetProperty("longitude").ToString()); +} +]]> + + + +This sample shows how to call GetTeamsCivicAddresses and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +foreach (BinaryData item in client.GetTeamsCivicAddresses("", null, null, null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("defaultLocationId").ToString()); +} +]]> +This sample shows how to call GetTeamsCivicAddresses with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + +foreach (BinaryData item in client.GetTeamsCivicAddresses("", 1234, 1234, 1234, "", true, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("country").ToString()); + Console.WriteLine(result.GetProperty("houseNumber").ToString()); + Console.WriteLine(result.GetProperty("houseNumberSuffix").ToString()); + Console.WriteLine(result.GetProperty("preDirectional").ToString()); + Console.WriteLine(result.GetProperty("streetName").ToString()); + Console.WriteLine(result.GetProperty("streetSuffix").ToString()); + Console.WriteLine(result.GetProperty("postDirectional").ToString()); + Console.WriteLine(result.GetProperty("stateOrProvince").ToString()); + Console.WriteLine(result.GetProperty("countyOrDistrict").ToString()); + Console.WriteLine(result.GetProperty("cityOrTown").ToString()); + Console.WriteLine(result.GetProperty("cityOrTownAlias").ToString()); + Console.WriteLine(result.GetProperty("postalOrZipCode").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("companyName").ToString()); + Console.WriteLine(result.GetProperty("companyId").ToString()); + Console.WriteLine(result.GetProperty("defaultLocationId").ToString()); + Console.WriteLine(result.GetProperty("validationStatus").ToString()); + Console.WriteLine(result.GetProperty("tenantId").ToString()); + Console.WriteLine(result.GetProperty("partnerId").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("additionalInfo").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("isDefault").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("elin").ToString()); + Console.WriteLine(result.GetProperty("latitude").ToString()); + Console.WriteLine(result.GetProperty("longitude").ToString()); +} +]]> + + + \ No newline at end of file diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Docs/TeamsRequestsForInformation.xml b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Docs/TeamsRequestsForInformation.xml new file mode 100644 index 000000000000..0a6481c05eb9 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Docs/TeamsRequestsForInformation.xml @@ -0,0 +1,411 @@ + + + + + +This sample shows how to call GetRequestForInformationAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + +Response response = await client.GetRequestForInformationAsync(""); +]]> +This sample shows how to call GetRequestForInformationAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + +Response response = await client.GetRequestForInformationAsync("", requestConditions: null); +]]> + + + +This sample shows how to call GetRequestForInformation. +"); +TokenCredential credential = new DefaultAzureCredential(); +TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + +Response response = client.GetRequestForInformation(""); +]]> +This sample shows how to call GetRequestForInformation with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + +Response response = client.GetRequestForInformation("", requestConditions: null); +]]> + + + +This sample shows how to call GetRequestForInformationAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + +Response response = await client.GetRequestForInformationAsync("", null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("tenantId").ToString()); +]]> +This sample shows how to call GetRequestForInformationAsync with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + +Response response = await client.GetRequestForInformationAsync("", null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("tenantId").ToString()); +Console.WriteLine(result.GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("productContext").ToString()); +Console.WriteLine(result.GetProperty("operatorId").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("consentedOn").ToString()); +Console.WriteLine(result.GetProperty("lastModifiedOn").ToString()); +Console.WriteLine(result.GetProperty("consentedCountries")[0].ToString()); +Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("fullName").ToString()); +Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("email").ToString()); +Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("telephoneNumber").ToString()); +Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companyName").ToString()); +Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companySize").ToString()); +Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("lastModifiedOn").ToString()); +Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("comment").ToString()); +]]> + + + +This sample shows how to call GetRequestForInformation and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + +Response response = client.GetRequestForInformation("", null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("tenantId").ToString()); +]]> +This sample shows how to call GetRequestForInformation with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + +Response response = client.GetRequestForInformation("", null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("tenantId").ToString()); +Console.WriteLine(result.GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("productContext").ToString()); +Console.WriteLine(result.GetProperty("operatorId").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("consentedOn").ToString()); +Console.WriteLine(result.GetProperty("lastModifiedOn").ToString()); +Console.WriteLine(result.GetProperty("consentedCountries")[0].ToString()); +Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("fullName").ToString()); +Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("email").ToString()); +Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("telephoneNumber").ToString()); +Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companyName").ToString()); +Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companySize").ToString()); +Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("lastModifiedOn").ToString()); +Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("comment").ToString()); +]]> + + + +This sample shows how to call CreateOrUpdateRequestForInformationAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + +using RequestContent content = RequestContent.Create(new object()); +Response response = await client.CreateOrUpdateRequestForInformationAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("tenantId").ToString()); +]]> +This sample shows how to call CreateOrUpdateRequestForInformationAsync with all parameters and request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + +using RequestContent content = RequestContent.Create(new +{ + customerRelationship = new + { + status = "", + comment = "", + }, +}); +Response response = await client.CreateOrUpdateRequestForInformationAsync("", content, requestConditions: null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("tenantId").ToString()); +Console.WriteLine(result.GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("productContext").ToString()); +Console.WriteLine(result.GetProperty("operatorId").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("consentedOn").ToString()); +Console.WriteLine(result.GetProperty("lastModifiedOn").ToString()); +Console.WriteLine(result.GetProperty("consentedCountries")[0].ToString()); +Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("fullName").ToString()); +Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("email").ToString()); +Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("telephoneNumber").ToString()); +Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companyName").ToString()); +Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companySize").ToString()); +Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("lastModifiedOn").ToString()); +Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("comment").ToString()); +]]> + + + +This sample shows how to call CreateOrUpdateRequestForInformation and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + +using RequestContent content = RequestContent.Create(new object()); +Response response = client.CreateOrUpdateRequestForInformation("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("tenantId").ToString()); +]]> +This sample shows how to call CreateOrUpdateRequestForInformation with all parameters and request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + +using RequestContent content = RequestContent.Create(new +{ + customerRelationship = new + { + status = "", + comment = "", + }, +}); +Response response = client.CreateOrUpdateRequestForInformation("", content, requestConditions: null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("tenantId").ToString()); +Console.WriteLine(result.GetProperty("accountName").ToString()); +Console.WriteLine(result.GetProperty("productContext").ToString()); +Console.WriteLine(result.GetProperty("operatorId").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("consentedOn").ToString()); +Console.WriteLine(result.GetProperty("lastModifiedOn").ToString()); +Console.WriteLine(result.GetProperty("consentedCountries")[0].ToString()); +Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("fullName").ToString()); +Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("email").ToString()); +Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("telephoneNumber").ToString()); +Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companyName").ToString()); +Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companySize").ToString()); +Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("lastModifiedOn").ToString()); +Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("comment").ToString()); +]]> + + + +This sample shows how to call GetRequestForInformationResourcesAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + +await foreach (RequestForInformationResource item in client.GetRequestForInformationResourcesAsync()) +{ +} +]]> +This sample shows how to call GetRequestForInformationResourcesAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + +await foreach (RequestForInformationResource item in client.GetRequestForInformationResourcesAsync(maxCount: 1234, skip: 1234, maxpagesize: 1234, filter: "", countRecords: true)) +{ +} +]]> + + + +This sample shows how to call GetRequestForInformationResources. +"); +TokenCredential credential = new DefaultAzureCredential(); +TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + +foreach (RequestForInformationResource item in client.GetRequestForInformationResources()) +{ +} +]]> +This sample shows how to call GetRequestForInformationResources with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + +foreach (RequestForInformationResource item in client.GetRequestForInformationResources(maxCount: 1234, skip: 1234, maxpagesize: 1234, filter: "", countRecords: true)) +{ +} +]]> + + + +This sample shows how to call GetRequestForInformationResourcesAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + +await foreach (BinaryData item in client.GetRequestForInformationResourcesAsync(null, null, null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("tenantId").ToString()); +} +]]> +This sample shows how to call GetRequestForInformationResourcesAsync with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + +await foreach (BinaryData item in client.GetRequestForInformationResourcesAsync(1234, 1234, 1234, "", true, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("tenantId").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("productContext").ToString()); + Console.WriteLine(result.GetProperty("operatorId").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("consentedOn").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedOn").ToString()); + Console.WriteLine(result.GetProperty("consentedCountries")[0].ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("fullName").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("email").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companyName").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companySize").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("lastModifiedOn").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("comment").ToString()); +} +]]> + + + +This sample shows how to call GetRequestForInformationResources and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + +foreach (BinaryData item in client.GetRequestForInformationResources(null, null, null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("tenantId").ToString()); +} +]]> +This sample shows how to call GetRequestForInformationResources with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + +foreach (BinaryData item in client.GetRequestForInformationResources(1234, 1234, 1234, "", true, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("tenantId").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("productContext").ToString()); + Console.WriteLine(result.GetProperty("operatorId").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("consentedOn").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedOn").ToString()); + Console.WriteLine(result.GetProperty("consentedCountries")[0].ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("fullName").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("email").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companyName").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companySize").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("lastModifiedOn").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("comment").ToString()); +} +]]> + + + \ No newline at end of file diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Docs/VoiceServicesClient.xml b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Docs/VoiceServicesClient.xml new file mode 100644 index 000000000000..fef7a0bd3e8d --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Docs/VoiceServicesClient.xml @@ -0,0 +1,181 @@ + + + + + +This sample shows how to call GetNumbersAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +VoiceServicesClient client = new VoiceServicesClient(endpoint, credential); + +await foreach (NumberResource item in client.GetNumbersAsync()) +{ +} +]]> +This sample shows how to call GetNumbersAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +VoiceServicesClient client = new VoiceServicesClient(endpoint, credential); + +await foreach (NumberResource item in client.GetNumbersAsync(maxCount: 1234, skip: 1234, maxpagesize: 1234, filter: "", countRecords: true)) +{ +} +]]> + + + +This sample shows how to call GetNumbers. +"); +TokenCredential credential = new DefaultAzureCredential(); +VoiceServicesClient client = new VoiceServicesClient(endpoint, credential); + +foreach (NumberResource item in client.GetNumbers()) +{ +} +]]> +This sample shows how to call GetNumbers with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +VoiceServicesClient client = new VoiceServicesClient(endpoint, credential); + +foreach (NumberResource item in client.GetNumbers(maxCount: 1234, skip: 1234, maxpagesize: 1234, filter: "", countRecords: true)) +{ +} +]]> + + + +This sample shows how to call GetNumbersAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +VoiceServicesClient client = new VoiceServicesClient(endpoint, credential); + +await foreach (BinaryData item in client.GetNumbersAsync(null, null, null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").ToString()); +} +]]> +This sample shows how to call GetNumbersAsync with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +VoiceServicesClient client = new VoiceServicesClient(endpoint, credential); + +await foreach (BinaryData item in client.GetNumbersAsync(1234, 1234, 1234, "", true, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("configuration").GetProperty("customSipHeader").ToString()); +} +]]> + + + +This sample shows how to call GetNumbers and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +VoiceServicesClient client = new VoiceServicesClient(endpoint, credential); + +foreach (BinaryData item in client.GetNumbers(null, null, null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").ToString()); +} +]]> +This sample shows how to call GetNumbers with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +VoiceServicesClient client = new VoiceServicesClient(endpoint, credential); + +foreach (BinaryData item in client.GetNumbers(1234, 1234, 1234, "", true, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("configuration").GetProperty("customSipHeader").ToString()); +} +]]> + + + \ No newline at end of file diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/Argument.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..17d6ef6480c9 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/Argument.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + internal static class Argument + { + public static void AssertNotNull(T value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNull(T? value, string name) + where T : struct + { + if (!value.HasValue) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNullOrEmpty(IEnumerable value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value is ICollection collectionOfT && collectionOfT.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + if (value is ICollection collection && collection.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + using IEnumerator e = value.GetEnumerator(); + if (!e.MoveNext()) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + } + + public static void AssertNotNullOrEmpty(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value.Length == 0) + { + throw new ArgumentException("Value cannot be an empty string.", name); + } + } + + public static void AssertNotNullOrWhiteSpace(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (string.IsNullOrWhiteSpace(value)) + { + throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name); + } + } + + public static void AssertNotDefault(ref T value, string name) + where T : struct, IEquatable + { + if (value.Equals(default)) + { + throw new ArgumentException("Value cannot be empty.", name); + } + } + + public static void AssertInRange(T value, T minimum, T maximum, string name) + where T : notnull, IComparable + { + if (minimum.CompareTo(value) > 0) + { + throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed."); + } + if (maximum.CompareTo(value) < 0) + { + throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed."); + } + } + + public static void AssertEnumDefined(Type enumType, object value, string name) + { + if (!Enum.IsDefined(enumType, value)) + { + throw new ArgumentException($"Value not defined for {enumType.FullName}.", name); + } + } + + public static T CheckNotNull(T value, string name) + where T : class + { + AssertNotNull(value, name); + return value; + } + + public static string CheckNotNullOrEmpty(string value, string name) + { + AssertNotNullOrEmpty(value, name); + return value; + } + + public static void AssertNull(T value, string name, string message = null) + { + if (value != null) + { + throw new ArgumentException(message ?? "Value must be null.", name); + } + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..b48d55916b5b --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull + { + private IDictionary _innerDictionary; + + public ChangeTrackingDictionary() + { + } + + public ChangeTrackingDictionary(IDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(dictionary); + } + + public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(); + foreach (var pair in dictionary) + { + _innerDictionary.Add(pair); + } + } + + public bool IsUndefined => _innerDictionary == null; + + public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + + public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + + public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + + public TValue this[TKey key] + { + get + { + if (IsUndefined) + { + throw new KeyNotFoundException(nameof(key)); + } + return EnsureDictionary()[key]; + } + set + { + EnsureDictionary()[key] = value; + } + } + + IEnumerable IReadOnlyDictionary.Keys => Keys; + + IEnumerable IReadOnlyDictionary.Values => Values; + + public IEnumerator> GetEnumerator() + { + if (IsUndefined) + { + IEnumerator> enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureDictionary().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(KeyValuePair item) + { + EnsureDictionary().Add(item); + } + + public void Clear() + { + EnsureDictionary().Clear(); + } + + public bool Contains(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Contains(item); + } + + public void CopyTo(KeyValuePair[] array, int index) + { + if (IsUndefined) + { + return; + } + EnsureDictionary().CopyTo(array, index); + } + + public bool Remove(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(item); + } + + public void Add(TKey key, TValue value) + { + EnsureDictionary().Add(key, value); + } + + public bool ContainsKey(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().ContainsKey(key); + } + + public bool Remove(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(key); + } + + public bool TryGetValue(TKey key, out TValue value) + { + if (IsUndefined) + { + value = default; + return false; + } + return EnsureDictionary().TryGetValue(key, out value); + } + + public IDictionary EnsureDictionary() + { + return _innerDictionary ??= new Dictionary(); + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/ChangeTrackingList.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..5758e18aa7f5 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/ChangeTrackingList.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.VoiceServices.Provisioning +{ + internal class ChangeTrackingList : IList, IReadOnlyList + { + private IList _innerList; + + public ChangeTrackingList() + { + } + + public ChangeTrackingList(IList innerList) + { + if (innerList != null) + { + _innerList = innerList; + } + } + + public ChangeTrackingList(IReadOnlyList innerList) + { + if (innerList != null) + { + _innerList = innerList.ToList(); + } + } + + public bool IsUndefined => _innerList == null; + + public int Count => IsUndefined ? 0 : EnsureList().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + + public T this[int index] + { + get + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + return EnsureList()[index]; + } + set + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList()[index] = value; + } + } + + public void Reset() + { + _innerList = null; + } + + public IEnumerator GetEnumerator() + { + if (IsUndefined) + { + IEnumerator enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureList().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(T item) + { + EnsureList().Add(item); + } + + public void Clear() + { + EnsureList().Clear(); + } + + public bool Contains(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Contains(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + if (IsUndefined) + { + return; + } + EnsureList().CopyTo(array, arrayIndex); + } + + public bool Remove(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Remove(item); + } + + public int IndexOf(T item) + { + if (IsUndefined) + { + return -1; + } + return EnsureList().IndexOf(item); + } + + public void Insert(int index, T item) + { + EnsureList().Insert(index, item); + } + + public void RemoveAt(int index) + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList().RemoveAt(index); + } + + public IList EnsureList() + { + return _innerList ??= new List(); + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..f824c3b6f6d6 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,398 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.Text.Json; +using System.Xml; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + internal static class ModelSerializationExtensions + { + internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + + public static object GetObject(this JsonElement element) + { + switch (element.ValueKind) + { + case JsonValueKind.String: + return element.GetString(); + case JsonValueKind.Number: + if (element.TryGetInt32(out int intValue)) + { + return intValue; + } + if (element.TryGetInt64(out long longValue)) + { + return longValue; + } + return element.GetDouble(); + case JsonValueKind.True: + return true; + case JsonValueKind.False: + return false; + case JsonValueKind.Undefined: + case JsonValueKind.Null: + return null; + case JsonValueKind.Object: + var dictionary = new Dictionary(); + foreach (var jsonProperty in element.EnumerateObject()) + { + dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject()); + } + return dictionary; + case JsonValueKind.Array: + var list = new List(); + foreach (var item in element.EnumerateArray()) + { + list.Add(item.GetObject()); + } + return list.ToArray(); + default: + throw new NotSupportedException($"Not supported value kind {element.ValueKind}"); + } + } + + public static byte[] GetBytesFromBase64(this JsonElement element, string format) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + + return format switch + { + "U" => TypeFormatters.FromBase64UrlString(element.GetRequiredString()), + "D" => element.GetBytesFromBase64(), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + } + + public static DateTimeOffset GetDateTimeOffset(this JsonElement element, string format) => format switch + { + "U" when element.ValueKind == JsonValueKind.Number => DateTimeOffset.FromUnixTimeSeconds(element.GetInt64()), + _ => TypeFormatters.ParseDateTimeOffset(element.GetString(), format) + }; + + public static TimeSpan GetTimeSpan(this JsonElement element, string format) => TypeFormatters.ParseTimeSpan(element.GetString(), format); + + public static char GetChar(this JsonElement element) + { + if (element.ValueKind == JsonValueKind.String) + { + var text = element.GetString(); + if (text == null || text.Length != 1) + { + throw new NotSupportedException($"Cannot convert \"{text}\" to a char"); + } + return text[0]; + } + else + { + throw new NotSupportedException($"Cannot convert {element.ValueKind} to a char"); + } + } + + [Conditional("DEBUG")] + public static void ThrowNonNullablePropertyIsNull(this JsonProperty property) + { + throw new JsonException($"A property '{property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); + } + + public static string GetRequiredString(this JsonElement element) + { + var value = element.GetString(); + if (value == null) + { + throw new InvalidOperationException($"The requested operation requires an element of type 'String', but the target element has type '{element.ValueKind}'."); + } + return value; + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTime value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, TimeSpan value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, char value) + { + writer.WriteStringValue(value.ToString(CultureInfo.InvariantCulture)); + } + + public static void WriteBase64StringValue(this Utf8JsonWriter writer, byte[] value, string format) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + switch (format) + { + case "U": + writer.WriteStringValue(TypeFormatters.ToBase64UrlString(value)); + break; + case "D": + writer.WriteBase64StringValue(value); + break; + default: + throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)); + } + } + + public static void WriteNumberValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + if (format != "U") + { + throw new ArgumentOutOfRangeException(nameof(format), "Only 'U' format is supported when writing a DateTimeOffset as a Number."); + } + writer.WriteNumberValue(value.ToUnixTimeSeconds()); + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, T value, ModelReaderWriterOptions options = null) + { + switch (value) + { + case null: + writer.WriteNullValue(); + break; + case IJsonModel jsonModel: + jsonModel.Write(writer, options ?? WireOptions); + break; + case IUtf8JsonSerializable serializable: + serializable.Write(writer); + break; + case byte[] bytes: + writer.WriteBase64StringValue(bytes); + break; + case BinaryData bytes0: + writer.WriteBase64StringValue(bytes0); + break; + case JsonElement json: + json.WriteTo(writer); + break; + case int i: + writer.WriteNumberValue(i); + break; + case decimal d: + writer.WriteNumberValue(d); + break; + case double d0: + if (double.IsNaN(d0)) + { + writer.WriteStringValue("NaN"); + } + else + { + writer.WriteNumberValue(d0); + } + break; + case float f: + writer.WriteNumberValue(f); + break; + case long l: + writer.WriteNumberValue(l); + break; + case string s: + writer.WriteStringValue(s); + break; + case bool b: + writer.WriteBooleanValue(b); + break; + case Guid g: + writer.WriteStringValue(g); + break; + case DateTimeOffset dateTimeOffset: + writer.WriteStringValue(dateTimeOffset, "O"); + break; + case DateTime dateTime: + writer.WriteStringValue(dateTime, "O"); + break; + case IEnumerable> enumerable: + writer.WriteStartObject(); + foreach (var pair in enumerable) + { + writer.WritePropertyName(pair.Key); + writer.WriteObjectValue(pair.Value, options); + } + writer.WriteEndObject(); + break; + case IEnumerable objectEnumerable: + writer.WriteStartArray(); + foreach (var item in objectEnumerable) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + break; + case TimeSpan timeSpan: + writer.WriteStringValue(timeSpan, "P"); + break; + default: + throw new NotSupportedException($"Not supported type {value.GetType()}"); + } + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, object value, ModelReaderWriterOptions options = null) + { + writer.WriteObjectValue(value, options); + } + + internal static class TypeFormatters + { + private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; + public const string DefaultNumberFormat = "G"; + + public static string ToString(bool value) => value ? "true" : "false"; + + public static string ToString(DateTime value, string format) => value.Kind switch + { + DateTimeKind.Utc => ToString((DateTimeOffset)value, format), + _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Azure SDK requires it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") + }; + + public static string ToString(DateTimeOffset value, string format) => format switch + { + "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), + "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), + "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "R" => value.ToString("r", CultureInfo.InvariantCulture), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(TimeSpan value, string format) => format switch + { + "P" => XmlConvert.ToString(value), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(byte[] value, string format) => format switch + { + "U" => ToBase64UrlString(value), + "D" => Convert.ToBase64String(value), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + + public static string ToBase64UrlString(byte[] value) + { + int numWholeOrPartialInputBlocks = checked(value.Length + 2) / 3; + int size = checked(numWholeOrPartialInputBlocks * 4); + char[] output = new char[size]; + + int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); + + int i = 0; + for (; i < numBase64Chars; i++) + { + char ch = output[i]; + if (ch == '+') + { + output[i] = '-'; + } + else + { + if (ch == '/') + { + output[i] = '_'; + } + else + { + if (ch == '=') + { + break; + } + } + } + } + + return new string(output, 0, i); + } + + public static byte[] FromBase64UrlString(string value) + { + int paddingCharsToAdd = (value.Length % 4) switch + { + 0 => 0, + 2 => 2, + 3 => 1, + _ => throw new InvalidOperationException("Malformed input") + }; + char[] output = new char[(value.Length + paddingCharsToAdd)]; + int i = 0; + for (; i < value.Length; i++) + { + char ch = value[i]; + if (ch == '-') + { + output[i] = '+'; + } + else + { + if (ch == '_') + { + output[i] = '/'; + } + else + { + output[i] = ch; + } + } + } + + for (; i < output.Length; i++) + { + output[i] = '='; + } + + return Convert.FromBase64CharArray(output, 0, output.Length); + } + + public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch + { + "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), + _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) + }; + + public static TimeSpan ParseTimeSpan(string value, string format) => format switch + { + "P" => XmlConvert.ToTimeSpan(value), + _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) + }; + + public static string ConvertToString(object value, string format = null) => value switch + { + null => "null", + string s => s, + bool b => ToString(b), + int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), + byte[] b0 when format != null => ToString(b0, format), + IEnumerable s0 => string.Join(",", s0), + DateTimeOffset dateTime when format != null => ToString(dateTime, format), + TimeSpan timeSpan when format != null => ToString(timeSpan, format), + TimeSpan timeSpan0 => XmlConvert.ToString(timeSpan0), + Guid guid => guid.ToString(), + BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), + _ => value.ToString() + }; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/Optional.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..4fbe60521490 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/Optional.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Microsoft.VoiceServices.Provisioning +{ + internal static class Optional + { + public static bool IsCollectionDefined(IEnumerable collection) + { + return !(collection is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined); + } + + public static bool IsCollectionDefined(IDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsCollectionDefined(IReadOnlyDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsDefined(T? value) + where T : struct + { + return value.HasValue; + } + + public static bool IsDefined(object value) + { + return value != null; + } + + public static bool IsDefined(JsonElement value) + { + return value.ValueKind != JsonValueKind.Undefined; + } + + public static bool IsDefined(string value) + { + return value != null; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..b361c3c8ad5f --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Internal/Utf8JsonRequestContent.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.IO; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + internal class Utf8JsonRequestContent : RequestContent + { + private readonly MemoryStream _stream; + private readonly RequestContent _content; + + public Utf8JsonRequestContent() + { + _stream = new MemoryStream(); + _content = Create(_stream); + JsonWriter = new Utf8JsonWriter(_stream); + } + + public Utf8JsonWriter JsonWriter { get; } + + public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) + { + await JsonWriter.FlushAsync().ConfigureAwait(false); + await _content.WriteToAsync(stream, cancellationToken).ConfigureAwait(false); + } + + public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) + { + JsonWriter.Flush(); + _content.WriteTo(stream, cancellationToken); + } + + public override bool TryComputeLength(out long length) + { + length = JsonWriter.BytesCommitted + JsonWriter.BytesPending; + return true; + } + + public override void Dispose() + { + JsonWriter.Dispose(); + _content.Dispose(); + _stream.Dispose(); + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Location.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Location.Serialization.cs new file mode 100644 index 000000000000..0e231fb62b75 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Location.Serialization.cs @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class Location : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Location)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W") + { + writer.WritePropertyName("civicAddressId"u8); + writer.WriteStringValue(CivicAddressId); + } + if (options.Format != "W" && Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (options.Format != "W" && Optional.IsDefined(AdditionalInfo)) + { + writer.WritePropertyName("additionalInfo"u8); + writer.WriteStringValue(AdditionalInfo); + } + if (options.Format != "W" && Optional.IsDefined(IsDefault)) + { + writer.WritePropertyName("isDefault"u8); + writer.WriteBooleanValue(IsDefault.Value); + } + if (options.Format != "W" && Optional.IsDefined(Elin)) + { + writer.WritePropertyName("elin"u8); + writer.WriteStringValue(Elin); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + Location IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Location)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLocation(document.RootElement, options); + } + + internal static Location DeserializeLocation(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + string civicAddressId = default; + string description = default; + string additionalInfo = default; + bool? isDefault = default; + string elin = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("civicAddressId"u8)) + { + civicAddressId = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("additionalInfo"u8)) + { + additionalInfo = property.Value.GetString(); + continue; + } + if (property.NameEquals("isDefault"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDefault = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("elin"u8)) + { + elin = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Location( + id, + civicAddressId, + description, + additionalInfo, + isDefault, + elin, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(Location)} does not support writing '{options.Format}' format."); + } + } + + Location IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeLocation(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Location)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static Location FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeLocation(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Location.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Location.cs new file mode 100644 index 000000000000..99fffa04d81a --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/Location.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// A location used by Team Operator Connect or Teams Phone Mobile telephone numbers. + public partial class Location + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal Location() + { + } + + /// Initializes a new instance of . + /// The ID of the location. + /// The civic address ID of the location. + /// The description of the location. + /// The additional information of the location. + /// Flag indicating whether the location is default or not. + /// The elin (Emergency Location Identification Number) of the location. + /// Keeps track of any properties unknown to the library. + internal Location(string id, string civicAddressId, string description, string additionalInfo, bool? isDefault, string elin, IDictionary serializedAdditionalRawData) + { + Id = id; + CivicAddressId = civicAddressId; + Description = description; + AdditionalInfo = additionalInfo; + IsDefault = isDefault; + Elin = elin; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The ID of the location. + public string Id { get; } + /// The civic address ID of the location. + public string CivicAddressId { get; } + /// The description of the location. + public string Description { get; } + /// The additional information of the location. + public string AdditionalInfo { get; } + /// Flag indicating whether the location is default or not. + public bool? IsDefault { get; } + /// The elin (Emergency Location Identification Number) of the location. + public string Elin { get; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/MicrosoftVoiceServicesProvisioningClientBuilderExtensions.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/MicrosoftVoiceServicesProvisioningClientBuilderExtensions.cs new file mode 100644 index 000000000000..ebbbc8d07fd2 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/MicrosoftVoiceServicesProvisioningClientBuilderExtensions.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core.Extensions; +using Microsoft.VoiceServices.Provisioning; + +namespace Microsoft.Extensions.Azure +{ + /// Extension methods to add to client builder. + public static partial class MicrosoftVoiceServicesProvisioningClientBuilderExtensions + { + /// Registers a instance. + /// The builder to register with. + /// The to use. + public static IAzureClientBuilder AddVoiceServicesClient(this TBuilder builder, Uri endpoint) + where TBuilder : IAzureClientFactoryBuilderWithCredential + { + return builder.RegisterClientFactory((options, cred) => new VoiceServicesClient(endpoint, cred, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// The configuration values. + public static IAzureClientBuilder AddVoiceServicesClient(this TBuilder builder, TConfiguration configuration) + where TBuilder : IAzureClientFactoryBuilderWithConfiguration + { + return builder.RegisterClientFactory(configuration); + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/MicrosoftVoiceServicesProvisioningModelFactory.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/MicrosoftVoiceServicesProvisioningModelFactory.cs new file mode 100644 index 000000000000..b678118022f8 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/MicrosoftVoiceServicesProvisioningModelFactory.cs @@ -0,0 +1,365 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// Model factory for models. + public static partial class MicrosoftVoiceServicesProvisioningModelFactory + { + /// Initializes a new instance of . + /// The status of the provisioning action associated with this resource. + /// Any errors pertaining to the provisioning of this resource. + /// Telephone number in E.164 format. + /// Name of the account. Can only contain letters, numbers, underscores and dashes, and is case-sensitive. Can be up to 100 characters in length. + /// Configuration of the individual backend services for this number. + /// Configuration for this number. + /// A new instance for mocking. + public static NumberResource NumberResource(ServiceProvisioningStatus? serviceProvisioningStatus = null, IEnumerable serviceProvisioningErrors = null, string telephoneNumber = null, string accountName = null, NumberServiceDetails serviceDetails = null, NumberConfiguration configuration = null) + { + serviceProvisioningErrors ??= new List(); + + return new NumberResource( + serviceProvisioningStatus, + serviceProvisioningErrors?.ToList(), + telephoneNumber, + accountName, + serviceDetails, + configuration, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The usage for this telephone number. + /// The choosable capabilities for this telephone number. + /// The acquired capabilities for this telephone number. + /// The available capabilities for this telephone number. + /// The additional usages for this telephone number. + /// The ID of the civic address to be used as the emergency address for this telephone number. + /// The ID of the location to be used as the emergency address for this telephone number. + /// If the enterprise is allowed to update the address for this telephone number. + /// The country code to be displayed with this telephone number. + /// A new instance for mocking. + public static TeamsOperatorConnectNumberConfig TeamsOperatorConnectNumberConfig(string usage = null, IEnumerable choosableCapabilities = null, IEnumerable acquiredCapabilities = null, IEnumerable availableCapabilities = null, IEnumerable additionalUsages = null, string civicAddressId = null, string locationId = null, bool? allowTenantAddressUpdate = null, string displayedCountryCode = null) + { + choosableCapabilities ??= new List(); + acquiredCapabilities ??= new List(); + availableCapabilities ??= new List(); + additionalUsages ??= new List(); + + return new TeamsOperatorConnectNumberConfig( + usage, + choosableCapabilities?.ToList(), + acquiredCapabilities?.ToList(), + availableCapabilities?.ToList(), + additionalUsages?.ToList(), + civicAddressId, + locationId, + allowTenantAddressUpdate, + displayedCountryCode, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The usage for this telephone number. + /// The choosable capabilities for this telephone number. + /// The acquired capabilities for this telephone number. + /// The available capabilities for this telephone number. + /// The additional usages for this telephone number. + /// The ID of the civic address to be used as the emergency address for this telephone number. + /// The ID of the location to be used as the emergency address for this telephone number. + /// If the enterprise is allowed to update the address for this telephone number. + /// The country code to be displayed with this telephone number. + /// A new instance for mocking. + public static TeamsPhoneMobileNumberConfig TeamsPhoneMobileNumberConfig(string usage = null, IEnumerable choosableCapabilities = null, IEnumerable acquiredCapabilities = null, IEnumerable availableCapabilities = null, IEnumerable additionalUsages = null, string civicAddressId = null, string locationId = null, bool? allowTenantAddressUpdate = null, string displayedCountryCode = null) + { + choosableCapabilities ??= new List(); + acquiredCapabilities ??= new List(); + availableCapabilities ??= new List(); + additionalUsages ??= new List(); + + return new TeamsPhoneMobileNumberConfig( + usage, + choosableCapabilities?.ToList(), + acquiredCapabilities?.ToList(), + availableCapabilities?.ToList(), + additionalUsages?.ToList(), + civicAddressId, + locationId, + allowTenantAddressUpdate, + displayedCountryCode, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The status of the provisioning action associated with this resource. + /// Any errors pertaining to the provisioning of this resource. + /// The ID of the Request for Information. + /// The Teams tenant ID which generated this Request for Information. + /// The name of the account associated with this Request for Information. + /// Will always be 'teams'. + /// The operator ID of the operator consent. + /// The status of the operator consent. + /// The time (ISO8601 format) when the operator consent is created. + /// The time (ISO8601 format) when the operator consent is last modified. + /// The list of consented countries. + /// The list of tenant contacts. + /// The customer relationship of the operator consent. + /// A new instance for mocking. + public static RequestForInformationResource RequestForInformationResource(ServiceProvisioningStatus? serviceProvisioningStatus = null, IEnumerable serviceProvisioningErrors = null, string id = null, string tenantId = null, string accountName = null, string productContext = null, string operatorId = null, TeamsConsentStatus? status = null, DateTimeOffset? consentedOn = null, DateTimeOffset? lastModifiedOn = null, IEnumerable consentedCountries = null, IEnumerable contacts = null, CustomerRelationship customerRelationship = null) + { + serviceProvisioningErrors ??= new List(); + consentedCountries ??= new List(); + contacts ??= new List(); + + return new RequestForInformationResource( + serviceProvisioningStatus, + serviceProvisioningErrors?.ToList(), + id, + tenantId, + accountName, + productContext, + operatorId, + status, + consentedOn, + lastModifiedOn, + consentedCountries?.ToList(), + contacts?.ToList(), + customerRelationship, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The full name of the contact detail. + /// The email of the contact detail. + /// The telephone number of the contact detail. + /// The company name of the contact detail. + /// The company size of the contact detail. + /// A new instance for mocking. + public static ContactDetails ContactDetails(string fullName = null, string email = null, string telephoneNumber = null, string companyName = null, string companySize = null) + { + return new ContactDetails( + fullName, + email, + telephoneNumber, + companyName, + companySize, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The status of the customer relationship. + /// The time (ISO8601 format) when the customer relationship is last modified. + /// The comment of the customer relationship. + /// A new instance for mocking. + public static CustomerRelationship CustomerRelationship(string status = null, DateTimeOffset? lastModifiedOn = null, string comment = null) + { + return new CustomerRelationship(status, lastModifiedOn, comment, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The status of the provisioning action associated with this resource. + /// Any errors pertaining to the provisioning of this resource. + /// Name of the account. + /// A user defined identifier used for correlating with external systems. + /// The details of the account. + /// A new instance for mocking. + public static AccountResource AccountResource(ServiceProvisioningStatus? serviceProvisioningStatus = null, IEnumerable serviceProvisioningErrors = null, string name = null, string correlationId = null, AccountServiceDetails serviceDetails = null) + { + serviceProvisioningErrors ??= new List(); + + return new AccountResource( + serviceProvisioningStatus, + serviceProvisioningErrors?.ToList(), + name, + correlationId, + serviceDetails, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Boolean indicating if data is being provisioned through the backend service. + /// Boolean indicating if the service is enabled on this Account. + /// The count of telephone numbers associated with this account that have this backend service enabled. + /// A new instance for mocking. + public static TeamsOperatorConnectAccountDetails TeamsOperatorConnectAccountDetails(bool syncEnabled = default, bool enabled = default, long? numberCount = null) + { + return new TeamsOperatorConnectAccountDetails(syncEnabled, enabled, numberCount, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Boolean indicating if data is being provisioned through the backend service. + /// Boolean indicating if the service is enabled on this Account. + /// The count of telephone numbers associated with this account that have this backend service enabled. + /// The configuration for Teams Direct Routing on this account. + /// The provisioning status of the domains. + /// A new instance for mocking. + public static TeamsDirectRoutingAccountDetails TeamsDirectRoutingAccountDetails(bool syncEnabled = default, bool enabled = default, long? numberCount = null, TeamsDirectRoutingAccountConfig configuration = null, TeamsDirectRoutingSubdomainProvisioningStatus subdomainStatus = default) + { + return new TeamsDirectRoutingAccountDetails( + syncEnabled, + enabled, + numberCount, + configuration, + subdomainStatus, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Boolean indicating if data is being provisioned through the backend service. + /// Boolean indicating if the service is enabled on this Account. + /// The count of telephone numbers associated with this account that have this backend service enabled. + /// A new instance for mocking. + public static TeamsPhoneMobileAccountDetails TeamsPhoneMobileAccountDetails(bool syncEnabled = default, bool enabled = default, long? numberCount = null) + { + return new TeamsPhoneMobileAccountDetails(syncEnabled, enabled, numberCount, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Boolean indicating if data is being provisioned through the backend service. + /// Boolean indicating if the service is enabled on this Account. + /// The count of telephone numbers associated with this account that have this backend service enabled. + /// A new instance for mocking. + public static ZoomPhoneCloudPeeringAccountDetails ZoomPhoneCloudPeeringAccountDetails(bool syncEnabled = default, bool enabled = default, long? numberCount = null) + { + return new ZoomPhoneCloudPeeringAccountDetails(syncEnabled, enabled, numberCount, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Boolean indicating if the service is enabled on this Account. + /// The count of telephone numbers associated with this account that have this backend service enabled. + /// A new instance for mocking. + public static AzureOperatorCallProtectionAccountDetails AzureOperatorCallProtectionAccountDetails(bool enabled = default, long? numberCount = null) + { + return new AzureOperatorCallProtectionAccountDetails(enabled, numberCount, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// A list of telephone number upload usages. + /// A new instance for mocking. + public static TeamsCapabilityPlans TeamsCapabilityPlans(IEnumerable capabilityPlans = null) + { + capabilityPlans ??= new List(); + + return new TeamsCapabilityPlans(capabilityPlans?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The capability plan name. + /// The offer types available. + /// The telephone number usage. + /// Mandatory capabilities for telephone numbers. + /// Choosable capabilities for telephone numbers. + /// Boolean indicating if Toll free is supported. + /// A new instance for mocking. + public static TeamsCapabilityPlan TeamsCapabilityPlan(string name = null, IEnumerable offerTypes = null, string usage = null, IEnumerable mandatoryCapabilities = null, IEnumerable choosableCapabilities = null, bool supportsTollFree = default) + { + offerTypes ??= new List(); + mandatoryCapabilities ??= new List(); + choosableCapabilities ??= new List(); + + return new TeamsCapabilityPlan( + name, + offerTypes?.ToList(), + usage, + mandatoryCapabilities?.ToList(), + choosableCapabilities?.ToList(), + supportsTollFree, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The available capabilities for the numbers specified with Operator Connect or Teams Phone Mobile services enabled. + /// A new instance for mocking. + public static TeamsAvailableCapabilities TeamsAvailableCapabilities(IEnumerable availableCapabilities = null) + { + availableCapabilities ??= new List(); + + return new TeamsAvailableCapabilities(availableCapabilities?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The ID of the civic address. + /// The country of the civic address. + /// The house number of the civic address. + /// The house number suffix of the civic address. + /// The pre directional of the civic address. + /// The street name of the civic address. + /// The street suffix of the civic address. + /// The post directional of the civic address. + /// The state or province of the civic address. + /// The county or district of the civic address. + /// The city or town of the civic address. + /// The city or town alias of the civic address. + /// The postal or zip code of the civic address. + /// The description of the civic address. + /// The company name of the civic address. + /// The company ID of the civic address. + /// The default location ID of the civic address. + /// The validation status of the civic address. + /// The customer tenant ID of the civic address. + /// The partner ID of the civic address. + /// The list of locations associated with the civic address. + /// The latitude of the civic address. + /// The longitude of the civic address. + /// A new instance for mocking. + public static TeamsCivicAddressResource TeamsCivicAddressResource(string id = null, string country = null, string houseNumber = null, string houseNumberSuffix = null, string preDirectional = null, string streetName = null, string streetSuffix = null, string postDirectional = null, string stateOrProvince = null, string countyOrDistrict = null, string cityOrTown = null, string cityOrTownAlias = null, string postalOrZipCode = null, string description = null, string companyName = null, string companyId = null, string defaultLocationId = null, ValidationStatus? validationStatus = null, string tenantId = null, string partnerId = null, IEnumerable locations = null, string latitude = null, string longitude = null) + { + locations ??= new List(); + + return new TeamsCivicAddressResource( + id, + country, + houseNumber, + houseNumberSuffix, + preDirectional, + streetName, + streetSuffix, + postDirectional, + stateOrProvince, + countyOrDistrict, + cityOrTown, + cityOrTownAlias, + postalOrZipCode, + description, + companyName, + companyId, + defaultLocationId, + validationStatus, + tenantId, + partnerId, + locations?.ToList(), + latitude, + longitude, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The ID of the location. + /// The civic address ID of the location. + /// The description of the location. + /// The additional information of the location. + /// Flag indicating whether the location is default or not. + /// The elin (Emergency Location Identification Number) of the location. + /// A new instance for mocking. + public static Location Location(string id = null, string civicAddressId = null, string description = null, string additionalInfo = null, bool? isDefault = null, string elin = null) + { + return new Location( + id, + civicAddressId, + description, + additionalInfo, + isDefault, + elin, + serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberConfiguration.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberConfiguration.Serialization.cs new file mode 100644 index 000000000000..a19caf1c43e8 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberConfiguration.Serialization.cs @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class NumberConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NumberConfiguration)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(CustomSipHeader)) + { + writer.WritePropertyName("customSipHeader"u8); + writer.WriteStringValue(CustomSipHeader); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + NumberConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NumberConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNumberConfiguration(document.RootElement, options); + } + + internal static NumberConfiguration DeserializeNumberConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string customSipHeader = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("customSipHeader"u8)) + { + customSipHeader = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NumberConfiguration(customSipHeader, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(NumberConfiguration)} does not support writing '{options.Format}' format."); + } + } + + NumberConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeNumberConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NumberConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static NumberConfiguration FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeNumberConfiguration(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationListResult.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberConfiguration.cs similarity index 61% rename from sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationListResult.cs rename to sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberConfiguration.cs index fda9bc0d243f..5711b959329c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationListResult.cs +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberConfiguration.cs @@ -8,10 +8,10 @@ using System; using System.Collections.Generic; -namespace Azure.ResourceManager.CosmosDB.Models +namespace Microsoft.VoiceServices.Provisioning { - /// Result of a list NSP (network security perimeter) configurations request. - internal partial class NetworkSecurityPerimeterConfigurationListResult + /// Configuration for this number. + public partial class NumberConfiguration { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +45,21 @@ internal partial class NetworkSecurityPerimeterConfigurationListResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal NetworkSecurityPerimeterConfigurationListResult() + /// Initializes a new instance of . + public NumberConfiguration() { - Value = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// Array of network security perimeter results. - /// The link used to get the next page of results. + /// Initializes a new instance of . + /// Contents of the custom SIP header to use with this number. Can only contain letters, numbers, underscores and dashes. Can be up to 100 characters in length. The name of the custom header is set as part of the provisioning platform configuration on Azure Communications Gateway. /// Keeps track of any properties unknown to the library. - internal NetworkSecurityPerimeterConfigurationListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + internal NumberConfiguration(string customSipHeader, IDictionary serializedAdditionalRawData) { - Value = value; - NextLink = nextLink; + CustomSipHeader = customSipHeader; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Array of network security perimeter results. - public IReadOnlyList Value { get; } - /// The link used to get the next page of results. - public Uri NextLink { get; } + /// Contents of the custom SIP header to use with this number. Can only contain letters, numbers, underscores and dashes. Can be up to 100 characters in length. The name of the custom header is set as part of the provisioning platform configuration on Azure Communications Gateway. + public string CustomSipHeader { get; set; } } } diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberIdentifier.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberIdentifier.Serialization.cs new file mode 100644 index 000000000000..b8d5a613fb2f --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberIdentifier.Serialization.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class NumberIdentifier : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NumberIdentifier)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("telephoneNumber"u8); + writer.WriteStringValue(TelephoneNumber); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + NumberIdentifier IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NumberIdentifier)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNumberIdentifier(document.RootElement, options); + } + + internal static NumberIdentifier DeserializeNumberIdentifier(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string telephoneNumber = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("telephoneNumber"u8)) + { + telephoneNumber = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NumberIdentifier(telephoneNumber, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(NumberIdentifier)} does not support writing '{options.Format}' format."); + } + } + + NumberIdentifier IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeNumberIdentifier(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NumberIdentifier)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static NumberIdentifier FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeNumberIdentifier(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberIdentifier.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberIdentifier.cs new file mode 100644 index 000000000000..90e20f6dc44b --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberIdentifier.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// An identifier, used to identify a Number resource. + public partial class NumberIdentifier + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Telephone number in E.164 format. + /// is null. + public NumberIdentifier(string telephoneNumber) + { + Argument.AssertNotNull(telephoneNumber, nameof(telephoneNumber)); + + TelephoneNumber = telephoneNumber; + } + + /// Initializes a new instance of . + /// Telephone number in E.164 format. + /// Keeps track of any properties unknown to the library. + internal NumberIdentifier(string telephoneNumber, IDictionary serializedAdditionalRawData) + { + TelephoneNumber = telephoneNumber; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal NumberIdentifier() + { + } + + /// Telephone number in E.164 format. + public string TelephoneNumber { get; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberIdentifiers.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberIdentifiers.Serialization.cs new file mode 100644 index 000000000000..ba928d4c6155 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberIdentifiers.Serialization.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class NumberIdentifiers : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NumberIdentifiers)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("numbers"u8); + writer.WriteStartArray(); + foreach (var item in Numbers) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + NumberIdentifiers IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NumberIdentifiers)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNumberIdentifiers(document.RootElement, options); + } + + internal static NumberIdentifiers DeserializeNumberIdentifiers(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList numbers = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("numbers"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NumberIdentifier.DeserializeNumberIdentifier(item, options)); + } + numbers = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NumberIdentifiers(numbers, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(NumberIdentifiers)} does not support writing '{options.Format}' format."); + } + } + + NumberIdentifiers IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeNumberIdentifiers(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NumberIdentifiers)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static NumberIdentifiers FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeNumberIdentifiers(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeter.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberIdentifiers.cs similarity index 58% rename from sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeter.cs rename to sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberIdentifiers.cs index 9a38aee3d8f6..3a161cce2892 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeter.cs +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberIdentifiers.cs @@ -7,12 +7,12 @@ using System; using System.Collections.Generic; -using Azure.Core; +using System.Linq; -namespace Azure.ResourceManager.CosmosDB.Models +namespace Microsoft.VoiceServices.Provisioning { - /// Information about a network security perimeter (NSP). - public partial class NetworkSecurityPerimeter + /// A list identifiers for a Number resource. + public partial class NumberIdentifiers { /// /// Keeps track of any properties unknown to the library. @@ -46,32 +46,31 @@ public partial class NetworkSecurityPerimeter /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public NetworkSecurityPerimeter() + /// Initializes a new instance of . + /// Array containing a list of identifiers for Number resources. + /// is null. + public NumberIdentifiers(IEnumerable numbers) { + Argument.AssertNotNull(numbers, nameof(numbers)); + + Numbers = numbers.ToList(); } - /// Initializes a new instance of . - /// Fully qualified Azure resource ID of the NSP resource. - /// Universal unique ID (UUID) of the network security perimeter. - /// Location of the network security perimeter. + /// Initializes a new instance of . + /// Array containing a list of identifiers for Number resources. /// Keeps track of any properties unknown to the library. - internal NetworkSecurityPerimeter(ResourceIdentifier id, Guid? perimeterGuid, AzureLocation? location, IDictionary serializedAdditionalRawData) + internal NumberIdentifiers(IList numbers, IDictionary serializedAdditionalRawData) { - Id = id; - PerimeterGuid = perimeterGuid; - Location = location; + Numbers = numbers; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Fully qualified Azure resource ID of the NSP resource. - [WirePath("id")] - public ResourceIdentifier Id { get; set; } - /// Universal unique ID (UUID) of the network security perimeter. - [WirePath("perimeterGuid")] - public Guid? PerimeterGuid { get; set; } - /// Location of the network security perimeter. - [WirePath("location")] - public AzureLocation? Location { get; set; } + /// Initializes a new instance of for deserialization. + internal NumberIdentifiers() + { + } + + /// Array containing a list of identifiers for Number resources. + public IList Numbers { get; } } } diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberResource.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberResource.Serialization.cs new file mode 100644 index 000000000000..dd6a5edcca85 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberResource.Serialization.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class NumberResource : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NumberResource)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(ServiceProvisioningStatus)) + { + writer.WritePropertyName("serviceProvisioningStatus"u8); + writer.WriteStringValue(ServiceProvisioningStatus.Value.ToString()); + } + if (options.Format != "W" && Optional.IsCollectionDefined(ServiceProvisioningErrors)) + { + writer.WritePropertyName("serviceProvisioningErrors"u8); + writer.WriteStartArray(); + foreach (var item in ServiceProvisioningErrors) + { + JsonSerializer.Serialize(writer, item); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("telephoneNumber"u8); + writer.WriteStringValue(TelephoneNumber); + writer.WritePropertyName("accountName"u8); + writer.WriteStringValue(AccountName); + writer.WritePropertyName("serviceDetails"u8); + writer.WriteObjectValue(ServiceDetails, options); + if (Optional.IsDefined(Configuration)) + { + writer.WritePropertyName("configuration"u8); + writer.WriteObjectValue(Configuration, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + NumberResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NumberResource)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNumberResource(document.RootElement, options); + } + + internal static NumberResource DeserializeNumberResource(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ServiceProvisioningStatus? serviceProvisioningStatus = default; + IReadOnlyList serviceProvisioningErrors = default; + string telephoneNumber = default; + string accountName = default; + NumberServiceDetails serviceDetails = default; + NumberConfiguration configuration = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("serviceProvisioningStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serviceProvisioningStatus = new ServiceProvisioningStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("serviceProvisioningErrors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + serviceProvisioningErrors = array; + continue; + } + if (property.NameEquals("telephoneNumber"u8)) + { + telephoneNumber = property.Value.GetString(); + continue; + } + if (property.NameEquals("accountName"u8)) + { + accountName = property.Value.GetString(); + continue; + } + if (property.NameEquals("serviceDetails"u8)) + { + serviceDetails = NumberServiceDetails.DeserializeNumberServiceDetails(property.Value, options); + continue; + } + if (property.NameEquals("configuration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + configuration = NumberConfiguration.DeserializeNumberConfiguration(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NumberResource( + serviceProvisioningStatus, + serviceProvisioningErrors ?? new ChangeTrackingList(), + telephoneNumber, + accountName, + serviceDetails, + configuration, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(NumberResource)} does not support writing '{options.Format}' format."); + } + } + + NumberResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeNumberResource(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NumberResource)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static NumberResource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeNumberResource(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberResource.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberResource.cs new file mode 100644 index 000000000000..ff23d578e442 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberResource.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// The configuration for a telephone number provisioned in Azure Communications Gateway. + public partial class NumberResource + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Telephone number in E.164 format. + /// Name of the account. Can only contain letters, numbers, underscores and dashes, and is case-sensitive. Can be up to 100 characters in length. + /// Configuration of the individual backend services for this number. + /// , or is null. + public NumberResource(string telephoneNumber, string accountName, NumberServiceDetails serviceDetails) + { + Argument.AssertNotNull(telephoneNumber, nameof(telephoneNumber)); + Argument.AssertNotNull(accountName, nameof(accountName)); + Argument.AssertNotNull(serviceDetails, nameof(serviceDetails)); + + ServiceProvisioningErrors = new ChangeTrackingList(); + TelephoneNumber = telephoneNumber; + AccountName = accountName; + ServiceDetails = serviceDetails; + } + + /// Initializes a new instance of . + /// The status of the provisioning action associated with this resource. + /// Any errors pertaining to the provisioning of this resource. + /// Telephone number in E.164 format. + /// Name of the account. Can only contain letters, numbers, underscores and dashes, and is case-sensitive. Can be up to 100 characters in length. + /// Configuration of the individual backend services for this number. + /// Configuration for this number. + /// Keeps track of any properties unknown to the library. + internal NumberResource(ServiceProvisioningStatus? serviceProvisioningStatus, IReadOnlyList serviceProvisioningErrors, string telephoneNumber, string accountName, NumberServiceDetails serviceDetails, NumberConfiguration configuration, IDictionary serializedAdditionalRawData) + { + ServiceProvisioningStatus = serviceProvisioningStatus; + ServiceProvisioningErrors = serviceProvisioningErrors; + TelephoneNumber = telephoneNumber; + AccountName = accountName; + ServiceDetails = serviceDetails; + Configuration = configuration; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal NumberResource() + { + } + + /// The status of the provisioning action associated with this resource. + public ServiceProvisioningStatus? ServiceProvisioningStatus { get; } + /// Any errors pertaining to the provisioning of this resource. + public IReadOnlyList ServiceProvisioningErrors { get; } + /// Telephone number in E.164 format. + public string TelephoneNumber { get; set; } + /// Name of the account. Can only contain letters, numbers, underscores and dashes, and is case-sensitive. Can be up to 100 characters in length. + public string AccountName { get; set; } + /// Configuration of the individual backend services for this number. + public NumberServiceDetails ServiceDetails { get; set; } + /// Configuration for this number. + public NumberConfiguration Configuration { get; set; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberServiceDetails.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberServiceDetails.Serialization.cs new file mode 100644 index 000000000000..a8dc6c7732f5 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberServiceDetails.Serialization.cs @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class NumberServiceDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NumberServiceDetails)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(TeamsOperatorConnect)) + { + writer.WritePropertyName("teamsOperatorConnect"u8); + writer.WriteObjectValue(TeamsOperatorConnect, options); + } + if (Optional.IsDefined(TeamsDirectRouting)) + { + writer.WritePropertyName("teamsDirectRouting"u8); + writer.WriteObjectValue(TeamsDirectRouting, options); + } + if (Optional.IsDefined(TeamsPhoneMobile)) + { + writer.WritePropertyName("teamsPhoneMobile"u8); + writer.WriteObjectValue(TeamsPhoneMobile, options); + } + if (Optional.IsDefined(ZoomPhoneCloudPeering)) + { + writer.WritePropertyName("zoomPhoneCloudPeering"u8); + writer.WriteObjectValue(ZoomPhoneCloudPeering, options); + } + if (Optional.IsDefined(AzureOperatorCallProtection)) + { + writer.WritePropertyName("azureOperatorCallProtection"u8); + writer.WriteObjectValue(AzureOperatorCallProtection, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + NumberServiceDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NumberServiceDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNumberServiceDetails(document.RootElement, options); + } + + internal static NumberServiceDetails DeserializeNumberServiceDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + TeamsOperatorConnectNumberDetails teamsOperatorConnect = default; + TeamsDirectRoutingNumberDetails teamsDirectRouting = default; + TeamsPhoneMobileNumberDetails teamsPhoneMobile = default; + ZoomPhoneCloudPeeringNumberDetails zoomPhoneCloudPeering = default; + AzureOperatorCallProtectionNumberDetails azureOperatorCallProtection = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("teamsOperatorConnect"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + teamsOperatorConnect = TeamsOperatorConnectNumberDetails.DeserializeTeamsOperatorConnectNumberDetails(property.Value, options); + continue; + } + if (property.NameEquals("teamsDirectRouting"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + teamsDirectRouting = TeamsDirectRoutingNumberDetails.DeserializeTeamsDirectRoutingNumberDetails(property.Value, options); + continue; + } + if (property.NameEquals("teamsPhoneMobile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + teamsPhoneMobile = TeamsPhoneMobileNumberDetails.DeserializeTeamsPhoneMobileNumberDetails(property.Value, options); + continue; + } + if (property.NameEquals("zoomPhoneCloudPeering"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + zoomPhoneCloudPeering = ZoomPhoneCloudPeeringNumberDetails.DeserializeZoomPhoneCloudPeeringNumberDetails(property.Value, options); + continue; + } + if (property.NameEquals("azureOperatorCallProtection"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureOperatorCallProtection = AzureOperatorCallProtectionNumberDetails.DeserializeAzureOperatorCallProtectionNumberDetails(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NumberServiceDetails( + teamsOperatorConnect, + teamsDirectRouting, + teamsPhoneMobile, + zoomPhoneCloudPeering, + azureOperatorCallProtection, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(NumberServiceDetails)} does not support writing '{options.Format}' format."); + } + } + + NumberServiceDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeNumberServiceDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NumberServiceDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static NumberServiceDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeNumberServiceDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberServiceDetails.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberServiceDetails.cs new file mode 100644 index 000000000000..888147b1e60e --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/NumberServiceDetails.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// Configuration of backend services for a telephone number. + public partial class NumberServiceDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public NumberServiceDetails() + { + } + + /// Initializes a new instance of . + /// Details for the Teams Operator Connect service on this Number. + /// Details for the Teams Direct Routing service on this Number. + /// Details for the Teams Phone Mobile service on this Number. + /// Details for the Zoom Phone Cloud Peering service on this Number. + /// Details for the Azure Operator Call Protection service on this Number. + /// Keeps track of any properties unknown to the library. + internal NumberServiceDetails(TeamsOperatorConnectNumberDetails teamsOperatorConnect, TeamsDirectRoutingNumberDetails teamsDirectRouting, TeamsPhoneMobileNumberDetails teamsPhoneMobile, ZoomPhoneCloudPeeringNumberDetails zoomPhoneCloudPeering, AzureOperatorCallProtectionNumberDetails azureOperatorCallProtection, IDictionary serializedAdditionalRawData) + { + TeamsOperatorConnect = teamsOperatorConnect; + TeamsDirectRouting = teamsDirectRouting; + TeamsPhoneMobile = teamsPhoneMobile; + ZoomPhoneCloudPeering = zoomPhoneCloudPeering; + AzureOperatorCallProtection = azureOperatorCallProtection; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Details for the Teams Operator Connect service on this Number. + public TeamsOperatorConnectNumberDetails TeamsOperatorConnect { get; set; } + /// Details for the Teams Direct Routing service on this Number. + public TeamsDirectRoutingNumberDetails TeamsDirectRouting { get; set; } + /// Details for the Teams Phone Mobile service on this Number. + public TeamsPhoneMobileNumberDetails TeamsPhoneMobile { get; set; } + /// Details for the Zoom Phone Cloud Peering service on this Number. + public ZoomPhoneCloudPeeringNumberDetails ZoomPhoneCloudPeering { get; set; } + /// Details for the Azure Operator Call Protection service on this Number. + public AzureOperatorCallProtectionNumberDetails AzureOperatorCallProtection { get; set; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/RequestForInformationResource.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/RequestForInformationResource.Serialization.cs new file mode 100644 index 000000000000..2e5b3b7537f6 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/RequestForInformationResource.Serialization.cs @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class RequestForInformationResource : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RequestForInformationResource)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(ServiceProvisioningStatus)) + { + writer.WritePropertyName("serviceProvisioningStatus"u8); + writer.WriteStringValue(ServiceProvisioningStatus.Value.ToString()); + } + if (options.Format != "W" && Optional.IsCollectionDefined(ServiceProvisioningErrors)) + { + writer.WritePropertyName("serviceProvisioningErrors"u8); + writer.WriteStartArray(); + foreach (var item in ServiceProvisioningErrors) + { + JsonSerializer.Serialize(writer, item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W") + { + writer.WritePropertyName("tenantId"u8); + writer.WriteStringValue(TenantId); + } + if (options.Format != "W" && Optional.IsDefined(AccountName)) + { + writer.WritePropertyName("accountName"u8); + writer.WriteStringValue(AccountName); + } + if (options.Format != "W" && Optional.IsDefined(ProductContext)) + { + writer.WritePropertyName("productContext"u8); + writer.WriteStringValue(ProductContext); + } + if (options.Format != "W" && Optional.IsDefined(OperatorId)) + { + writer.WritePropertyName("operatorId"u8); + writer.WriteStringValue(OperatorId); + } + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ConsentedOn)) + { + writer.WritePropertyName("consentedOn"u8); + writer.WriteStringValue(ConsentedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(LastModifiedOn)) + { + writer.WritePropertyName("lastModifiedOn"u8); + writer.WriteStringValue(LastModifiedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsCollectionDefined(ConsentedCountries)) + { + writer.WritePropertyName("consentedCountries"u8); + writer.WriteStartArray(); + foreach (var item in ConsentedCountries) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(Contacts)) + { + writer.WritePropertyName("contacts"u8); + writer.WriteStartArray(); + foreach (var item in Contacts) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(CustomerRelationship)) + { + writer.WritePropertyName("customerRelationship"u8); + writer.WriteObjectValue(CustomerRelationship, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RequestForInformationResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RequestForInformationResource)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRequestForInformationResource(document.RootElement, options); + } + + internal static RequestForInformationResource DeserializeRequestForInformationResource(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ServiceProvisioningStatus? serviceProvisioningStatus = default; + IReadOnlyList serviceProvisioningErrors = default; + string id = default; + string tenantId = default; + string accountName = default; + string productContext = default; + string operatorId = default; + TeamsConsentStatus? status = default; + DateTimeOffset? consentedOn = default; + DateTimeOffset? lastModifiedOn = default; + IReadOnlyList consentedCountries = default; + IReadOnlyList contacts = default; + CustomerRelationship customerRelationship = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("serviceProvisioningStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serviceProvisioningStatus = new ServiceProvisioningStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("serviceProvisioningErrors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + serviceProvisioningErrors = array; + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("tenantId"u8)) + { + tenantId = property.Value.GetString(); + continue; + } + if (property.NameEquals("accountName"u8)) + { + accountName = property.Value.GetString(); + continue; + } + if (property.NameEquals("productContext"u8)) + { + productContext = property.Value.GetString(); + continue; + } + if (property.NameEquals("operatorId"u8)) + { + operatorId = property.Value.GetString(); + continue; + } + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new TeamsConsentStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("consentedOn"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + consentedOn = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastModifiedOn"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastModifiedOn = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("consentedCountries"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + consentedCountries = array; + continue; + } + if (property.NameEquals("contacts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ContactDetails.DeserializeContactDetails(item, options)); + } + contacts = array; + continue; + } + if (property.NameEquals("customerRelationship"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customerRelationship = CustomerRelationship.DeserializeCustomerRelationship(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RequestForInformationResource( + serviceProvisioningStatus, + serviceProvisioningErrors ?? new ChangeTrackingList(), + id, + tenantId, + accountName, + productContext, + operatorId, + status, + consentedOn, + lastModifiedOn, + consentedCountries ?? new ChangeTrackingList(), + contacts ?? new ChangeTrackingList(), + customerRelationship, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RequestForInformationResource)} does not support writing '{options.Format}' format."); + } + } + + RequestForInformationResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRequestForInformationResource(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RequestForInformationResource)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static RequestForInformationResource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeRequestForInformationResource(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/RequestForInformationResource.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/RequestForInformationResource.cs new file mode 100644 index 000000000000..804e8d1e426d --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/RequestForInformationResource.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// The configuration for a telephone number provisioned in ACG. + public partial class RequestForInformationResource + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public RequestForInformationResource() + { + ServiceProvisioningErrors = new ChangeTrackingList(); + ConsentedCountries = new ChangeTrackingList(); + Contacts = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The status of the provisioning action associated with this resource. + /// Any errors pertaining to the provisioning of this resource. + /// The ID of the Request for Information. + /// The Teams tenant ID which generated this Request for Information. + /// The name of the account associated with this Request for Information. + /// Will always be 'teams'. + /// The operator ID of the operator consent. + /// The status of the operator consent. + /// The time (ISO8601 format) when the operator consent is created. + /// The time (ISO8601 format) when the operator consent is last modified. + /// The list of consented countries. + /// The list of tenant contacts. + /// The customer relationship of the operator consent. + /// Keeps track of any properties unknown to the library. + internal RequestForInformationResource(ServiceProvisioningStatus? serviceProvisioningStatus, IReadOnlyList serviceProvisioningErrors, string id, string tenantId, string accountName, string productContext, string operatorId, TeamsConsentStatus? status, DateTimeOffset? consentedOn, DateTimeOffset? lastModifiedOn, IReadOnlyList consentedCountries, IReadOnlyList contacts, CustomerRelationship customerRelationship, IDictionary serializedAdditionalRawData) + { + ServiceProvisioningStatus = serviceProvisioningStatus; + ServiceProvisioningErrors = serviceProvisioningErrors; + Id = id; + TenantId = tenantId; + AccountName = accountName; + ProductContext = productContext; + OperatorId = operatorId; + Status = status; + ConsentedOn = consentedOn; + LastModifiedOn = lastModifiedOn; + ConsentedCountries = consentedCountries; + Contacts = contacts; + CustomerRelationship = customerRelationship; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The status of the provisioning action associated with this resource. + public ServiceProvisioningStatus? ServiceProvisioningStatus { get; } + /// Any errors pertaining to the provisioning of this resource. + public IReadOnlyList ServiceProvisioningErrors { get; } + /// The ID of the Request for Information. + public string Id { get; } + /// The Teams tenant ID which generated this Request for Information. + public string TenantId { get; } + /// The name of the account associated with this Request for Information. + public string AccountName { get; } + /// Will always be 'teams'. + public string ProductContext { get; } + /// The operator ID of the operator consent. + public string OperatorId { get; } + /// The status of the operator consent. + public TeamsConsentStatus? Status { get; } + /// The time (ISO8601 format) when the operator consent is created. + public DateTimeOffset? ConsentedOn { get; } + /// The time (ISO8601 format) when the operator consent is last modified. + public DateTimeOffset? LastModifiedOn { get; } + /// The list of consented countries. + public IReadOnlyList ConsentedCountries { get; } + /// The list of tenant contacts. + public IReadOnlyList Contacts { get; } + /// The customer relationship of the operator consent. + public CustomerRelationship CustomerRelationship { get; set; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ServiceProvisioningStatus.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ServiceProvisioningStatus.cs new file mode 100644 index 000000000000..96c27709f6b5 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ServiceProvisioningStatus.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// The provisioning states of an object on any relevant backend service. + public readonly partial struct ServiceProvisioningStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ServiceProvisioningStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PendingValue = "pending"; + private const string SyncedValue = "synced"; + private const string FailedValue = "failed"; + + /// The object is pending provisioning. + public static ServiceProvisioningStatus Pending { get; } = new ServiceProvisioningStatus(PendingValue); + /// The object has been synced with the relevant backend service. + public static ServiceProvisioningStatus Synced { get; } = new ServiceProvisioningStatus(SyncedValue); + /// The object provisioning operation failed with the relevant backend service. + public static ServiceProvisioningStatus Failed { get; } = new ServiceProvisioningStatus(FailedValue); + /// Determines if two values are the same. + public static bool operator ==(ServiceProvisioningStatus left, ServiceProvisioningStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ServiceProvisioningStatus left, ServiceProvisioningStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ServiceProvisioningStatus(string value) => new ServiceProvisioningStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ServiceProvisioningStatus other && Equals(other); + /// + public bool Equals(ServiceProvisioningStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownDataTransferDataSourceSink.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsAvailableCapabilities.Serialization.cs similarity index 50% rename from sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownDataTransferDataSourceSink.Serialization.cs rename to sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsAvailableCapabilities.Serialization.cs index 504a2110bb4d..e12d209f08fd 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownDataTransferDataSourceSink.Serialization.cs +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsAvailableCapabilities.Serialization.cs @@ -8,27 +8,35 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; -using System.Text; using System.Text.Json; +using Azure; using Azure.Core; -namespace Azure.ResourceManager.CosmosDB.Models +namespace Microsoft.VoiceServices.Provisioning { - internal partial class UnknownDataTransferDataSourceSink : IUtf8JsonSerializable, IJsonModel + public partial class TeamsAvailableCapabilities : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DataTransferDataSourceSink)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TeamsAvailableCapabilities)} does not support writing '{format}' format."); } writer.WriteStartObject(); - writer.WritePropertyName("component"u8); - writer.WriteStringValue(Component.ToString()); + if (options.Format != "W") + { + writer.WritePropertyName("availableCapabilities"u8); + writer.WriteStartArray(); + foreach (var item in AvailableCapabilities) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -47,19 +55,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe writer.WriteEndObject(); } - DataTransferDataSourceSink IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TeamsAvailableCapabilities IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DataTransferDataSourceSink)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TeamsAvailableCapabilities)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDataTransferDataSourceSink(document.RootElement, options); + return DeserializeTeamsAvailableCapabilities(document.RootElement, options); } - internal static UnknownDataTransferDataSourceSink DeserializeUnknownDataTransferDataSourceSink(JsonElement element, ModelReaderWriterOptions options = null) + internal static TeamsAvailableCapabilities DeserializeTeamsAvailableCapabilities(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -67,14 +75,19 @@ internal static UnknownDataTransferDataSourceSink DeserializeUnknownDataTransfer { return null; } - DataTransferComponent component = "Unknown"; + IReadOnlyList availableCapabilities = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("component"u8)) + if (property.NameEquals("availableCapabilities"u8)) { - component = new DataTransferComponent(property.Value.GetString()); + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + availableCapabilities = array; continue; } if (options.Format != "W") @@ -83,67 +96,54 @@ internal static UnknownDataTransferDataSourceSink DeserializeUnknownDataTransfer } } serializedAdditionalRawData = rawDataDictionary; - return new UnknownDataTransferDataSourceSink(component, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Component), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" component: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" component: "); - builder.AppendLine($"'{Component.ToString()}'"); - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); + return new TeamsAvailableCapabilities(availableCapabilities, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(DataTransferDataSourceSink)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TeamsAvailableCapabilities)} does not support writing '{options.Format}' format."); } } - DataTransferDataSourceSink IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TeamsAvailableCapabilities IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDataTransferDataSourceSink(document.RootElement, options); + return DeserializeTeamsAvailableCapabilities(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DataTransferDataSourceSink)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TeamsAvailableCapabilities)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TeamsAvailableCapabilities FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTeamsAvailableCapabilities(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolsListResult.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsAvailableCapabilities.cs similarity index 63% rename from sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolsListResult.cs rename to sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsAvailableCapabilities.cs index b6490a57da21..1efbe9849568 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolsListResult.cs +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsAvailableCapabilities.cs @@ -8,10 +8,10 @@ using System; using System.Collections.Generic; -namespace Azure.ResourceManager.CosmosDB.Models +namespace Microsoft.VoiceServices.Provisioning { - /// The List operation response, that contains the throughput pools and their properties. - internal partial class ThroughputPoolsListResult + /// The Teams capabilities available for numbers with Operator Connect or Teams Phone Mobile services enabled. + public partial class TeamsAvailableCapabilities { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +45,22 @@ internal partial class ThroughputPoolsListResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal ThroughputPoolsListResult() + /// Initializes a new instance of . + internal TeamsAvailableCapabilities() { - Value = new ChangeTrackingList(); + AvailableCapabilities = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// List of throughput pools and their properties. - /// The link used to get the next page of results. + /// Initializes a new instance of . + /// The available capabilities for the numbers specified with Operator Connect or Teams Phone Mobile services enabled. /// Keeps track of any properties unknown to the library. - internal ThroughputPoolsListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal TeamsAvailableCapabilities(IReadOnlyList availableCapabilities, IDictionary serializedAdditionalRawData) { - Value = value; - NextLink = nextLink; + AvailableCapabilities = availableCapabilities; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// List of throughput pools and their properties. - public IReadOnlyList Value { get; } - /// The link used to get the next page of results. - public string NextLink { get; } + /// The available capabilities for the numbers specified with Operator Connect or Teams Phone Mobile services enabled. + public IReadOnlyList AvailableCapabilities { get; } } } diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCapabilityPlan.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCapabilityPlan.Serialization.cs new file mode 100644 index 000000000000..a094695b5400 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCapabilityPlan.Serialization.cs @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class TeamsCapabilityPlan : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsCapabilityPlan)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W") + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsCollectionDefined(OfferTypes)) + { + writer.WritePropertyName("offerTypes"u8); + writer.WriteStartArray(); + foreach (var item in OfferTypes) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W") + { + writer.WritePropertyName("usage"u8); + writer.WriteStringValue(Usage); + } + if (options.Format != "W" && Optional.IsCollectionDefined(MandatoryCapabilities)) + { + writer.WritePropertyName("mandatoryCapabilities"u8); + writer.WriteStartArray(); + foreach (var item in MandatoryCapabilities) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(ChoosableCapabilities)) + { + writer.WritePropertyName("choosableCapabilities"u8); + writer.WriteStartArray(); + foreach (var item in ChoosableCapabilities) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W") + { + writer.WritePropertyName("supportsTollFree"u8); + writer.WriteBooleanValue(SupportsTollFree); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + TeamsCapabilityPlan IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsCapabilityPlan)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTeamsCapabilityPlan(document.RootElement, options); + } + + internal static TeamsCapabilityPlan DeserializeTeamsCapabilityPlan(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + IReadOnlyList offerTypes = default; + string usage = default; + IReadOnlyList mandatoryCapabilities = default; + IReadOnlyList choosableCapabilities = default; + bool supportsTollFree = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("offerTypes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + offerTypes = array; + continue; + } + if (property.NameEquals("usage"u8)) + { + usage = property.Value.GetString(); + continue; + } + if (property.NameEquals("mandatoryCapabilities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + mandatoryCapabilities = array; + continue; + } + if (property.NameEquals("choosableCapabilities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + choosableCapabilities = array; + continue; + } + if (property.NameEquals("supportsTollFree"u8)) + { + supportsTollFree = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TeamsCapabilityPlan( + name, + offerTypes ?? new ChangeTrackingList(), + usage, + mandatoryCapabilities ?? new ChangeTrackingList(), + choosableCapabilities ?? new ChangeTrackingList(), + supportsTollFree, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TeamsCapabilityPlan)} does not support writing '{options.Format}' format."); + } + } + + TeamsCapabilityPlan IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTeamsCapabilityPlan(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TeamsCapabilityPlan)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TeamsCapabilityPlan FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTeamsCapabilityPlan(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCapabilityPlan.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCapabilityPlan.cs new file mode 100644 index 000000000000..daa8b4f3ecfd --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCapabilityPlan.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// A teams capability plan for a given usage. + public partial class TeamsCapabilityPlan + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal TeamsCapabilityPlan() + { + OfferTypes = new ChangeTrackingList(); + MandatoryCapabilities = new ChangeTrackingList(); + ChoosableCapabilities = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The capability plan name. + /// The offer types available. + /// The telephone number usage. + /// Mandatory capabilities for telephone numbers. + /// Choosable capabilities for telephone numbers. + /// Boolean indicating if Toll free is supported. + /// Keeps track of any properties unknown to the library. + internal TeamsCapabilityPlan(string name, IReadOnlyList offerTypes, string usage, IReadOnlyList mandatoryCapabilities, IReadOnlyList choosableCapabilities, bool supportsTollFree, IDictionary serializedAdditionalRawData) + { + Name = name; + OfferTypes = offerTypes; + Usage = usage; + MandatoryCapabilities = mandatoryCapabilities; + ChoosableCapabilities = choosableCapabilities; + SupportsTollFree = supportsTollFree; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The capability plan name. + public string Name { get; } + /// The offer types available. + public IReadOnlyList OfferTypes { get; } + /// The telephone number usage. + public string Usage { get; } + /// Mandatory capabilities for telephone numbers. + public IReadOnlyList MandatoryCapabilities { get; } + /// Choosable capabilities for telephone numbers. + public IReadOnlyList ChoosableCapabilities { get; } + /// Boolean indicating if Toll free is supported. + public bool SupportsTollFree { get; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCapabilityPlans.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCapabilityPlans.Serialization.cs new file mode 100644 index 000000000000..24e5f6d15ded --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCapabilityPlans.Serialization.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class TeamsCapabilityPlans : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsCapabilityPlans)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W") + { + writer.WritePropertyName("capabilityPlans"u8); + writer.WriteStartArray(); + foreach (var item in CapabilityPlans) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + TeamsCapabilityPlans IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsCapabilityPlans)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTeamsCapabilityPlans(document.RootElement, options); + } + + internal static TeamsCapabilityPlans DeserializeTeamsCapabilityPlans(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList capabilityPlans = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("capabilityPlans"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TeamsCapabilityPlan.DeserializeTeamsCapabilityPlan(item, options)); + } + capabilityPlans = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TeamsCapabilityPlans(capabilityPlans, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TeamsCapabilityPlans)} does not support writing '{options.Format}' format."); + } + } + + TeamsCapabilityPlans IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTeamsCapabilityPlans(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TeamsCapabilityPlans)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TeamsCapabilityPlans FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTeamsCapabilityPlans(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewListResult.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCapabilityPlans.cs similarity index 66% rename from sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewListResult.cs rename to sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCapabilityPlans.cs index 35fd26a8643c..ed8ec02e8a47 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewListResult.cs +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCapabilityPlans.cs @@ -8,10 +8,10 @@ using System; using System.Collections.Generic; -namespace Azure.ResourceManager.CosmosDB.Models +namespace Microsoft.VoiceServices.Provisioning { - /// The List operation response, that contains the Cassandra views and their properties. - internal partial class CassandraViewListResult + /// The Teams telephone number upload usages for this account. + public partial class TeamsCapabilityPlans { /// /// Keeps track of any properties unknown to the library. @@ -45,22 +45,22 @@ internal partial class CassandraViewListResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal CassandraViewListResult() + /// Initializes a new instance of . + internal TeamsCapabilityPlans() { - Value = new ChangeTrackingList(); + CapabilityPlans = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// List of Cassandra views and their properties. + /// Initializes a new instance of . + /// A list of telephone number upload usages. /// Keeps track of any properties unknown to the library. - internal CassandraViewListResult(IReadOnlyList value, IDictionary serializedAdditionalRawData) + internal TeamsCapabilityPlans(IReadOnlyList capabilityPlans, IDictionary serializedAdditionalRawData) { - Value = value; + CapabilityPlans = capabilityPlans; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// List of Cassandra views and their properties. - public IReadOnlyList Value { get; } + /// A list of telephone number upload usages. + public IReadOnlyList CapabilityPlans { get; } } } diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCivicAddressResource.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCivicAddressResource.Serialization.cs new file mode 100644 index 000000000000..2efc8a4cb3e2 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCivicAddressResource.Serialization.cs @@ -0,0 +1,423 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class TeamsCivicAddressResource : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsCivicAddressResource)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W" && Optional.IsDefined(Country)) + { + writer.WritePropertyName("country"u8); + writer.WriteStringValue(Country); + } + if (options.Format != "W" && Optional.IsDefined(HouseNumber)) + { + writer.WritePropertyName("houseNumber"u8); + writer.WriteStringValue(HouseNumber); + } + if (options.Format != "W" && Optional.IsDefined(HouseNumberSuffix)) + { + writer.WritePropertyName("houseNumberSuffix"u8); + writer.WriteStringValue(HouseNumberSuffix); + } + if (options.Format != "W" && Optional.IsDefined(PreDirectional)) + { + writer.WritePropertyName("preDirectional"u8); + writer.WriteStringValue(PreDirectional); + } + if (options.Format != "W" && Optional.IsDefined(StreetName)) + { + writer.WritePropertyName("streetName"u8); + writer.WriteStringValue(StreetName); + } + if (options.Format != "W" && Optional.IsDefined(StreetSuffix)) + { + writer.WritePropertyName("streetSuffix"u8); + writer.WriteStringValue(StreetSuffix); + } + if (options.Format != "W" && Optional.IsDefined(PostDirectional)) + { + writer.WritePropertyName("postDirectional"u8); + writer.WriteStringValue(PostDirectional); + } + if (options.Format != "W" && Optional.IsDefined(StateOrProvince)) + { + writer.WritePropertyName("stateOrProvince"u8); + writer.WriteStringValue(StateOrProvince); + } + if (options.Format != "W" && Optional.IsDefined(CountyOrDistrict)) + { + writer.WritePropertyName("countyOrDistrict"u8); + writer.WriteStringValue(CountyOrDistrict); + } + if (options.Format != "W" && Optional.IsDefined(CityOrTown)) + { + writer.WritePropertyName("cityOrTown"u8); + writer.WriteStringValue(CityOrTown); + } + if (options.Format != "W" && Optional.IsDefined(CityOrTownAlias)) + { + writer.WritePropertyName("cityOrTownAlias"u8); + writer.WriteStringValue(CityOrTownAlias); + } + if (options.Format != "W" && Optional.IsDefined(PostalOrZipCode)) + { + writer.WritePropertyName("postalOrZipCode"u8); + writer.WriteStringValue(PostalOrZipCode); + } + if (options.Format != "W" && Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (options.Format != "W" && Optional.IsDefined(CompanyName)) + { + writer.WritePropertyName("companyName"u8); + writer.WriteStringValue(CompanyName); + } + if (options.Format != "W" && Optional.IsDefined(CompanyId)) + { + writer.WritePropertyName("companyId"u8); + writer.WriteStringValue(CompanyId); + } + if (options.Format != "W") + { + writer.WritePropertyName("defaultLocationId"u8); + writer.WriteStringValue(DefaultLocationId); + } + if (options.Format != "W" && Optional.IsDefined(ValidationStatus)) + { + writer.WritePropertyName("validationStatus"u8); + writer.WriteStringValue(ValidationStatus.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(TenantId)) + { + writer.WritePropertyName("tenantId"u8); + writer.WriteStringValue(TenantId); + } + if (options.Format != "W" && Optional.IsDefined(PartnerId)) + { + writer.WritePropertyName("partnerId"u8); + writer.WriteStringValue(PartnerId); + } + if (options.Format != "W" && Optional.IsCollectionDefined(Locations)) + { + writer.WritePropertyName("locations"u8); + writer.WriteStartArray(); + foreach (var item in Locations) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(Latitude)) + { + writer.WritePropertyName("latitude"u8); + writer.WriteStringValue(Latitude); + } + if (options.Format != "W" && Optional.IsDefined(Longitude)) + { + writer.WritePropertyName("longitude"u8); + writer.WriteStringValue(Longitude); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + TeamsCivicAddressResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsCivicAddressResource)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTeamsCivicAddressResource(document.RootElement, options); + } + + internal static TeamsCivicAddressResource DeserializeTeamsCivicAddressResource(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + string country = default; + string houseNumber = default; + string houseNumberSuffix = default; + string preDirectional = default; + string streetName = default; + string streetSuffix = default; + string postDirectional = default; + string stateOrProvince = default; + string countyOrDistrict = default; + string cityOrTown = default; + string cityOrTownAlias = default; + string postalOrZipCode = default; + string description = default; + string companyName = default; + string companyId = default; + string defaultLocationId = default; + ValidationStatus? validationStatus = default; + string tenantId = default; + string partnerId = default; + IReadOnlyList locations = default; + string latitude = default; + string longitude = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("country"u8)) + { + country = property.Value.GetString(); + continue; + } + if (property.NameEquals("houseNumber"u8)) + { + houseNumber = property.Value.GetString(); + continue; + } + if (property.NameEquals("houseNumberSuffix"u8)) + { + houseNumberSuffix = property.Value.GetString(); + continue; + } + if (property.NameEquals("preDirectional"u8)) + { + preDirectional = property.Value.GetString(); + continue; + } + if (property.NameEquals("streetName"u8)) + { + streetName = property.Value.GetString(); + continue; + } + if (property.NameEquals("streetSuffix"u8)) + { + streetSuffix = property.Value.GetString(); + continue; + } + if (property.NameEquals("postDirectional"u8)) + { + postDirectional = property.Value.GetString(); + continue; + } + if (property.NameEquals("stateOrProvince"u8)) + { + stateOrProvince = property.Value.GetString(); + continue; + } + if (property.NameEquals("countyOrDistrict"u8)) + { + countyOrDistrict = property.Value.GetString(); + continue; + } + if (property.NameEquals("cityOrTown"u8)) + { + cityOrTown = property.Value.GetString(); + continue; + } + if (property.NameEquals("cityOrTownAlias"u8)) + { + cityOrTownAlias = property.Value.GetString(); + continue; + } + if (property.NameEquals("postalOrZipCode"u8)) + { + postalOrZipCode = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("companyName"u8)) + { + companyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("companyId"u8)) + { + companyId = property.Value.GetString(); + continue; + } + if (property.NameEquals("defaultLocationId"u8)) + { + defaultLocationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("validationStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + validationStatus = new ValidationStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("tenantId"u8)) + { + tenantId = property.Value.GetString(); + continue; + } + if (property.NameEquals("partnerId"u8)) + { + partnerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("locations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Location.DeserializeLocation(item, options)); + } + locations = array; + continue; + } + if (property.NameEquals("latitude"u8)) + { + latitude = property.Value.GetString(); + continue; + } + if (property.NameEquals("longitude"u8)) + { + longitude = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TeamsCivicAddressResource( + id, + country, + houseNumber, + houseNumberSuffix, + preDirectional, + streetName, + streetSuffix, + postDirectional, + stateOrProvince, + countyOrDistrict, + cityOrTown, + cityOrTownAlias, + postalOrZipCode, + description, + companyName, + companyId, + defaultLocationId, + validationStatus, + tenantId, + partnerId, + locations ?? new ChangeTrackingList(), + latitude, + longitude, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TeamsCivicAddressResource)} does not support writing '{options.Format}' format."); + } + } + + TeamsCivicAddressResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTeamsCivicAddressResource(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TeamsCivicAddressResource)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TeamsCivicAddressResource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTeamsCivicAddressResource(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCivicAddressResource.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCivicAddressResource.cs new file mode 100644 index 000000000000..b6b0b5d0f462 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsCivicAddressResource.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// A civic address available for Teams Operator Connect or Teams Phone Mobile users. + public partial class TeamsCivicAddressResource + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal TeamsCivicAddressResource() + { + Locations = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The ID of the civic address. + /// The country of the civic address. + /// The house number of the civic address. + /// The house number suffix of the civic address. + /// The pre directional of the civic address. + /// The street name of the civic address. + /// The street suffix of the civic address. + /// The post directional of the civic address. + /// The state or province of the civic address. + /// The county or district of the civic address. + /// The city or town of the civic address. + /// The city or town alias of the civic address. + /// The postal or zip code of the civic address. + /// The description of the civic address. + /// The company name of the civic address. + /// The company ID of the civic address. + /// The default location ID of the civic address. + /// The validation status of the civic address. + /// The customer tenant ID of the civic address. + /// The partner ID of the civic address. + /// The list of locations associated with the civic address. + /// The latitude of the civic address. + /// The longitude of the civic address. + /// Keeps track of any properties unknown to the library. + internal TeamsCivicAddressResource(string id, string country, string houseNumber, string houseNumberSuffix, string preDirectional, string streetName, string streetSuffix, string postDirectional, string stateOrProvince, string countyOrDistrict, string cityOrTown, string cityOrTownAlias, string postalOrZipCode, string description, string companyName, string companyId, string defaultLocationId, ValidationStatus? validationStatus, string tenantId, string partnerId, IReadOnlyList locations, string latitude, string longitude, IDictionary serializedAdditionalRawData) + { + Id = id; + Country = country; + HouseNumber = houseNumber; + HouseNumberSuffix = houseNumberSuffix; + PreDirectional = preDirectional; + StreetName = streetName; + StreetSuffix = streetSuffix; + PostDirectional = postDirectional; + StateOrProvince = stateOrProvince; + CountyOrDistrict = countyOrDistrict; + CityOrTown = cityOrTown; + CityOrTownAlias = cityOrTownAlias; + PostalOrZipCode = postalOrZipCode; + Description = description; + CompanyName = companyName; + CompanyId = companyId; + DefaultLocationId = defaultLocationId; + ValidationStatus = validationStatus; + TenantId = tenantId; + PartnerId = partnerId; + Locations = locations; + Latitude = latitude; + Longitude = longitude; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The ID of the civic address. + public string Id { get; } + /// The country of the civic address. + public string Country { get; } + /// The house number of the civic address. + public string HouseNumber { get; } + /// The house number suffix of the civic address. + public string HouseNumberSuffix { get; } + /// The pre directional of the civic address. + public string PreDirectional { get; } + /// The street name of the civic address. + public string StreetName { get; } + /// The street suffix of the civic address. + public string StreetSuffix { get; } + /// The post directional of the civic address. + public string PostDirectional { get; } + /// The state or province of the civic address. + public string StateOrProvince { get; } + /// The county or district of the civic address. + public string CountyOrDistrict { get; } + /// The city or town of the civic address. + public string CityOrTown { get; } + /// The city or town alias of the civic address. + public string CityOrTownAlias { get; } + /// The postal or zip code of the civic address. + public string PostalOrZipCode { get; } + /// The description of the civic address. + public string Description { get; } + /// The company name of the civic address. + public string CompanyName { get; } + /// The company ID of the civic address. + public string CompanyId { get; } + /// The default location ID of the civic address. + public string DefaultLocationId { get; } + /// The validation status of the civic address. + public ValidationStatus? ValidationStatus { get; } + /// The customer tenant ID of the civic address. + public string TenantId { get; } + /// The partner ID of the civic address. + public string PartnerId { get; } + /// The list of locations associated with the civic address. + public IReadOnlyList Locations { get; } + /// The latitude of the civic address. + public string Latitude { get; } + /// The longitude of the civic address. + public string Longitude { get; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsConsentStatus.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsConsentStatus.cs new file mode 100644 index 000000000000..65f9be74adfd --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsConsentStatus.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// The possible state for an Operator Consent. + public readonly partial struct TeamsConsentStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TeamsConsentStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ActiveValue = "active"; + private const string SuspendedValue = "suspended"; + private const string RemovedValue = "removed"; + + /// The Operator Consent is active. + public static TeamsConsentStatus Active { get; } = new TeamsConsentStatus(ActiveValue); + /// The Operator Consent is suspended. + public static TeamsConsentStatus Suspended { get; } = new TeamsConsentStatus(SuspendedValue); + /// The Operator Consent is removed. + public static TeamsConsentStatus Removed { get; } = new TeamsConsentStatus(RemovedValue); + /// Determines if two values are the same. + public static bool operator ==(TeamsConsentStatus left, TeamsConsentStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TeamsConsentStatus left, TeamsConsentStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator TeamsConsentStatus(string value) => new TeamsConsentStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TeamsConsentStatus other && Equals(other); + /// + public bool Equals(TeamsConsentStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingAccountConfig.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingAccountConfig.Serialization.cs new file mode 100644 index 000000000000..f21cec989086 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingAccountConfig.Serialization.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class TeamsDirectRoutingAccountConfig : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsDirectRoutingAccountConfig)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("callScreening"u8); + writer.WriteBooleanValue(CallScreening); + writer.WritePropertyName("subdomain"u8); + writer.WriteStringValue(Subdomain); + writer.WritePropertyName("subdomainTokens"u8); + writer.WriteObjectValue(SubdomainTokens, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + TeamsDirectRoutingAccountConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsDirectRoutingAccountConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTeamsDirectRoutingAccountConfig(document.RootElement, options); + } + + internal static TeamsDirectRoutingAccountConfig DeserializeTeamsDirectRoutingAccountConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool callScreening = default; + string subdomain = default; + TeamsDirectRoutingSubdomainTokens subdomainTokens = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("callScreening"u8)) + { + callScreening = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("subdomain"u8)) + { + subdomain = property.Value.GetString(); + continue; + } + if (property.NameEquals("subdomainTokens"u8)) + { + subdomainTokens = TeamsDirectRoutingSubdomainTokens.DeserializeTeamsDirectRoutingSubdomainTokens(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TeamsDirectRoutingAccountConfig(callScreening, subdomain, subdomainTokens, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TeamsDirectRoutingAccountConfig)} does not support writing '{options.Format}' format."); + } + } + + TeamsDirectRoutingAccountConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTeamsDirectRoutingAccountConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TeamsDirectRoutingAccountConfig)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TeamsDirectRoutingAccountConfig FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTeamsDirectRoutingAccountConfig(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingAccountConfig.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingAccountConfig.cs new file mode 100644 index 000000000000..d074b9e7b99d --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingAccountConfig.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// Configuration specific to Teams Direct Routing. + public partial class TeamsDirectRoutingAccountConfig + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Enables/disables caller ID screening for the account. Caller ID screening is enabled by default. + /// Enterprise-specific domain name label. Can only contain letters, numbers, underscores and dashes. Can be up to 10 characters in length. + /// DNS TXT value for the Direct Routing regions, as provided by the customer from their Microsoft 365 Admin Center. + /// or is null. + public TeamsDirectRoutingAccountConfig(bool callScreening, string subdomain, TeamsDirectRoutingSubdomainTokens subdomainTokens) + { + Argument.AssertNotNull(subdomain, nameof(subdomain)); + Argument.AssertNotNull(subdomainTokens, nameof(subdomainTokens)); + + CallScreening = callScreening; + Subdomain = subdomain; + SubdomainTokens = subdomainTokens; + } + + /// Initializes a new instance of . + /// Enables/disables caller ID screening for the account. Caller ID screening is enabled by default. + /// Enterprise-specific domain name label. Can only contain letters, numbers, underscores and dashes. Can be up to 10 characters in length. + /// DNS TXT value for the Direct Routing regions, as provided by the customer from their Microsoft 365 Admin Center. + /// Keeps track of any properties unknown to the library. + internal TeamsDirectRoutingAccountConfig(bool callScreening, string subdomain, TeamsDirectRoutingSubdomainTokens subdomainTokens, IDictionary serializedAdditionalRawData) + { + CallScreening = callScreening; + Subdomain = subdomain; + SubdomainTokens = subdomainTokens; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TeamsDirectRoutingAccountConfig() + { + } + + /// Enables/disables caller ID screening for the account. Caller ID screening is enabled by default. + public bool CallScreening { get; set; } + /// Enterprise-specific domain name label. Can only contain letters, numbers, underscores and dashes. Can be up to 10 characters in length. + public string Subdomain { get; set; } + /// DNS TXT value for the Direct Routing regions, as provided by the customer from their Microsoft 365 Admin Center. + public TeamsDirectRoutingSubdomainTokens SubdomainTokens { get; set; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingAccountDetails.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingAccountDetails.Serialization.cs new file mode 100644 index 000000000000..aa1a05cfc620 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingAccountDetails.Serialization.cs @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class TeamsDirectRoutingAccountDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsDirectRoutingAccountDetails)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("syncEnabled"u8); + writer.WriteBooleanValue(SyncEnabled); + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled); + if (options.Format != "W" && Optional.IsDefined(NumberCount)) + { + writer.WritePropertyName("numberCount"u8); + writer.WriteNumberValue(NumberCount.Value); + } + if (Optional.IsDefined(Configuration)) + { + writer.WritePropertyName("configuration"u8); + writer.WriteObjectValue(Configuration, options); + } + if (options.Format != "W") + { + writer.WritePropertyName("subdomainStatus"u8); + writer.WriteStringValue(SubdomainStatus.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + TeamsDirectRoutingAccountDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsDirectRoutingAccountDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTeamsDirectRoutingAccountDetails(document.RootElement, options); + } + + internal static TeamsDirectRoutingAccountDetails DeserializeTeamsDirectRoutingAccountDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool syncEnabled = default; + bool enabled = default; + long? numberCount = default; + TeamsDirectRoutingAccountConfig configuration = default; + TeamsDirectRoutingSubdomainProvisioningStatus subdomainStatus = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("syncEnabled"u8)) + { + syncEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("enabled"u8)) + { + enabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("numberCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("configuration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + configuration = TeamsDirectRoutingAccountConfig.DeserializeTeamsDirectRoutingAccountConfig(property.Value, options); + continue; + } + if (property.NameEquals("subdomainStatus"u8)) + { + subdomainStatus = new TeamsDirectRoutingSubdomainProvisioningStatus(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TeamsDirectRoutingAccountDetails( + syncEnabled, + enabled, + numberCount, + configuration, + subdomainStatus, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TeamsDirectRoutingAccountDetails)} does not support writing '{options.Format}' format."); + } + } + + TeamsDirectRoutingAccountDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTeamsDirectRoutingAccountDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TeamsDirectRoutingAccountDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TeamsDirectRoutingAccountDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTeamsDirectRoutingAccountDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingAccountDetails.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingAccountDetails.cs new file mode 100644 index 000000000000..b9fef8134b2f --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingAccountDetails.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// Account details specific to Teams Direct Routing on this Account. + public partial class TeamsDirectRoutingAccountDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Boolean indicating if data is being provisioned through the backend service. + /// Boolean indicating if the service is enabled on this Account. + public TeamsDirectRoutingAccountDetails(bool syncEnabled, bool enabled) + { + SyncEnabled = syncEnabled; + Enabled = enabled; + } + + /// Initializes a new instance of . + /// Boolean indicating if data is being provisioned through the backend service. + /// Boolean indicating if the service is enabled on this Account. + /// The count of telephone numbers associated with this account that have this backend service enabled. + /// The configuration for Teams Direct Routing on this account. + /// The provisioning status of the domains. + /// Keeps track of any properties unknown to the library. + internal TeamsDirectRoutingAccountDetails(bool syncEnabled, bool enabled, long? numberCount, TeamsDirectRoutingAccountConfig configuration, TeamsDirectRoutingSubdomainProvisioningStatus subdomainStatus, IDictionary serializedAdditionalRawData) + { + SyncEnabled = syncEnabled; + Enabled = enabled; + NumberCount = numberCount; + Configuration = configuration; + SubdomainStatus = subdomainStatus; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TeamsDirectRoutingAccountDetails() + { + } + + /// Boolean indicating if data is being provisioned through the backend service. + public bool SyncEnabled { get; set; } + /// Boolean indicating if the service is enabled on this Account. + public bool Enabled { get; set; } + /// The count of telephone numbers associated with this account that have this backend service enabled. + public long? NumberCount { get; } + /// The configuration for Teams Direct Routing on this account. + public TeamsDirectRoutingAccountConfig Configuration { get; set; } + /// The provisioning status of the domains. + public TeamsDirectRoutingSubdomainProvisioningStatus SubdomainStatus { get; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingNumberDetails.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingNumberDetails.Serialization.cs new file mode 100644 index 000000000000..b752877c8de7 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingNumberDetails.Serialization.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class TeamsDirectRoutingNumberDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsDirectRoutingNumberDetails)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + TeamsDirectRoutingNumberDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsDirectRoutingNumberDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTeamsDirectRoutingNumberDetails(document.RootElement, options); + } + + internal static TeamsDirectRoutingNumberDetails DeserializeTeamsDirectRoutingNumberDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool enabled = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enabled"u8)) + { + enabled = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TeamsDirectRoutingNumberDetails(enabled, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TeamsDirectRoutingNumberDetails)} does not support writing '{options.Format}' format."); + } + } + + TeamsDirectRoutingNumberDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTeamsDirectRoutingNumberDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TeamsDirectRoutingNumberDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TeamsDirectRoutingNumberDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTeamsDirectRoutingNumberDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolAccountsListResult.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingNumberDetails.cs similarity index 61% rename from sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolAccountsListResult.cs rename to sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingNumberDetails.cs index e806ee3012a6..ebc68a7a354d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolAccountsListResult.cs +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingNumberDetails.cs @@ -8,10 +8,10 @@ using System; using System.Collections.Generic; -namespace Azure.ResourceManager.CosmosDB.Models +namespace Microsoft.VoiceServices.Provisioning { - /// The List operation response, that contains the global database accounts and their properties. - internal partial class ThroughputPoolAccountsListResult + /// Details for the Teams Direct Routing service on this Number. + public partial class TeamsDirectRoutingNumberDetails { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +45,28 @@ internal partial class ThroughputPoolAccountsListResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal ThroughputPoolAccountsListResult() + /// Initializes a new instance of . + /// Boolean indicating if the service is enabled on this Number. + public TeamsDirectRoutingNumberDetails(bool enabled) { - Value = new ChangeTrackingList(); + Enabled = enabled; } - /// Initializes a new instance of . - /// List of global database accounts in a throughput pool and their properties. - /// The link used to get the next page of results. + /// Initializes a new instance of . + /// Boolean indicating if the service is enabled on this Number. /// Keeps track of any properties unknown to the library. - internal ThroughputPoolAccountsListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal TeamsDirectRoutingNumberDetails(bool enabled, IDictionary serializedAdditionalRawData) { - Value = value; - NextLink = nextLink; + Enabled = enabled; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// List of global database accounts in a throughput pool and their properties. - public IReadOnlyList Value { get; } - /// The link used to get the next page of results. - public string NextLink { get; } + /// Initializes a new instance of for deserialization. + internal TeamsDirectRoutingNumberDetails() + { + } + + /// Boolean indicating if the service is enabled on this Number. + public bool Enabled { get; set; } } } diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingSubdomainProvisioningStatus.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingSubdomainProvisioningStatus.cs new file mode 100644 index 000000000000..3225f46f4644 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingSubdomainProvisioningStatus.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// Possible values for DNS provisioning state of Teams Direct Routing domains. + public readonly partial struct TeamsDirectRoutingSubdomainProvisioningStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TeamsDirectRoutingSubdomainProvisioningStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ProvisionedValue = "provisioned"; + private const string NotProvisionedValue = "notProvisioned"; + private const string InconsistentValue = "inconsistent"; + + /// The DNS provisioning state Provisioned. + public static TeamsDirectRoutingSubdomainProvisioningStatus Provisioned { get; } = new TeamsDirectRoutingSubdomainProvisioningStatus(ProvisionedValue); + /// The DNS provisioning state Not Provisioned. + public static TeamsDirectRoutingSubdomainProvisioningStatus NotProvisioned { get; } = new TeamsDirectRoutingSubdomainProvisioningStatus(NotProvisionedValue); + /// The DNS provisioning state Inconsistent. + public static TeamsDirectRoutingSubdomainProvisioningStatus Inconsistent { get; } = new TeamsDirectRoutingSubdomainProvisioningStatus(InconsistentValue); + /// Determines if two values are the same. + public static bool operator ==(TeamsDirectRoutingSubdomainProvisioningStatus left, TeamsDirectRoutingSubdomainProvisioningStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TeamsDirectRoutingSubdomainProvisioningStatus left, TeamsDirectRoutingSubdomainProvisioningStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator TeamsDirectRoutingSubdomainProvisioningStatus(string value) => new TeamsDirectRoutingSubdomainProvisioningStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TeamsDirectRoutingSubdomainProvisioningStatus other && Equals(other); + /// + public bool Equals(TeamsDirectRoutingSubdomainProvisioningStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingSubdomainTokens.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingSubdomainTokens.Serialization.cs new file mode 100644 index 000000000000..f2494a1a0c8a --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingSubdomainTokens.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class TeamsDirectRoutingSubdomainTokens : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsDirectRoutingSubdomainTokens)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("region1Token"u8); + writer.WriteStringValue(Region1Token); + writer.WritePropertyName("region2Token"u8); + writer.WriteStringValue(Region2Token); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + TeamsDirectRoutingSubdomainTokens IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsDirectRoutingSubdomainTokens)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTeamsDirectRoutingSubdomainTokens(document.RootElement, options); + } + + internal static TeamsDirectRoutingSubdomainTokens DeserializeTeamsDirectRoutingSubdomainTokens(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string region1Token = default; + string region2Token = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("region1Token"u8)) + { + region1Token = property.Value.GetString(); + continue; + } + if (property.NameEquals("region2Token"u8)) + { + region2Token = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TeamsDirectRoutingSubdomainTokens(region1Token, region2Token, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TeamsDirectRoutingSubdomainTokens)} does not support writing '{options.Format}' format."); + } + } + + TeamsDirectRoutingSubdomainTokens IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTeamsDirectRoutingSubdomainTokens(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TeamsDirectRoutingSubdomainTokens)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TeamsDirectRoutingSubdomainTokens FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTeamsDirectRoutingSubdomainTokens(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingSubdomainTokens.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingSubdomainTokens.cs new file mode 100644 index 000000000000..b2f2b78bd2a2 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsDirectRoutingSubdomainTokens.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// DNS TXT value for the region, as provided by the enterprise admin from their Microsoft 365 Admin Center. Can only contain letters, numbers, underscores and dashes. Can be up to 100 characters in length. + public partial class TeamsDirectRoutingSubdomainTokens + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// DNS TXT value for the first region, as provided by the enterprise admin from their Microsoft 365 Admin Center. Can only contain letters, numbers, underscores and dashes. Can be up to 100 characters in length. + /// DNS TXT value for the second region, as provided by the enterprise admin from their Microsoft 365 Admin Center. Can only contain letters, numbers, underscores and dashes. Can be up to 100 characters in length. + /// or is null. + public TeamsDirectRoutingSubdomainTokens(string region1Token, string region2Token) + { + Argument.AssertNotNull(region1Token, nameof(region1Token)); + Argument.AssertNotNull(region2Token, nameof(region2Token)); + + Region1Token = region1Token; + Region2Token = region2Token; + } + + /// Initializes a new instance of . + /// DNS TXT value for the first region, as provided by the enterprise admin from their Microsoft 365 Admin Center. Can only contain letters, numbers, underscores and dashes. Can be up to 100 characters in length. + /// DNS TXT value for the second region, as provided by the enterprise admin from their Microsoft 365 Admin Center. Can only contain letters, numbers, underscores and dashes. Can be up to 100 characters in length. + /// Keeps track of any properties unknown to the library. + internal TeamsDirectRoutingSubdomainTokens(string region1Token, string region2Token, IDictionary serializedAdditionalRawData) + { + Region1Token = region1Token; + Region2Token = region2Token; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TeamsDirectRoutingSubdomainTokens() + { + } + + /// DNS TXT value for the first region, as provided by the enterprise admin from their Microsoft 365 Admin Center. Can only contain letters, numbers, underscores and dashes. Can be up to 100 characters in length. + public string Region1Token { get; set; } + /// DNS TXT value for the second region, as provided by the enterprise admin from their Microsoft 365 Admin Center. Can only contain letters, numbers, underscores and dashes. Can be up to 100 characters in length. + public string Region2Token { get; set; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectAccountDetails.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectAccountDetails.Serialization.cs new file mode 100644 index 000000000000..8072155055e8 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectAccountDetails.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class TeamsOperatorConnectAccountDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsOperatorConnectAccountDetails)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("syncEnabled"u8); + writer.WriteBooleanValue(SyncEnabled); + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled); + if (options.Format != "W" && Optional.IsDefined(NumberCount)) + { + writer.WritePropertyName("numberCount"u8); + writer.WriteNumberValue(NumberCount.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + TeamsOperatorConnectAccountDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsOperatorConnectAccountDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTeamsOperatorConnectAccountDetails(document.RootElement, options); + } + + internal static TeamsOperatorConnectAccountDetails DeserializeTeamsOperatorConnectAccountDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool syncEnabled = default; + bool enabled = default; + long? numberCount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("syncEnabled"u8)) + { + syncEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("enabled"u8)) + { + enabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("numberCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberCount = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TeamsOperatorConnectAccountDetails(syncEnabled, enabled, numberCount, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TeamsOperatorConnectAccountDetails)} does not support writing '{options.Format}' format."); + } + } + + TeamsOperatorConnectAccountDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTeamsOperatorConnectAccountDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TeamsOperatorConnectAccountDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TeamsOperatorConnectAccountDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTeamsOperatorConnectAccountDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectAccountDetails.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectAccountDetails.cs new file mode 100644 index 000000000000..b367f1505d8a --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectAccountDetails.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// Account details specific to Teams Operator Connect on this Account. + public partial class TeamsOperatorConnectAccountDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Boolean indicating if data is being provisioned through the backend service. + /// Boolean indicating if the service is enabled on this Account. + public TeamsOperatorConnectAccountDetails(bool syncEnabled, bool enabled) + { + SyncEnabled = syncEnabled; + Enabled = enabled; + } + + /// Initializes a new instance of . + /// Boolean indicating if data is being provisioned through the backend service. + /// Boolean indicating if the service is enabled on this Account. + /// The count of telephone numbers associated with this account that have this backend service enabled. + /// Keeps track of any properties unknown to the library. + internal TeamsOperatorConnectAccountDetails(bool syncEnabled, bool enabled, long? numberCount, IDictionary serializedAdditionalRawData) + { + SyncEnabled = syncEnabled; + Enabled = enabled; + NumberCount = numberCount; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TeamsOperatorConnectAccountDetails() + { + } + + /// Boolean indicating if data is being provisioned through the backend service. + public bool SyncEnabled { get; set; } + /// Boolean indicating if the service is enabled on this Account. + public bool Enabled { get; set; } + /// The count of telephone numbers associated with this account that have this backend service enabled. + public long? NumberCount { get; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectNumberConfig.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectNumberConfig.Serialization.cs new file mode 100644 index 000000000000..1f4dafd48895 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectNumberConfig.Serialization.cs @@ -0,0 +1,287 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class TeamsOperatorConnectNumberConfig : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsOperatorConnectNumberConfig)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("usage"u8); + writer.WriteStringValue(Usage); + writer.WritePropertyName("choosableCapabilities"u8); + writer.WriteStartArray(); + foreach (var item in ChoosableCapabilities) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && Optional.IsCollectionDefined(AcquiredCapabilities)) + { + writer.WritePropertyName("acquiredCapabilities"u8); + writer.WriteStartArray(); + foreach (var item in AcquiredCapabilities) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(AvailableCapabilities)) + { + writer.WritePropertyName("availableCapabilities"u8); + writer.WriteStartArray(); + foreach (var item in AvailableCapabilities) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(AdditionalUsages)) + { + writer.WritePropertyName("additionalUsages"u8); + writer.WriteStartArray(); + foreach (var item in AdditionalUsages) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(CivicAddressId)) + { + writer.WritePropertyName("civicAddressId"u8); + writer.WriteStringValue(CivicAddressId); + } + if (Optional.IsDefined(LocationId)) + { + writer.WritePropertyName("locationId"u8); + writer.WriteStringValue(LocationId); + } + if (Optional.IsDefined(AllowTenantAddressUpdate)) + { + writer.WritePropertyName("allowTenantAddressUpdate"u8); + writer.WriteBooleanValue(AllowTenantAddressUpdate.Value); + } + if (Optional.IsDefined(DisplayedCountryCode)) + { + writer.WritePropertyName("displayedCountryCode"u8); + writer.WriteStringValue(DisplayedCountryCode); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + TeamsOperatorConnectNumberConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsOperatorConnectNumberConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTeamsOperatorConnectNumberConfig(document.RootElement, options); + } + + internal static TeamsOperatorConnectNumberConfig DeserializeTeamsOperatorConnectNumberConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string usage = default; + IList choosableCapabilities = default; + IReadOnlyList acquiredCapabilities = default; + IReadOnlyList availableCapabilities = default; + IList additionalUsages = default; + string civicAddressId = default; + string locationId = default; + bool? allowTenantAddressUpdate = default; + string displayedCountryCode = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("usage"u8)) + { + usage = property.Value.GetString(); + continue; + } + if (property.NameEquals("choosableCapabilities"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + choosableCapabilities = array; + continue; + } + if (property.NameEquals("acquiredCapabilities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + acquiredCapabilities = array; + continue; + } + if (property.NameEquals("availableCapabilities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + availableCapabilities = array; + continue; + } + if (property.NameEquals("additionalUsages"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + additionalUsages = array; + continue; + } + if (property.NameEquals("civicAddressId"u8)) + { + civicAddressId = property.Value.GetString(); + continue; + } + if (property.NameEquals("locationId"u8)) + { + locationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("allowTenantAddressUpdate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allowTenantAddressUpdate = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("displayedCountryCode"u8)) + { + displayedCountryCode = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TeamsOperatorConnectNumberConfig( + usage, + choosableCapabilities, + acquiredCapabilities ?? new ChangeTrackingList(), + availableCapabilities ?? new ChangeTrackingList(), + additionalUsages ?? new ChangeTrackingList(), + civicAddressId, + locationId, + allowTenantAddressUpdate, + displayedCountryCode, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TeamsOperatorConnectNumberConfig)} does not support writing '{options.Format}' format."); + } + } + + TeamsOperatorConnectNumberConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTeamsOperatorConnectNumberConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TeamsOperatorConnectNumberConfig)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TeamsOperatorConnectNumberConfig FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTeamsOperatorConnectNumberConfig(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectNumberConfig.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectNumberConfig.cs new file mode 100644 index 000000000000..5029e46ddeea --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectNumberConfig.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// Telephone number configuration for Teams Operator Connect telephone numbers. + public partial class TeamsOperatorConnectNumberConfig + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The usage for this telephone number. + /// The choosable capabilities for this telephone number. + /// or is null. + public TeamsOperatorConnectNumberConfig(string usage, IEnumerable choosableCapabilities) + { + Argument.AssertNotNull(usage, nameof(usage)); + Argument.AssertNotNull(choosableCapabilities, nameof(choosableCapabilities)); + + Usage = usage; + ChoosableCapabilities = choosableCapabilities.ToList(); + AcquiredCapabilities = new ChangeTrackingList(); + AvailableCapabilities = new ChangeTrackingList(); + AdditionalUsages = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The usage for this telephone number. + /// The choosable capabilities for this telephone number. + /// The acquired capabilities for this telephone number. + /// The available capabilities for this telephone number. + /// The additional usages for this telephone number. + /// The ID of the civic address to be used as the emergency address for this telephone number. + /// The ID of the location to be used as the emergency address for this telephone number. + /// If the enterprise is allowed to update the address for this telephone number. + /// The country code to be displayed with this telephone number. + /// Keeps track of any properties unknown to the library. + internal TeamsOperatorConnectNumberConfig(string usage, IList choosableCapabilities, IReadOnlyList acquiredCapabilities, IReadOnlyList availableCapabilities, IList additionalUsages, string civicAddressId, string locationId, bool? allowTenantAddressUpdate, string displayedCountryCode, IDictionary serializedAdditionalRawData) + { + Usage = usage; + ChoosableCapabilities = choosableCapabilities; + AcquiredCapabilities = acquiredCapabilities; + AvailableCapabilities = availableCapabilities; + AdditionalUsages = additionalUsages; + CivicAddressId = civicAddressId; + LocationId = locationId; + AllowTenantAddressUpdate = allowTenantAddressUpdate; + DisplayedCountryCode = displayedCountryCode; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TeamsOperatorConnectNumberConfig() + { + } + + /// The usage for this telephone number. + public string Usage { get; set; } + /// The choosable capabilities for this telephone number. + public IList ChoosableCapabilities { get; } + /// The acquired capabilities for this telephone number. + public IReadOnlyList AcquiredCapabilities { get; } + /// The available capabilities for this telephone number. + public IReadOnlyList AvailableCapabilities { get; } + /// The additional usages for this telephone number. + public IList AdditionalUsages { get; } + /// The ID of the civic address to be used as the emergency address for this telephone number. + public string CivicAddressId { get; set; } + /// The ID of the location to be used as the emergency address for this telephone number. + public string LocationId { get; set; } + /// If the enterprise is allowed to update the address for this telephone number. + public bool? AllowTenantAddressUpdate { get; set; } + /// The country code to be displayed with this telephone number. + public string DisplayedCountryCode { get; set; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectNumberDetails.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectNumberDetails.Serialization.cs new file mode 100644 index 000000000000..6ca6b3b8c70a --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectNumberDetails.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class TeamsOperatorConnectNumberDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsOperatorConnectNumberDetails)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled); + if (Optional.IsDefined(AssignmentStatus)) + { + writer.WritePropertyName("assignmentStatus"u8); + writer.WriteStringValue(AssignmentStatus.Value.ToString()); + } + if (Optional.IsDefined(Configuration)) + { + writer.WritePropertyName("configuration"u8); + writer.WriteObjectValue(Configuration, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + TeamsOperatorConnectNumberDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsOperatorConnectNumberDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTeamsOperatorConnectNumberDetails(document.RootElement, options); + } + + internal static TeamsOperatorConnectNumberDetails DeserializeTeamsOperatorConnectNumberDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool enabled = default; + TelephoneNumberAssignmentStatus? assignmentStatus = default; + TeamsOperatorConnectNumberConfig configuration = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enabled"u8)) + { + enabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("assignmentStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + assignmentStatus = new TelephoneNumberAssignmentStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("configuration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + configuration = TeamsOperatorConnectNumberConfig.DeserializeTeamsOperatorConnectNumberConfig(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TeamsOperatorConnectNumberDetails(enabled, assignmentStatus, configuration, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TeamsOperatorConnectNumberDetails)} does not support writing '{options.Format}' format."); + } + } + + TeamsOperatorConnectNumberDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTeamsOperatorConnectNumberDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TeamsOperatorConnectNumberDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TeamsOperatorConnectNumberDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTeamsOperatorConnectNumberDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectNumberDetails.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectNumberDetails.cs new file mode 100644 index 000000000000..052ff99c39f8 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsOperatorConnectNumberDetails.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// Details for the Teams Operator Connect service on this Number. + public partial class TeamsOperatorConnectNumberDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Boolean indicating if the service is enabled on this Number. + public TeamsOperatorConnectNumberDetails(bool enabled) + { + Enabled = enabled; + } + + /// Initializes a new instance of . + /// Boolean indicating if the service is enabled on this Number. + /// The assignment status of this Number. + /// The configuration for Teams Operator Connect on this number. + /// Keeps track of any properties unknown to the library. + internal TeamsOperatorConnectNumberDetails(bool enabled, TelephoneNumberAssignmentStatus? assignmentStatus, TeamsOperatorConnectNumberConfig configuration, IDictionary serializedAdditionalRawData) + { + Enabled = enabled; + AssignmentStatus = assignmentStatus; + Configuration = configuration; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TeamsOperatorConnectNumberDetails() + { + } + + /// Boolean indicating if the service is enabled on this Number. + public bool Enabled { get; set; } + /// The assignment status of this Number. + public TelephoneNumberAssignmentStatus? AssignmentStatus { get; set; } + /// The configuration for Teams Operator Connect on this number. + public TeamsOperatorConnectNumberConfig Configuration { get; set; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileAccountDetails.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileAccountDetails.Serialization.cs new file mode 100644 index 000000000000..580d92bbeed3 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileAccountDetails.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class TeamsPhoneMobileAccountDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsPhoneMobileAccountDetails)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("syncEnabled"u8); + writer.WriteBooleanValue(SyncEnabled); + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled); + if (options.Format != "W" && Optional.IsDefined(NumberCount)) + { + writer.WritePropertyName("numberCount"u8); + writer.WriteNumberValue(NumberCount.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + TeamsPhoneMobileAccountDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsPhoneMobileAccountDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTeamsPhoneMobileAccountDetails(document.RootElement, options); + } + + internal static TeamsPhoneMobileAccountDetails DeserializeTeamsPhoneMobileAccountDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool syncEnabled = default; + bool enabled = default; + long? numberCount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("syncEnabled"u8)) + { + syncEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("enabled"u8)) + { + enabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("numberCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberCount = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TeamsPhoneMobileAccountDetails(syncEnabled, enabled, numberCount, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TeamsPhoneMobileAccountDetails)} does not support writing '{options.Format}' format."); + } + } + + TeamsPhoneMobileAccountDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTeamsPhoneMobileAccountDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TeamsPhoneMobileAccountDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TeamsPhoneMobileAccountDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTeamsPhoneMobileAccountDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileAccountDetails.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileAccountDetails.cs new file mode 100644 index 000000000000..d1896867d8c2 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileAccountDetails.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// Account details specific to Teams Phone Mobile. + public partial class TeamsPhoneMobileAccountDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Boolean indicating if data is being provisioned through the backend service. + /// Boolean indicating if the service is enabled on this Account. + public TeamsPhoneMobileAccountDetails(bool syncEnabled, bool enabled) + { + SyncEnabled = syncEnabled; + Enabled = enabled; + } + + /// Initializes a new instance of . + /// Boolean indicating if data is being provisioned through the backend service. + /// Boolean indicating if the service is enabled on this Account. + /// The count of telephone numbers associated with this account that have this backend service enabled. + /// Keeps track of any properties unknown to the library. + internal TeamsPhoneMobileAccountDetails(bool syncEnabled, bool enabled, long? numberCount, IDictionary serializedAdditionalRawData) + { + SyncEnabled = syncEnabled; + Enabled = enabled; + NumberCount = numberCount; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TeamsPhoneMobileAccountDetails() + { + } + + /// Boolean indicating if data is being provisioned through the backend service. + public bool SyncEnabled { get; set; } + /// Boolean indicating if the service is enabled on this Account. + public bool Enabled { get; set; } + /// The count of telephone numbers associated with this account that have this backend service enabled. + public long? NumberCount { get; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileNumberConfig.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileNumberConfig.Serialization.cs new file mode 100644 index 000000000000..a508bb96102a --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileNumberConfig.Serialization.cs @@ -0,0 +1,287 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class TeamsPhoneMobileNumberConfig : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsPhoneMobileNumberConfig)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("usage"u8); + writer.WriteStringValue(Usage); + writer.WritePropertyName("choosableCapabilities"u8); + writer.WriteStartArray(); + foreach (var item in ChoosableCapabilities) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && Optional.IsCollectionDefined(AcquiredCapabilities)) + { + writer.WritePropertyName("acquiredCapabilities"u8); + writer.WriteStartArray(); + foreach (var item in AcquiredCapabilities) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(AvailableCapabilities)) + { + writer.WritePropertyName("availableCapabilities"u8); + writer.WriteStartArray(); + foreach (var item in AvailableCapabilities) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(AdditionalUsages)) + { + writer.WritePropertyName("additionalUsages"u8); + writer.WriteStartArray(); + foreach (var item in AdditionalUsages) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(CivicAddressId)) + { + writer.WritePropertyName("civicAddressId"u8); + writer.WriteStringValue(CivicAddressId); + } + if (Optional.IsDefined(LocationId)) + { + writer.WritePropertyName("locationId"u8); + writer.WriteStringValue(LocationId); + } + if (Optional.IsDefined(AllowTenantAddressUpdate)) + { + writer.WritePropertyName("allowTenantAddressUpdate"u8); + writer.WriteBooleanValue(AllowTenantAddressUpdate.Value); + } + if (Optional.IsDefined(DisplayedCountryCode)) + { + writer.WritePropertyName("displayedCountryCode"u8); + writer.WriteStringValue(DisplayedCountryCode); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + TeamsPhoneMobileNumberConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsPhoneMobileNumberConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTeamsPhoneMobileNumberConfig(document.RootElement, options); + } + + internal static TeamsPhoneMobileNumberConfig DeserializeTeamsPhoneMobileNumberConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string usage = default; + IList choosableCapabilities = default; + IReadOnlyList acquiredCapabilities = default; + IReadOnlyList availableCapabilities = default; + IList additionalUsages = default; + string civicAddressId = default; + string locationId = default; + bool? allowTenantAddressUpdate = default; + string displayedCountryCode = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("usage"u8)) + { + usage = property.Value.GetString(); + continue; + } + if (property.NameEquals("choosableCapabilities"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + choosableCapabilities = array; + continue; + } + if (property.NameEquals("acquiredCapabilities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + acquiredCapabilities = array; + continue; + } + if (property.NameEquals("availableCapabilities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + availableCapabilities = array; + continue; + } + if (property.NameEquals("additionalUsages"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + additionalUsages = array; + continue; + } + if (property.NameEquals("civicAddressId"u8)) + { + civicAddressId = property.Value.GetString(); + continue; + } + if (property.NameEquals("locationId"u8)) + { + locationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("allowTenantAddressUpdate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allowTenantAddressUpdate = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("displayedCountryCode"u8)) + { + displayedCountryCode = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TeamsPhoneMobileNumberConfig( + usage, + choosableCapabilities, + acquiredCapabilities ?? new ChangeTrackingList(), + availableCapabilities ?? new ChangeTrackingList(), + additionalUsages ?? new ChangeTrackingList(), + civicAddressId, + locationId, + allowTenantAddressUpdate, + displayedCountryCode, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TeamsPhoneMobileNumberConfig)} does not support writing '{options.Format}' format."); + } + } + + TeamsPhoneMobileNumberConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTeamsPhoneMobileNumberConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TeamsPhoneMobileNumberConfig)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TeamsPhoneMobileNumberConfig FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTeamsPhoneMobileNumberConfig(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileNumberConfig.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileNumberConfig.cs new file mode 100644 index 000000000000..f735d91ff1d0 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileNumberConfig.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// Telephone number configuration for Teams Phone Mobile telephone numbers. + public partial class TeamsPhoneMobileNumberConfig + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The usage for this telephone number. + /// The choosable capabilities for this telephone number. + /// or is null. + public TeamsPhoneMobileNumberConfig(string usage, IEnumerable choosableCapabilities) + { + Argument.AssertNotNull(usage, nameof(usage)); + Argument.AssertNotNull(choosableCapabilities, nameof(choosableCapabilities)); + + Usage = usage; + ChoosableCapabilities = choosableCapabilities.ToList(); + AcquiredCapabilities = new ChangeTrackingList(); + AvailableCapabilities = new ChangeTrackingList(); + AdditionalUsages = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The usage for this telephone number. + /// The choosable capabilities for this telephone number. + /// The acquired capabilities for this telephone number. + /// The available capabilities for this telephone number. + /// The additional usages for this telephone number. + /// The ID of the civic address to be used as the emergency address for this telephone number. + /// The ID of the location to be used as the emergency address for this telephone number. + /// If the enterprise is allowed to update the address for this telephone number. + /// The country code to be displayed with this telephone number. + /// Keeps track of any properties unknown to the library. + internal TeamsPhoneMobileNumberConfig(string usage, IList choosableCapabilities, IReadOnlyList acquiredCapabilities, IReadOnlyList availableCapabilities, IList additionalUsages, string civicAddressId, string locationId, bool? allowTenantAddressUpdate, string displayedCountryCode, IDictionary serializedAdditionalRawData) + { + Usage = usage; + ChoosableCapabilities = choosableCapabilities; + AcquiredCapabilities = acquiredCapabilities; + AvailableCapabilities = availableCapabilities; + AdditionalUsages = additionalUsages; + CivicAddressId = civicAddressId; + LocationId = locationId; + AllowTenantAddressUpdate = allowTenantAddressUpdate; + DisplayedCountryCode = displayedCountryCode; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TeamsPhoneMobileNumberConfig() + { + } + + /// The usage for this telephone number. + public string Usage { get; set; } + /// The choosable capabilities for this telephone number. + public IList ChoosableCapabilities { get; } + /// The acquired capabilities for this telephone number. + public IReadOnlyList AcquiredCapabilities { get; } + /// The available capabilities for this telephone number. + public IReadOnlyList AvailableCapabilities { get; } + /// The additional usages for this telephone number. + public IList AdditionalUsages { get; } + /// The ID of the civic address to be used as the emergency address for this telephone number. + public string CivicAddressId { get; set; } + /// The ID of the location to be used as the emergency address for this telephone number. + public string LocationId { get; set; } + /// If the enterprise is allowed to update the address for this telephone number. + public bool? AllowTenantAddressUpdate { get; set; } + /// The country code to be displayed with this telephone number. + public string DisplayedCountryCode { get; set; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileNumberDetails.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileNumberDetails.Serialization.cs new file mode 100644 index 000000000000..2da5f0d1a69f --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileNumberDetails.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class TeamsPhoneMobileNumberDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsPhoneMobileNumberDetails)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled); + if (Optional.IsDefined(AssignmentStatus)) + { + writer.WritePropertyName("assignmentStatus"u8); + writer.WriteStringValue(AssignmentStatus.Value.ToString()); + } + if (Optional.IsDefined(Configuration)) + { + writer.WritePropertyName("configuration"u8); + writer.WriteObjectValue(Configuration, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + TeamsPhoneMobileNumberDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TeamsPhoneMobileNumberDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTeamsPhoneMobileNumberDetails(document.RootElement, options); + } + + internal static TeamsPhoneMobileNumberDetails DeserializeTeamsPhoneMobileNumberDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool enabled = default; + TelephoneNumberAssignmentStatus? assignmentStatus = default; + TeamsPhoneMobileNumberConfig configuration = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enabled"u8)) + { + enabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("assignmentStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + assignmentStatus = new TelephoneNumberAssignmentStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("configuration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + configuration = TeamsPhoneMobileNumberConfig.DeserializeTeamsPhoneMobileNumberConfig(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TeamsPhoneMobileNumberDetails(enabled, assignmentStatus, configuration, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TeamsPhoneMobileNumberDetails)} does not support writing '{options.Format}' format."); + } + } + + TeamsPhoneMobileNumberDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTeamsPhoneMobileNumberDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TeamsPhoneMobileNumberDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TeamsPhoneMobileNumberDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTeamsPhoneMobileNumberDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileNumberDetails.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileNumberDetails.cs new file mode 100644 index 000000000000..e231b281d666 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsPhoneMobileNumberDetails.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// Details for the Teams Phone Mobile service on this Number. + public partial class TeamsPhoneMobileNumberDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Boolean indicating if the service is enabled on this Number. + public TeamsPhoneMobileNumberDetails(bool enabled) + { + Enabled = enabled; + } + + /// Initializes a new instance of . + /// Boolean indicating if the service is enabled on this Number. + /// The assignment status of this Number. + /// The configuration for Teams Phone Mobile on this number. + /// Keeps track of any properties unknown to the library. + internal TeamsPhoneMobileNumberDetails(bool enabled, TelephoneNumberAssignmentStatus? assignmentStatus, TeamsPhoneMobileNumberConfig configuration, IDictionary serializedAdditionalRawData) + { + Enabled = enabled; + AssignmentStatus = assignmentStatus; + Configuration = configuration; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TeamsPhoneMobileNumberDetails() + { + } + + /// Boolean indicating if the service is enabled on this Number. + public bool Enabled { get; set; } + /// The assignment status of this Number. + public TelephoneNumberAssignmentStatus? AssignmentStatus { get; set; } + /// The configuration for Teams Phone Mobile on this number. + public TeamsPhoneMobileNumberConfig Configuration { get; set; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsRequestsForInformation.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsRequestsForInformation.cs new file mode 100644 index 000000000000..b3162ad16d6e --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TeamsRequestsForInformation.cs @@ -0,0 +1,447 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Microsoft.VoiceServices.Provisioning +{ + // Data plane generated sub-client. + /// The TeamsRequestsForInformation sub-client. + public partial class TeamsRequestsForInformation + { + private static readonly string[] AuthorizationScopes = new string[] { "https://func-voiceservice-rp-prod-eastuseuap.azurewebsites.net/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of TeamsRequestsForInformation for mocking. + protected TeamsRequestsForInformation() + { + } + + /// Initializes a new instance of TeamsRequestsForInformation. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The token credential to copy. + /// The to use. + /// The API version to use for this operation. + internal TeamsRequestsForInformation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, TokenCredential tokenCredential, Uri endpoint, string apiVersion) + { + ClientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + _tokenCredential = tokenCredential; + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + /// Get Request for Information. + /// The Teams tenant ID which generated this Request for Information. + /// The content to send as the request conditions of the request. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Get details of a specific Request for Information using its ID. + /// + public virtual async Task> GetRequestForInformationAsync(string tenantId, RequestConditions requestConditions = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(tenantId, nameof(tenantId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetRequestForInformationAsync(tenantId, requestConditions, context).ConfigureAwait(false); + return Response.FromValue(RequestForInformationResource.FromResponse(response), response); + } + + /// Get Request for Information. + /// The Teams tenant ID which generated this Request for Information. + /// The content to send as the request conditions of the request. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Get details of a specific Request for Information using its ID. + /// + public virtual Response GetRequestForInformation(string tenantId, RequestConditions requestConditions = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(tenantId, nameof(tenantId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetRequestForInformation(tenantId, requestConditions, context); + return Response.FromValue(RequestForInformationResource.FromResponse(response), response); + } + + /// + /// [Protocol Method] Get Request for Information. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The Teams tenant ID which generated this Request for Information. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetRequestForInformationAsync(string tenantId, RequestConditions requestConditions, RequestContext context) + { + Argument.AssertNotNullOrEmpty(tenantId, nameof(tenantId)); + + using var scope = ClientDiagnostics.CreateScope("TeamsRequestsForInformation.GetRequestForInformation"); + scope.Start(); + try + { + using HttpMessage message = CreateGetRequestForInformationRequest(tenantId, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Get Request for Information. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The Teams tenant ID which generated this Request for Information. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetRequestForInformation(string tenantId, RequestConditions requestConditions, RequestContext context) + { + Argument.AssertNotNullOrEmpty(tenantId, nameof(tenantId)); + + using var scope = ClientDiagnostics.CreateScope("TeamsRequestsForInformation.GetRequestForInformation"); + scope.Start(); + try + { + using HttpMessage message = CreateGetRequestForInformationRequest(tenantId, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Create or update Request for Information. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The Teams tenant ID which generated this Request for Information. + /// The content to send as the body of the request. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task CreateOrUpdateRequestForInformationAsync(string tenantId, RequestContent content, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(tenantId, nameof(tenantId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TeamsRequestsForInformation.CreateOrUpdateRequestForInformation"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrUpdateRequestForInformationRequest(tenantId, content, requestConditions, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Create or update Request for Information. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The Teams tenant ID which generated this Request for Information. + /// The content to send as the body of the request. + /// The content to send as the request conditions of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response CreateOrUpdateRequestForInformation(string tenantId, RequestContent content, RequestConditions requestConditions = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(tenantId, nameof(tenantId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TeamsRequestsForInformation.CreateOrUpdateRequestForInformation"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrUpdateRequestForInformationRequest(tenantId, content, requestConditions, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Get list of Requests for Information. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// Whether to return a count of the total number of records available for this request. + /// The cancellation token to use. + /// Get list of Requests for Information with details. + /// + public virtual AsyncPageable GetRequestForInformationResourcesAsync(int? maxCount = null, int? skip = null, int? maxpagesize = null, string filter = null, bool? countRecords = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetRequestForInformationResourcesRequest(maxCount, skip, maxpagesize, filter, countRecords, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetRequestForInformationResourcesNextPageRequest(nextLink, maxCount, skip, maxpagesize, filter, countRecords, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => RequestForInformationResource.DeserializeRequestForInformationResource(e), ClientDiagnostics, _pipeline, "TeamsRequestsForInformation.GetRequestForInformationResources", "value", "nextLink", context); + } + + /// Get list of Requests for Information. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// Whether to return a count of the total number of records available for this request. + /// The cancellation token to use. + /// Get list of Requests for Information with details. + /// + public virtual Pageable GetRequestForInformationResources(int? maxCount = null, int? skip = null, int? maxpagesize = null, string filter = null, bool? countRecords = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetRequestForInformationResourcesRequest(maxCount, skip, maxpagesize, filter, countRecords, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetRequestForInformationResourcesNextPageRequest(nextLink, maxCount, skip, maxpagesize, filter, countRecords, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => RequestForInformationResource.DeserializeRequestForInformationResource(e), ClientDiagnostics, _pipeline, "TeamsRequestsForInformation.GetRequestForInformationResources", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Get list of Requests for Information + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// Whether to return a count of the total number of records available for this request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetRequestForInformationResourcesAsync(int? maxCount, int? skip, int? maxpagesize, string filter, bool? countRecords, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetRequestForInformationResourcesRequest(maxCount, skip, maxpagesize, filter, countRecords, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetRequestForInformationResourcesNextPageRequest(nextLink, maxCount, skip, maxpagesize, filter, countRecords, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TeamsRequestsForInformation.GetRequestForInformationResources", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Get list of Requests for Information + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// Whether to return a count of the total number of records available for this request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetRequestForInformationResources(int? maxCount, int? skip, int? maxpagesize, string filter, bool? countRecords, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetRequestForInformationResourcesRequest(maxCount, skip, maxpagesize, filter, countRecords, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetRequestForInformationResourcesNextPageRequest(nextLink, maxCount, skip, maxpagesize, filter, countRecords, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TeamsRequestsForInformation.GetRequestForInformationResources", "value", "nextLink", context); + } + + internal HttpMessage CreateGetRequestForInformationResourcesRequest(int? maxCount, int? skip, int? maxpagesize, string filter, bool? countRecords, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/teamsRequestsForInformation", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + if (filter != null) + { + uri.AppendQuery("filter", filter, true); + } + if (countRecords != null) + { + uri.AppendQuery("countRecords", countRecords.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetRequestForInformationRequest(string tenantId, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/teamsRequestsForInformation/", false); + uri.AppendPath(tenantId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + return message; + } + + internal HttpMessage CreateCreateOrUpdateRequestForInformationRequest(string tenantId, RequestContent content, RequestConditions requestConditions, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200201); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/teamsRequestsForInformation/", false); + uri.AppendPath(tenantId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Repeatability-Request-ID", Guid.NewGuid()); + request.Headers.Add("Repeatability-First-Sent", DateTimeOffset.Now, "R"); + if (requestConditions != null) + { + request.Headers.Add(requestConditions, "R"); + } + request.Headers.Add("Content-Type", "application/merge-patch+json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetRequestForInformationResourcesNextPageRequest(string nextLink, int? maxCount, int? skip, int? maxpagesize, string filter, bool? countRecords, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + private static ResponseClassifier _responseClassifier200201; + private static ResponseClassifier ResponseClassifier200201 => _responseClassifier200201 ??= new StatusCodeClassifier(stackalloc ushort[] { 200, 201 }); + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TelephoneNumberAssignmentStatus.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TelephoneNumberAssignmentStatus.cs new file mode 100644 index 000000000000..266e637ec506 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/TelephoneNumberAssignmentStatus.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 Microsoft.VoiceServices.Provisioning +{ + /// Indicates whether a number is assigned to a user. + public readonly partial struct TelephoneNumberAssignmentStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TelephoneNumberAssignmentStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AssignedValue = "assigned"; + private const string UnassignedValue = "unassigned"; + + /// The telephone number is assigned to a user. + public static TelephoneNumberAssignmentStatus Assigned { get; } = new TelephoneNumberAssignmentStatus(AssignedValue); + /// The telephone number is not assigned to a user. + public static TelephoneNumberAssignmentStatus Unassigned { get; } = new TelephoneNumberAssignmentStatus(UnassignedValue); + /// Determines if two values are the same. + public static bool operator ==(TelephoneNumberAssignmentStatus left, TelephoneNumberAssignmentStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TelephoneNumberAssignmentStatus left, TelephoneNumberAssignmentStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator TelephoneNumberAssignmentStatus(string value) => new TelephoneNumberAssignmentStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TelephoneNumberAssignmentStatus other && Equals(other); + /// + public bool Equals(TelephoneNumberAssignmentStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ValidationStatus.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ValidationStatus.cs new file mode 100644 index 000000000000..1fc7f54a64d0 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ValidationStatus.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 Microsoft.VoiceServices.Provisioning +{ + /// The possible validation status of Teams Civic Addresses. + public readonly partial struct ValidationStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ValidationStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NotValidatedValue = "notValidated"; + private const string ValidatedValue = "validated"; + + /// The civic address is not validated. + public static ValidationStatus NotValidated { get; } = new ValidationStatus(NotValidatedValue); + /// The civic address is validated. + public static ValidationStatus Validated { get; } = new ValidationStatus(ValidatedValue); + /// Determines if two values are the same. + public static bool operator ==(ValidationStatus left, ValidationStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ValidationStatus left, ValidationStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ValidationStatus(string value) => new ValidationStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ValidationStatus other && Equals(other); + /// + public bool Equals(ValidationStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/VoiceServicesClient.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/VoiceServicesClient.cs new file mode 100644 index 000000000000..a6e440fe5dd6 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/VoiceServicesClient.cs @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using Autorest.CSharp.Core; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Microsoft.VoiceServices.Provisioning +{ + // Data plane generated client. + /// The VoiceServices service client. + public partial class VoiceServicesClient + { + private static readonly string[] AuthorizationScopes = new string[] { "https://func-voiceservice-rp-prod-eastuseuap.azurewebsites.net/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of VoiceServicesClient for mocking. + protected VoiceServicesClient() + { + } + + /// Initializes a new instance of VoiceServicesClient. + /// The to use. + /// A credential used to authenticate to an Azure Service. + /// or is null. + public VoiceServicesClient(Uri endpoint, TokenCredential credential) : this(endpoint, credential, new VoiceServicesClientOptions()) + { + } + + /// Initializes a new instance of VoiceServicesClient. + /// The to use. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public VoiceServicesClient(Uri endpoint, TokenCredential credential, VoiceServicesClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new VoiceServicesClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _tokenCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); + _endpoint = endpoint; + _apiVersion = options.Version; + } + + /// List all the Numbers associated with this Communications Gateway. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// Whether to return a count of the total number of records available for this request. + /// The cancellation token to use. + /// + public virtual AsyncPageable GetNumbersAsync(int? maxCount = null, int? skip = null, int? maxpagesize = null, string filter = null, bool? countRecords = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetNumbersRequest(maxCount, skip, maxpagesize, filter, countRecords, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetNumbersNextPageRequest(nextLink, maxCount, skip, maxpagesize, filter, countRecords, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => NumberResource.DeserializeNumberResource(e), ClientDiagnostics, _pipeline, "VoiceServicesClient.GetNumbers", "value", "nextLink", context); + } + + /// List all the Numbers associated with this Communications Gateway. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// Whether to return a count of the total number of records available for this request. + /// The cancellation token to use. + /// + public virtual Pageable GetNumbers(int? maxCount = null, int? skip = null, int? maxpagesize = null, string filter = null, bool? countRecords = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetNumbersRequest(maxCount, skip, maxpagesize, filter, countRecords, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetNumbersNextPageRequest(nextLink, maxCount, skip, maxpagesize, filter, countRecords, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => NumberResource.DeserializeNumberResource(e), ClientDiagnostics, _pipeline, "VoiceServicesClient.GetNumbers", "value", "nextLink", context); + } + + /// + /// [Protocol Method] List all the Numbers associated with this Communications Gateway. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// Whether to return a count of the total number of records available for this request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetNumbersAsync(int? maxCount, int? skip, int? maxpagesize, string filter, bool? countRecords, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetNumbersRequest(maxCount, skip, maxpagesize, filter, countRecords, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetNumbersNextPageRequest(nextLink, maxCount, skip, maxpagesize, filter, countRecords, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "VoiceServicesClient.GetNumbers", "value", "nextLink", context); + } + + /// + /// [Protocol Method] List all the Numbers associated with this Communications Gateway. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// Whether to return a count of the total number of records available for this request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetNumbers(int? maxCount, int? skip, int? maxpagesize, string filter, bool? countRecords, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetNumbersRequest(maxCount, skip, maxpagesize, filter, countRecords, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetNumbersNextPageRequest(nextLink, maxCount, skip, maxpagesize, filter, countRecords, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "VoiceServicesClient.GetNumbers", "value", "nextLink", context); + } + + private Accounts _cachedAccounts; + private TeamsRequestsForInformation _cachedTeamsRequestsForInformation; + + /// Initializes a new instance of Accounts. + public virtual Accounts GetAccountsClient() + { + return Volatile.Read(ref _cachedAccounts) ?? Interlocked.CompareExchange(ref _cachedAccounts, new Accounts(ClientDiagnostics, _pipeline, _tokenCredential, _endpoint, _apiVersion), null) ?? _cachedAccounts; + } + + /// Initializes a new instance of TeamsRequestsForInformation. + public virtual TeamsRequestsForInformation GetTeamsRequestsForInformationClient() + { + return Volatile.Read(ref _cachedTeamsRequestsForInformation) ?? Interlocked.CompareExchange(ref _cachedTeamsRequestsForInformation, new TeamsRequestsForInformation(ClientDiagnostics, _pipeline, _tokenCredential, _endpoint, _apiVersion), null) ?? _cachedTeamsRequestsForInformation; + } + + internal HttpMessage CreateGetNumbersRequest(int? maxCount, int? skip, int? maxpagesize, string filter, bool? countRecords, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/numbers", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + if (filter != null) + { + uri.AppendQuery("filter", filter, true); + } + if (countRecords != null) + { + uri.AppendQuery("countRecords", countRecords.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetNumbersNextPageRequest(string nextLink, int? maxCount, int? skip, int? maxpagesize, string filter, bool? countRecords, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/VoiceServicesClientOptions.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/VoiceServicesClientOptions.cs new file mode 100644 index 000000000000..3de5d3b1a424 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/VoiceServicesClientOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// Client options for VoiceServicesClient. + public partial class VoiceServicesClientOptions : ClientOptions + { + private const ServiceVersion LatestVersion = ServiceVersion.V2024_02_29_Preview; + + /// The version of the service to use. + public enum ServiceVersion + { + /// Service version "2024-02-29-preview". + V2024_02_29_Preview = 1, + } + + internal string Version { get; } + + /// Initializes new instance of VoiceServicesClientOptions. + public VoiceServicesClientOptions(ServiceVersion version = LatestVersion) + { + Version = version switch + { + ServiceVersion.V2024_02_29_Preview => "2024-02-29-preview", + _ => throw new NotSupportedException() + }; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ZoomPhoneCloudPeeringAccountDetails.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ZoomPhoneCloudPeeringAccountDetails.Serialization.cs new file mode 100644 index 000000000000..00f500716aad --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ZoomPhoneCloudPeeringAccountDetails.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class ZoomPhoneCloudPeeringAccountDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ZoomPhoneCloudPeeringAccountDetails)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("syncEnabled"u8); + writer.WriteBooleanValue(SyncEnabled); + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled); + if (options.Format != "W" && Optional.IsDefined(NumberCount)) + { + writer.WritePropertyName("numberCount"u8); + writer.WriteNumberValue(NumberCount.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ZoomPhoneCloudPeeringAccountDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ZoomPhoneCloudPeeringAccountDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeZoomPhoneCloudPeeringAccountDetails(document.RootElement, options); + } + + internal static ZoomPhoneCloudPeeringAccountDetails DeserializeZoomPhoneCloudPeeringAccountDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool syncEnabled = default; + bool enabled = default; + long? numberCount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("syncEnabled"u8)) + { + syncEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("enabled"u8)) + { + enabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("numberCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberCount = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ZoomPhoneCloudPeeringAccountDetails(syncEnabled, enabled, numberCount, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ZoomPhoneCloudPeeringAccountDetails)} does not support writing '{options.Format}' format."); + } + } + + ZoomPhoneCloudPeeringAccountDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeZoomPhoneCloudPeeringAccountDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ZoomPhoneCloudPeeringAccountDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ZoomPhoneCloudPeeringAccountDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeZoomPhoneCloudPeeringAccountDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ZoomPhoneCloudPeeringAccountDetails.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ZoomPhoneCloudPeeringAccountDetails.cs new file mode 100644 index 000000000000..2241ffb21ba7 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ZoomPhoneCloudPeeringAccountDetails.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// Account details specific to Zoom Phone Cloud Peering. + public partial class ZoomPhoneCloudPeeringAccountDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Boolean indicating if data is being provisioned through the backend service. + /// Boolean indicating if the service is enabled on this Account. + public ZoomPhoneCloudPeeringAccountDetails(bool syncEnabled, bool enabled) + { + SyncEnabled = syncEnabled; + Enabled = enabled; + } + + /// Initializes a new instance of . + /// Boolean indicating if data is being provisioned through the backend service. + /// Boolean indicating if the service is enabled on this Account. + /// The count of telephone numbers associated with this account that have this backend service enabled. + /// Keeps track of any properties unknown to the library. + internal ZoomPhoneCloudPeeringAccountDetails(bool syncEnabled, bool enabled, long? numberCount, IDictionary serializedAdditionalRawData) + { + SyncEnabled = syncEnabled; + Enabled = enabled; + NumberCount = numberCount; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ZoomPhoneCloudPeeringAccountDetails() + { + } + + /// Boolean indicating if data is being provisioned through the backend service. + public bool SyncEnabled { get; set; } + /// Boolean indicating if the service is enabled on this Account. + public bool Enabled { get; set; } + /// The count of telephone numbers associated with this account that have this backend service enabled. + public long? NumberCount { get; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ZoomPhoneCloudPeeringNumberDetails.Serialization.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ZoomPhoneCloudPeeringNumberDetails.Serialization.cs new file mode 100644 index 000000000000..0ac5ca288dce --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ZoomPhoneCloudPeeringNumberDetails.Serialization.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.VoiceServices.Provisioning +{ + public partial class ZoomPhoneCloudPeeringNumberDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ZoomPhoneCloudPeeringNumberDetails)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ZoomPhoneCloudPeeringNumberDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ZoomPhoneCloudPeeringNumberDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeZoomPhoneCloudPeeringNumberDetails(document.RootElement, options); + } + + internal static ZoomPhoneCloudPeeringNumberDetails DeserializeZoomPhoneCloudPeeringNumberDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool enabled = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enabled"u8)) + { + enabled = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ZoomPhoneCloudPeeringNumberDetails(enabled, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ZoomPhoneCloudPeeringNumberDetails)} does not support writing '{options.Format}' format."); + } + } + + ZoomPhoneCloudPeeringNumberDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeZoomPhoneCloudPeeringNumberDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ZoomPhoneCloudPeeringNumberDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ZoomPhoneCloudPeeringNumberDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeZoomPhoneCloudPeeringNumberDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ZoomPhoneCloudPeeringNumberDetails.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ZoomPhoneCloudPeeringNumberDetails.cs new file mode 100644 index 000000000000..eafd400491c4 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Generated/ZoomPhoneCloudPeeringNumberDetails.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.VoiceServices.Provisioning +{ + /// Details for the Zoom Phone Cloud Peering service on this Number. + public partial class ZoomPhoneCloudPeeringNumberDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Boolean indicating if the service is enabled on this Number. + public ZoomPhoneCloudPeeringNumberDetails(bool enabled) + { + Enabled = enabled; + } + + /// Initializes a new instance of . + /// Boolean indicating if the service is enabled on this Number. + /// Keeps track of any properties unknown to the library. + internal ZoomPhoneCloudPeeringNumberDetails(bool enabled, IDictionary serializedAdditionalRawData) + { + Enabled = enabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ZoomPhoneCloudPeeringNumberDetails() + { + } + + /// Boolean indicating if the service is enabled on this Number. + public bool Enabled { get; set; } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Microsoft.VoiceServices.Provisioning.csproj b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Microsoft.VoiceServices.Provisioning.csproj new file mode 100644 index 000000000000..b143463061ac --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Microsoft.VoiceServices.Provisioning.csproj @@ -0,0 +1,19 @@ + + + This is the Microsoft.VoiceServices.Provisioning client library for developing .NET applications with rich experience. + Azure SDK Code Generation Microsoft.VoiceServices.Provisioning for Azure Data Plane + 1.0.0-beta.1 + Microsoft.VoiceServices.Provisioning + $(RequiredTargetFrameworks) + true + + + + + + + + + + + diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Properties/AssemblyInfo.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..d37c9d4475c3 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/src/Properties/AssemblyInfo.cs @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Microsoft.VoiceServices.Provisioning.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/tests/Generated/Samples/Samples_Accounts.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/tests/Generated/Samples/Samples_Accounts.cs new file mode 100644 index 000000000000..343e903baafd --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/tests/Generated/Samples/Samples_Accounts.cs @@ -0,0 +1,2678 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Microsoft.VoiceServices.Provisioning.Samples +{ + public partial class Samples_Accounts + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AccountResource_GetAccountResource_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = client.GetAccountResource("", null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AccountResource_GetAccountResource_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = await client.GetAccountResourceAsync("", null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AccountResource_GetAccountResource_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = client.GetAccountResource(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AccountResource_GetAccountResource_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = await client.GetAccountResourceAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AccountResource_GetAccountResource_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = client.GetAccountResource("", null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("correlationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsTenantId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("callScreening").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomain").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region1Token").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region2Token").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("subdomainStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("numberCount").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AccountResource_GetAccountResource_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = await client.GetAccountResourceAsync("", null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("correlationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsTenantId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("callScreening").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomain").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region1Token").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region2Token").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("subdomainStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("numberCount").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AccountResource_GetAccountResource_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = client.GetAccountResource("", requestConditions: null); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AccountResource_GetAccountResource_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = await client.GetAccountResourceAsync("", requestConditions: null); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AccountResource_CreateOrReplace_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + using RequestContent content = RequestContent.Create(new + { + name = "", + }); + Response response = client.CreateOrReplace("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AccountResource_CreateOrReplace_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + using RequestContent content = RequestContent.Create(new + { + name = "", + }); + Response response = await client.CreateOrReplaceAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AccountResource_CreateOrReplace_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + AccountResource resource = new AccountResource(""); + Response response = client.CreateOrReplace("", resource); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AccountResource_CreateOrReplace_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + AccountResource resource = new AccountResource(""); + Response response = await client.CreateOrReplaceAsync("", resource); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AccountResource_CreateOrReplace_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + using RequestContent content = RequestContent.Create(new + { + name = "", + correlationId = "", + serviceDetails = new + { + teamsTenantId = "", + teamsOperatorConnect = new + { + syncEnabled = true, + enabled = true, + }, + teamsDirectRouting = new + { + syncEnabled = true, + enabled = true, + configuration = new + { + callScreening = true, + subdomain = "", + subdomainTokens = new + { + region1Token = "", + region2Token = "", + }, + }, + }, + teamsPhoneMobile = new + { + syncEnabled = true, + enabled = true, + }, + zoomPhoneCloudPeering = new + { + syncEnabled = true, + enabled = true, + }, + azureOperatorCallProtection = new + { + enabled = true, + }, + }, + }); + Response response = client.CreateOrReplace("", content, requestConditions: null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("correlationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsTenantId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("callScreening").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomain").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region1Token").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region2Token").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("subdomainStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("numberCount").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AccountResource_CreateOrReplace_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + using RequestContent content = RequestContent.Create(new + { + name = "", + correlationId = "", + serviceDetails = new + { + teamsTenantId = "", + teamsOperatorConnect = new + { + syncEnabled = true, + enabled = true, + }, + teamsDirectRouting = new + { + syncEnabled = true, + enabled = true, + configuration = new + { + callScreening = true, + subdomain = "", + subdomainTokens = new + { + region1Token = "", + region2Token = "", + }, + }, + }, + teamsPhoneMobile = new + { + syncEnabled = true, + enabled = true, + }, + zoomPhoneCloudPeering = new + { + syncEnabled = true, + enabled = true, + }, + azureOperatorCallProtection = new + { + enabled = true, + }, + }, + }); + Response response = await client.CreateOrReplaceAsync("", content, requestConditions: null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("correlationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsTenantId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("callScreening").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomain").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region1Token").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region2Token").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("subdomainStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("numberCount").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AccountResource_CreateOrReplace_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + AccountResource resource = new AccountResource("") + { + CorrelationId = "", + ServiceDetails = new AccountServiceDetails + { + TeamsTenantId = "", + TeamsOperatorConnect = new TeamsOperatorConnectAccountDetails(true, true), + TeamsDirectRouting = new TeamsDirectRoutingAccountDetails(true, true) + { + Configuration = new TeamsDirectRoutingAccountConfig(true, "", new TeamsDirectRoutingSubdomainTokens("", "")), + }, + TeamsPhoneMobile = new TeamsPhoneMobileAccountDetails(true, true), + ZoomPhoneCloudPeering = new ZoomPhoneCloudPeeringAccountDetails(true, true), + AzureOperatorCallProtection = new AzureOperatorCallProtectionAccountDetails(true), + }, + }; + Response response = client.CreateOrReplace("", resource, requestConditions: null); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AccountResource_CreateOrReplace_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + AccountResource resource = new AccountResource("") + { + CorrelationId = "", + ServiceDetails = new AccountServiceDetails + { + TeamsTenantId = "", + TeamsOperatorConnect = new TeamsOperatorConnectAccountDetails(true, true), + TeamsDirectRouting = new TeamsDirectRoutingAccountDetails(true, true) + { + Configuration = new TeamsDirectRoutingAccountConfig(true, "", new TeamsDirectRoutingSubdomainTokens("", "")), + }, + TeamsPhoneMobile = new TeamsPhoneMobileAccountDetails(true, true), + ZoomPhoneCloudPeering = new ZoomPhoneCloudPeeringAccountDetails(true, true), + AzureOperatorCallProtection = new AzureOperatorCallProtectionAccountDetails(true), + }, + }; + Response response = await client.CreateOrReplaceAsync("", resource, requestConditions: null); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AccountResource_Delete_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = client.Delete(""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AccountResource_Delete_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = await client.DeleteAsync(""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AccountResource_Delete_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = client.Delete("", deleteNumbers: true, requestConditions: null); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AccountResource_Delete_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = await client.DeleteAsync("", deleteNumbers: true, requestConditions: null); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Accounts_CreateOrUpdateNumbers_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + using RequestContent content = RequestContent.Create(new + { + numbers = new object[] + { +new +{ +telephoneNumber = "", +accountName = "", +serviceDetails = new object(), +} + }, + }); + Response response = client.CreateOrUpdateNumbers("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Accounts_CreateOrUpdateNumbers_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + using RequestContent content = RequestContent.Create(new + { + numbers = new object[] + { +new +{ +telephoneNumber = "", +accountName = "", +serviceDetails = new object(), +} + }, + }); + Response response = await client.CreateOrUpdateNumbersAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Accounts_CreateOrUpdateNumbers_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + BatchNumbers body = new BatchNumbers(new NumberResource[] + { +new NumberResource("", "", new NumberServiceDetails()) + }); + Response response = client.CreateOrUpdateNumbers("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Accounts_CreateOrUpdateNumbers_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + BatchNumbers body = new BatchNumbers(new NumberResource[] + { +new NumberResource("", "", new NumberServiceDetails()) + }); + Response response = await client.CreateOrUpdateNumbersAsync("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Accounts_CreateOrUpdateNumbers_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + using RequestContent content = RequestContent.Create(new + { + numbers = new object[] + { +new +{ +telephoneNumber = "", +accountName = "", +serviceDetails = new +{ +teamsOperatorConnect = new +{ +enabled = true, +assignmentStatus = "assigned", +configuration = new +{ +usage = "", +choosableCapabilities = new object[] +{ +"" +}, +additionalUsages = new object[] +{ +"" +}, +civicAddressId = "", +locationId = "", +allowTenantAddressUpdate = true, +displayedCountryCode = "", +}, +}, +teamsDirectRouting = new +{ +enabled = true, +}, +teamsPhoneMobile = new +{ +enabled = true, +assignmentStatus = "assigned", +configuration = new +{ +usage = "", +choosableCapabilities = new object[] +{ +"" +}, +additionalUsages = new object[] +{ +"" +}, +civicAddressId = "", +locationId = "", +allowTenantAddressUpdate = true, +displayedCountryCode = "", +}, +}, +zoomPhoneCloudPeering = new +{ +enabled = true, +}, +azureOperatorCallProtection = new +{ +enabled = true, +}, +}, +configuration = new +{ +customSipHeader = "", +}, +} + }, + }); + Response response = client.CreateOrUpdateNumbers("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("configuration").GetProperty("customSipHeader").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Accounts_CreateOrUpdateNumbers_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + using RequestContent content = RequestContent.Create(new + { + numbers = new object[] + { +new +{ +telephoneNumber = "", +accountName = "", +serviceDetails = new +{ +teamsOperatorConnect = new +{ +enabled = true, +assignmentStatus = "assigned", +configuration = new +{ +usage = "", +choosableCapabilities = new object[] +{ +"" +}, +additionalUsages = new object[] +{ +"" +}, +civicAddressId = "", +locationId = "", +allowTenantAddressUpdate = true, +displayedCountryCode = "", +}, +}, +teamsDirectRouting = new +{ +enabled = true, +}, +teamsPhoneMobile = new +{ +enabled = true, +assignmentStatus = "assigned", +configuration = new +{ +usage = "", +choosableCapabilities = new object[] +{ +"" +}, +additionalUsages = new object[] +{ +"" +}, +civicAddressId = "", +locationId = "", +allowTenantAddressUpdate = true, +displayedCountryCode = "", +}, +}, +zoomPhoneCloudPeering = new +{ +enabled = true, +}, +azureOperatorCallProtection = new +{ +enabled = true, +}, +}, +configuration = new +{ +customSipHeader = "", +}, +} + }, + }); + Response response = await client.CreateOrUpdateNumbersAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("numbers")[0].GetProperty("configuration").GetProperty("customSipHeader").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Accounts_CreateOrUpdateNumbers_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + BatchNumbers body = new BatchNumbers(new NumberResource[] + { +new NumberResource("", "", new NumberServiceDetails +{ +TeamsOperatorConnect = new TeamsOperatorConnectNumberDetails(true) +{ +AssignmentStatus = TelephoneNumberAssignmentStatus.Assigned, +Configuration = new TeamsOperatorConnectNumberConfig("", new string[]{""}) +{ +AdditionalUsages = {""}, +CivicAddressId = "", +LocationId = "", +AllowTenantAddressUpdate = true, +DisplayedCountryCode = "", +}, +}, +TeamsDirectRouting = new TeamsDirectRoutingNumberDetails(true), +TeamsPhoneMobile = new TeamsPhoneMobileNumberDetails(true) +{ +AssignmentStatus = TelephoneNumberAssignmentStatus.Assigned, +Configuration = new TeamsPhoneMobileNumberConfig("", new string[]{""}) +{ +AdditionalUsages = {""}, +CivicAddressId = "", +LocationId = "", +AllowTenantAddressUpdate = true, +DisplayedCountryCode = "", +}, +}, +ZoomPhoneCloudPeering = new ZoomPhoneCloudPeeringNumberDetails(true), +AzureOperatorCallProtection = new AzureOperatorCallProtectionNumberDetails(true), +}) +{ +Configuration = new NumberConfiguration +{ +CustomSipHeader = "", +}, +} + }); + Response response = client.CreateOrUpdateNumbers("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Accounts_CreateOrUpdateNumbers_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + BatchNumbers body = new BatchNumbers(new NumberResource[] + { +new NumberResource("", "", new NumberServiceDetails +{ +TeamsOperatorConnect = new TeamsOperatorConnectNumberDetails(true) +{ +AssignmentStatus = TelephoneNumberAssignmentStatus.Assigned, +Configuration = new TeamsOperatorConnectNumberConfig("", new string[]{""}) +{ +AdditionalUsages = {""}, +CivicAddressId = "", +LocationId = "", +AllowTenantAddressUpdate = true, +DisplayedCountryCode = "", +}, +}, +TeamsDirectRouting = new TeamsDirectRoutingNumberDetails(true), +TeamsPhoneMobile = new TeamsPhoneMobileNumberDetails(true) +{ +AssignmentStatus = TelephoneNumberAssignmentStatus.Assigned, +Configuration = new TeamsPhoneMobileNumberConfig("", new string[]{""}) +{ +AdditionalUsages = {""}, +CivicAddressId = "", +LocationId = "", +AllowTenantAddressUpdate = true, +DisplayedCountryCode = "", +}, +}, +ZoomPhoneCloudPeering = new ZoomPhoneCloudPeeringNumberDetails(true), +AzureOperatorCallProtection = new AzureOperatorCallProtectionNumberDetails(true), +}) +{ +Configuration = new NumberConfiguration +{ +CustomSipHeader = "", +}, +} + }); + Response response = await client.CreateOrUpdateNumbersAsync("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Accounts_DeleteNumbers_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + using RequestContent content = RequestContent.Create(new + { + numbers = new object[] + { +new +{ +telephoneNumber = "", +} + }, + }); + Response response = client.DeleteNumbers("", content); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Accounts_DeleteNumbers_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + using RequestContent content = RequestContent.Create(new + { + numbers = new object[] + { +new +{ +telephoneNumber = "", +} + }, + }); + Response response = await client.DeleteNumbersAsync("", content); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Accounts_DeleteNumbers_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + BatchNumbersDelete body = new BatchNumbersDelete(new NumberIdentifier[] + { +new NumberIdentifier("") + }); + Response response = client.DeleteNumbers("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Accounts_DeleteNumbers_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + BatchNumbersDelete body = new BatchNumbersDelete(new NumberIdentifier[] + { +new NumberIdentifier("") + }); + Response response = await client.DeleteNumbersAsync("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Accounts_DeleteNumbers_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + using RequestContent content = RequestContent.Create(new + { + numbers = new object[] + { +new +{ +telephoneNumber = "", +} + }, + }); + Response response = client.DeleteNumbers("", content); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Accounts_DeleteNumbers_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + using RequestContent content = RequestContent.Create(new + { + numbers = new object[] + { +new +{ +telephoneNumber = "", +} + }, + }); + Response response = await client.DeleteNumbersAsync("", content); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Accounts_DeleteNumbers_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + BatchNumbersDelete body = new BatchNumbersDelete(new NumberIdentifier[] + { +new NumberIdentifier("") + }); + Response response = client.DeleteNumbers("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Accounts_DeleteNumbers_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + BatchNumbersDelete body = new BatchNumbersDelete(new NumberIdentifier[] + { +new NumberIdentifier("") + }); + Response response = await client.DeleteNumbersAsync("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberResource_GetNumber_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = client.GetNumber("", "", null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberResource_GetNumber_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = await client.GetNumberAsync("", "", null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberResource_GetNumber_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = client.GetNumber("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberResource_GetNumber_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = await client.GetNumberAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberResource_GetNumber_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = client.GetNumber("", "", null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("configuration").GetProperty("customSipHeader").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberResource_GetNumber_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = await client.GetNumberAsync("", "", null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("configuration").GetProperty("customSipHeader").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberResource_GetNumber_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = client.GetNumber("", "", requestConditions: null); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberResource_GetNumber_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = await client.GetNumberAsync("", "", requestConditions: null); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberResource_CreateOrReplaceNumber_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + using RequestContent content = RequestContent.Create(new + { + telephoneNumber = "", + accountName = "", + serviceDetails = new object(), + }); + Response response = client.CreateOrReplaceNumber("", "", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberResource_CreateOrReplaceNumber_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + using RequestContent content = RequestContent.Create(new + { + telephoneNumber = "", + accountName = "", + serviceDetails = new object(), + }); + Response response = await client.CreateOrReplaceNumberAsync("", "", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberResource_CreateOrReplaceNumber_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + NumberResource resource = new NumberResource("", "", new NumberServiceDetails()); + Response response = client.CreateOrReplaceNumber("", "", resource); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberResource_CreateOrReplaceNumber_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + NumberResource resource = new NumberResource("", "", new NumberServiceDetails()); + Response response = await client.CreateOrReplaceNumberAsync("", "", resource); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberResource_CreateOrReplaceNumber_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + using RequestContent content = RequestContent.Create(new + { + telephoneNumber = "", + accountName = "", + serviceDetails = new + { + teamsOperatorConnect = new + { + enabled = true, + assignmentStatus = "assigned", + configuration = new + { + usage = "", + choosableCapabilities = new object[] + { +"" + }, + additionalUsages = new object[] + { +"" + }, + civicAddressId = "", + locationId = "", + allowTenantAddressUpdate = true, + displayedCountryCode = "", + }, + }, + teamsDirectRouting = new + { + enabled = true, + }, + teamsPhoneMobile = new + { + enabled = true, + assignmentStatus = "assigned", + configuration = new + { + usage = "", + choosableCapabilities = new object[] + { +"" + }, + additionalUsages = new object[] + { +"" + }, + civicAddressId = "", + locationId = "", + allowTenantAddressUpdate = true, + displayedCountryCode = "", + }, + }, + zoomPhoneCloudPeering = new + { + enabled = true, + }, + azureOperatorCallProtection = new + { + enabled = true, + }, + }, + configuration = new + { + customSipHeader = "", + }, + }); + Response response = client.CreateOrReplaceNumber("", "", content, requestConditions: null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("configuration").GetProperty("customSipHeader").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberResource_CreateOrReplaceNumber_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + using RequestContent content = RequestContent.Create(new + { + telephoneNumber = "", + accountName = "", + serviceDetails = new + { + teamsOperatorConnect = new + { + enabled = true, + assignmentStatus = "assigned", + configuration = new + { + usage = "", + choosableCapabilities = new object[] + { +"" + }, + additionalUsages = new object[] + { +"" + }, + civicAddressId = "", + locationId = "", + allowTenantAddressUpdate = true, + displayedCountryCode = "", + }, + }, + teamsDirectRouting = new + { + enabled = true, + }, + teamsPhoneMobile = new + { + enabled = true, + assignmentStatus = "assigned", + configuration = new + { + usage = "", + choosableCapabilities = new object[] + { +"" + }, + additionalUsages = new object[] + { +"" + }, + civicAddressId = "", + locationId = "", + allowTenantAddressUpdate = true, + displayedCountryCode = "", + }, + }, + zoomPhoneCloudPeering = new + { + enabled = true, + }, + azureOperatorCallProtection = new + { + enabled = true, + }, + }, + configuration = new + { + customSipHeader = "", + }, + }); + Response response = await client.CreateOrReplaceNumberAsync("", "", content, requestConditions: null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("configuration").GetProperty("customSipHeader").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberResource_CreateOrReplaceNumber_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + NumberResource resource = new NumberResource("", "", new NumberServiceDetails + { + TeamsOperatorConnect = new TeamsOperatorConnectNumberDetails(true) + { + AssignmentStatus = TelephoneNumberAssignmentStatus.Assigned, + Configuration = new TeamsOperatorConnectNumberConfig("", new string[] { "" }) + { + AdditionalUsages = { "" }, + CivicAddressId = "", + LocationId = "", + AllowTenantAddressUpdate = true, + DisplayedCountryCode = "", + }, + }, + TeamsDirectRouting = new TeamsDirectRoutingNumberDetails(true), + TeamsPhoneMobile = new TeamsPhoneMobileNumberDetails(true) + { + AssignmentStatus = TelephoneNumberAssignmentStatus.Assigned, + Configuration = new TeamsPhoneMobileNumberConfig("", new string[] { "" }) + { + AdditionalUsages = { "" }, + CivicAddressId = "", + LocationId = "", + AllowTenantAddressUpdate = true, + DisplayedCountryCode = "", + }, + }, + ZoomPhoneCloudPeering = new ZoomPhoneCloudPeeringNumberDetails(true), + AzureOperatorCallProtection = new AzureOperatorCallProtectionNumberDetails(true), + }) + { + Configuration = new NumberConfiguration + { + CustomSipHeader = "", + }, + }; + Response response = client.CreateOrReplaceNumber("", "", resource, requestConditions: null); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberResource_CreateOrReplaceNumber_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + NumberResource resource = new NumberResource("", "", new NumberServiceDetails + { + TeamsOperatorConnect = new TeamsOperatorConnectNumberDetails(true) + { + AssignmentStatus = TelephoneNumberAssignmentStatus.Assigned, + Configuration = new TeamsOperatorConnectNumberConfig("", new string[] { "" }) + { + AdditionalUsages = { "" }, + CivicAddressId = "", + LocationId = "", + AllowTenantAddressUpdate = true, + DisplayedCountryCode = "", + }, + }, + TeamsDirectRouting = new TeamsDirectRoutingNumberDetails(true), + TeamsPhoneMobile = new TeamsPhoneMobileNumberDetails(true) + { + AssignmentStatus = TelephoneNumberAssignmentStatus.Assigned, + Configuration = new TeamsPhoneMobileNumberConfig("", new string[] { "" }) + { + AdditionalUsages = { "" }, + CivicAddressId = "", + LocationId = "", + AllowTenantAddressUpdate = true, + DisplayedCountryCode = "", + }, + }, + ZoomPhoneCloudPeering = new ZoomPhoneCloudPeeringNumberDetails(true), + AzureOperatorCallProtection = new AzureOperatorCallProtectionNumberDetails(true), + }) + { + Configuration = new NumberConfiguration + { + CustomSipHeader = "", + }, + }; + Response response = await client.CreateOrReplaceNumberAsync("", "", resource, requestConditions: null); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberResource_DeleteNumber_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = client.DeleteNumber("", ""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberResource_DeleteNumber_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = await client.DeleteNumberAsync("", ""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberResource_DeleteNumber_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = client.DeleteNumber("", "", requestConditions: null); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberResource_DeleteNumber_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = await client.DeleteNumberAsync("", "", requestConditions: null); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Accounts_GetTeamsCapabilityPlans_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = client.GetTeamsCapabilityPlans("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("supportsTollFree").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Accounts_GetTeamsCapabilityPlans_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = await client.GetTeamsCapabilityPlansAsync("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("supportsTollFree").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Accounts_GetTeamsCapabilityPlans_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = client.GetTeamsCapabilityPlans(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Accounts_GetTeamsCapabilityPlans_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = await client.GetTeamsCapabilityPlansAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Accounts_GetTeamsCapabilityPlans_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = client.GetTeamsCapabilityPlans("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("offerTypes")[0].ToString()); + Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("mandatoryCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("supportsTollFree").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Accounts_GetTeamsCapabilityPlans_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = await client.GetTeamsCapabilityPlansAsync("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("offerTypes")[0].ToString()); + Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("mandatoryCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("capabilityPlans")[0].GetProperty("supportsTollFree").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Accounts_GetTeamsCapabilityPlans_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = client.GetTeamsCapabilityPlans(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Accounts_GetTeamsCapabilityPlans_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = await client.GetTeamsCapabilityPlansAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Accounts_GetTeamsAvailableCapabilities_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + using RequestContent content = RequestContent.Create(new + { + numbers = new object[] + { +new +{ +telephoneNumber = "", +} + }, + }); + Response response = client.GetTeamsAvailableCapabilities("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("availableCapabilities")[0].ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Accounts_GetTeamsAvailableCapabilities_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + using RequestContent content = RequestContent.Create(new + { + numbers = new object[] + { +new +{ +telephoneNumber = "", +} + }, + }); + Response response = await client.GetTeamsAvailableCapabilitiesAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("availableCapabilities")[0].ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Accounts_GetTeamsAvailableCapabilities_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + NumberIdentifiers body = new NumberIdentifiers(new NumberIdentifier[] + { +new NumberIdentifier("") + }); + Response response = client.GetTeamsAvailableCapabilities("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Accounts_GetTeamsAvailableCapabilities_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + NumberIdentifiers body = new NumberIdentifiers(new NumberIdentifier[] + { +new NumberIdentifier("") + }); + Response response = await client.GetTeamsAvailableCapabilitiesAsync("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Accounts_GetTeamsAvailableCapabilities_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + using RequestContent content = RequestContent.Create(new + { + numbers = new object[] + { +new +{ +telephoneNumber = "", +} + }, + }); + Response response = client.GetTeamsAvailableCapabilities("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("availableCapabilities")[0].ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Accounts_GetTeamsAvailableCapabilities_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + using RequestContent content = RequestContent.Create(new + { + numbers = new object[] + { +new +{ +telephoneNumber = "", +} + }, + }); + Response response = await client.GetTeamsAvailableCapabilitiesAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("availableCapabilities")[0].ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Accounts_GetTeamsAvailableCapabilities_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + NumberIdentifiers body = new NumberIdentifiers(new NumberIdentifier[] + { +new NumberIdentifier("") + }); + Response response = client.GetTeamsAvailableCapabilities("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Accounts_GetTeamsAvailableCapabilities_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + NumberIdentifiers body = new NumberIdentifiers(new NumberIdentifier[] + { +new NumberIdentifier("") + }); + Response response = await client.GetTeamsAvailableCapabilitiesAsync("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TeamsCivicAddressResource_GetTeamsCivicAddress_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = client.GetTeamsCivicAddress("", "", null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("defaultLocationId").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TeamsCivicAddressResource_GetTeamsCivicAddress_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = await client.GetTeamsCivicAddressAsync("", "", null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("defaultLocationId").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TeamsCivicAddressResource_GetTeamsCivicAddress_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = client.GetTeamsCivicAddress("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TeamsCivicAddressResource_GetTeamsCivicAddress_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = await client.GetTeamsCivicAddressAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TeamsCivicAddressResource_GetTeamsCivicAddress_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = client.GetTeamsCivicAddress("", "", null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("country").ToString()); + Console.WriteLine(result.GetProperty("houseNumber").ToString()); + Console.WriteLine(result.GetProperty("houseNumberSuffix").ToString()); + Console.WriteLine(result.GetProperty("preDirectional").ToString()); + Console.WriteLine(result.GetProperty("streetName").ToString()); + Console.WriteLine(result.GetProperty("streetSuffix").ToString()); + Console.WriteLine(result.GetProperty("postDirectional").ToString()); + Console.WriteLine(result.GetProperty("stateOrProvince").ToString()); + Console.WriteLine(result.GetProperty("countyOrDistrict").ToString()); + Console.WriteLine(result.GetProperty("cityOrTown").ToString()); + Console.WriteLine(result.GetProperty("cityOrTownAlias").ToString()); + Console.WriteLine(result.GetProperty("postalOrZipCode").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("companyName").ToString()); + Console.WriteLine(result.GetProperty("companyId").ToString()); + Console.WriteLine(result.GetProperty("defaultLocationId").ToString()); + Console.WriteLine(result.GetProperty("validationStatus").ToString()); + Console.WriteLine(result.GetProperty("tenantId").ToString()); + Console.WriteLine(result.GetProperty("partnerId").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("additionalInfo").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("isDefault").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("elin").ToString()); + Console.WriteLine(result.GetProperty("latitude").ToString()); + Console.WriteLine(result.GetProperty("longitude").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TeamsCivicAddressResource_GetTeamsCivicAddress_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = await client.GetTeamsCivicAddressAsync("", "", null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("country").ToString()); + Console.WriteLine(result.GetProperty("houseNumber").ToString()); + Console.WriteLine(result.GetProperty("houseNumberSuffix").ToString()); + Console.WriteLine(result.GetProperty("preDirectional").ToString()); + Console.WriteLine(result.GetProperty("streetName").ToString()); + Console.WriteLine(result.GetProperty("streetSuffix").ToString()); + Console.WriteLine(result.GetProperty("postDirectional").ToString()); + Console.WriteLine(result.GetProperty("stateOrProvince").ToString()); + Console.WriteLine(result.GetProperty("countyOrDistrict").ToString()); + Console.WriteLine(result.GetProperty("cityOrTown").ToString()); + Console.WriteLine(result.GetProperty("cityOrTownAlias").ToString()); + Console.WriteLine(result.GetProperty("postalOrZipCode").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("companyName").ToString()); + Console.WriteLine(result.GetProperty("companyId").ToString()); + Console.WriteLine(result.GetProperty("defaultLocationId").ToString()); + Console.WriteLine(result.GetProperty("validationStatus").ToString()); + Console.WriteLine(result.GetProperty("tenantId").ToString()); + Console.WriteLine(result.GetProperty("partnerId").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("additionalInfo").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("isDefault").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("elin").ToString()); + Console.WriteLine(result.GetProperty("latitude").ToString()); + Console.WriteLine(result.GetProperty("longitude").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TeamsCivicAddressResource_GetTeamsCivicAddress_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = client.GetTeamsCivicAddress("", "", requestConditions: null); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TeamsCivicAddressResource_GetTeamsCivicAddress_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + Response response = await client.GetTeamsCivicAddressAsync("", "", requestConditions: null); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AccountResource_GetAccountResources_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + foreach (BinaryData item in client.GetAccountResources(null, null, null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AccountResource_GetAccountResources_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + await foreach (BinaryData item in client.GetAccountResourcesAsync(null, null, null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AccountResource_GetAccountResources_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + foreach (AccountResource item in client.GetAccountResources()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AccountResource_GetAccountResources_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + await foreach (AccountResource item in client.GetAccountResourcesAsync()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AccountResource_GetAccountResources_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + foreach (BinaryData item in client.GetAccountResources(1234, 1234, 1234, "", true, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("correlationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsTenantId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("callScreening").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomain").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region1Token").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region2Token").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("subdomainStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("numberCount").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AccountResource_GetAccountResources_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + await foreach (BinaryData item in client.GetAccountResourcesAsync(1234, 1234, 1234, "", true, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("correlationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsTenantId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("callScreening").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomain").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region1Token").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("configuration").GetProperty("subdomainTokens").GetProperty("region2Token").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("subdomainStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("syncEnabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("numberCount").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("numberCount").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AccountResource_GetAccountResources_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + foreach (AccountResource item in client.GetAccountResources(maxCount: 1234, skip: 1234, maxpagesize: 1234, filter: "", countRecords: true)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AccountResource_GetAccountResources_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + await foreach (AccountResource item in client.GetAccountResourcesAsync(maxCount: 1234, skip: 1234, maxpagesize: 1234, filter: "", countRecords: true)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberResource_GetNumbers_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + foreach (BinaryData item in client.GetNumbers("", null, null, null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberResource_GetNumbers_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + await foreach (BinaryData item in client.GetNumbersAsync("", null, null, null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberResource_GetNumbers_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + foreach (NumberResource item in client.GetNumbers("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberResource_GetNumbers_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + await foreach (NumberResource item in client.GetNumbersAsync("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberResource_GetNumbers_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + foreach (BinaryData item in client.GetNumbers("", 1234, 1234, 1234, "", true, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("configuration").GetProperty("customSipHeader").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberResource_GetNumbers_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + await foreach (BinaryData item in client.GetNumbersAsync("", 1234, 1234, 1234, "", true, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("configuration").GetProperty("customSipHeader").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberResource_GetNumbers_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + foreach (NumberResource item in client.GetNumbers("", maxCount: 1234, skip: 1234, maxpagesize: 1234, filter: "", countRecords: true)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberResource_GetNumbers_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + await foreach (NumberResource item in client.GetNumbersAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234, filter: "", countRecords: true)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TeamsCivicAddressResource_GetTeamsCivicAddresses_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + foreach (BinaryData item in client.GetTeamsCivicAddresses("", null, null, null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("defaultLocationId").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TeamsCivicAddressResource_GetTeamsCivicAddresses_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + await foreach (BinaryData item in client.GetTeamsCivicAddressesAsync("", null, null, null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("defaultLocationId").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TeamsCivicAddressResource_GetTeamsCivicAddresses_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + foreach (TeamsCivicAddressResource item in client.GetTeamsCivicAddresses("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TeamsCivicAddressResource_GetTeamsCivicAddresses_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + await foreach (TeamsCivicAddressResource item in client.GetTeamsCivicAddressesAsync("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TeamsCivicAddressResource_GetTeamsCivicAddresses_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + foreach (BinaryData item in client.GetTeamsCivicAddresses("", 1234, 1234, 1234, "", true, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("country").ToString()); + Console.WriteLine(result.GetProperty("houseNumber").ToString()); + Console.WriteLine(result.GetProperty("houseNumberSuffix").ToString()); + Console.WriteLine(result.GetProperty("preDirectional").ToString()); + Console.WriteLine(result.GetProperty("streetName").ToString()); + Console.WriteLine(result.GetProperty("streetSuffix").ToString()); + Console.WriteLine(result.GetProperty("postDirectional").ToString()); + Console.WriteLine(result.GetProperty("stateOrProvince").ToString()); + Console.WriteLine(result.GetProperty("countyOrDistrict").ToString()); + Console.WriteLine(result.GetProperty("cityOrTown").ToString()); + Console.WriteLine(result.GetProperty("cityOrTownAlias").ToString()); + Console.WriteLine(result.GetProperty("postalOrZipCode").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("companyName").ToString()); + Console.WriteLine(result.GetProperty("companyId").ToString()); + Console.WriteLine(result.GetProperty("defaultLocationId").ToString()); + Console.WriteLine(result.GetProperty("validationStatus").ToString()); + Console.WriteLine(result.GetProperty("tenantId").ToString()); + Console.WriteLine(result.GetProperty("partnerId").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("additionalInfo").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("isDefault").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("elin").ToString()); + Console.WriteLine(result.GetProperty("latitude").ToString()); + Console.WriteLine(result.GetProperty("longitude").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TeamsCivicAddressResource_GetTeamsCivicAddresses_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + await foreach (BinaryData item in client.GetTeamsCivicAddressesAsync("", 1234, 1234, 1234, "", true, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("country").ToString()); + Console.WriteLine(result.GetProperty("houseNumber").ToString()); + Console.WriteLine(result.GetProperty("houseNumberSuffix").ToString()); + Console.WriteLine(result.GetProperty("preDirectional").ToString()); + Console.WriteLine(result.GetProperty("streetName").ToString()); + Console.WriteLine(result.GetProperty("streetSuffix").ToString()); + Console.WriteLine(result.GetProperty("postDirectional").ToString()); + Console.WriteLine(result.GetProperty("stateOrProvince").ToString()); + Console.WriteLine(result.GetProperty("countyOrDistrict").ToString()); + Console.WriteLine(result.GetProperty("cityOrTown").ToString()); + Console.WriteLine(result.GetProperty("cityOrTownAlias").ToString()); + Console.WriteLine(result.GetProperty("postalOrZipCode").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("companyName").ToString()); + Console.WriteLine(result.GetProperty("companyId").ToString()); + Console.WriteLine(result.GetProperty("defaultLocationId").ToString()); + Console.WriteLine(result.GetProperty("validationStatus").ToString()); + Console.WriteLine(result.GetProperty("tenantId").ToString()); + Console.WriteLine(result.GetProperty("partnerId").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("additionalInfo").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("isDefault").ToString()); + Console.WriteLine(result.GetProperty("locations")[0].GetProperty("elin").ToString()); + Console.WriteLine(result.GetProperty("latitude").ToString()); + Console.WriteLine(result.GetProperty("longitude").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TeamsCivicAddressResource_GetTeamsCivicAddresses_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + foreach (TeamsCivicAddressResource item in client.GetTeamsCivicAddresses("", maxCount: 1234, skip: 1234, maxpagesize: 1234, filter: "", countRecords: true)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TeamsCivicAddressResource_GetTeamsCivicAddresses_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + Accounts client = new VoiceServicesClient(endpoint, credential).GetAccountsClient(); + + await foreach (TeamsCivicAddressResource item in client.GetTeamsCivicAddressesAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234, filter: "", countRecords: true)) + { + } + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/tests/Generated/Samples/Samples_TeamsRequestsForInformation.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/tests/Generated/Samples/Samples_TeamsRequestsForInformation.cs new file mode 100644 index 000000000000..a96abe86f493 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/tests/Generated/Samples/Samples_TeamsRequestsForInformation.cs @@ -0,0 +1,456 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Microsoft.VoiceServices.Provisioning.Samples +{ + public partial class Samples_TeamsRequestsForInformation + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RequestForInformationResource_GetRequestForInformation_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + + Response response = client.GetRequestForInformation("", null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("tenantId").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RequestForInformationResource_GetRequestForInformation_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + + Response response = await client.GetRequestForInformationAsync("", null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("tenantId").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RequestForInformationResource_GetRequestForInformation_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + + Response response = client.GetRequestForInformation(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RequestForInformationResource_GetRequestForInformation_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + + Response response = await client.GetRequestForInformationAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RequestForInformationResource_GetRequestForInformation_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + + Response response = client.GetRequestForInformation("", null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("tenantId").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("productContext").ToString()); + Console.WriteLine(result.GetProperty("operatorId").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("consentedOn").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedOn").ToString()); + Console.WriteLine(result.GetProperty("consentedCountries")[0].ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("fullName").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("email").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companyName").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companySize").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("lastModifiedOn").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("comment").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RequestForInformationResource_GetRequestForInformation_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + + Response response = await client.GetRequestForInformationAsync("", null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("tenantId").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("productContext").ToString()); + Console.WriteLine(result.GetProperty("operatorId").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("consentedOn").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedOn").ToString()); + Console.WriteLine(result.GetProperty("consentedCountries")[0].ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("fullName").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("email").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companyName").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companySize").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("lastModifiedOn").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("comment").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RequestForInformationResource_GetRequestForInformation_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + + Response response = client.GetRequestForInformation("", requestConditions: null); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RequestForInformationResource_GetRequestForInformation_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + + Response response = await client.GetRequestForInformationAsync("", requestConditions: null); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RequestForInformationResource_CreateOrUpdateRequestForInformation_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + + using RequestContent content = RequestContent.Create(new object()); + Response response = client.CreateOrUpdateRequestForInformation("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("tenantId").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RequestForInformationResource_CreateOrUpdateRequestForInformation_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + + using RequestContent content = RequestContent.Create(new object()); + Response response = await client.CreateOrUpdateRequestForInformationAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("tenantId").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RequestForInformationResource_CreateOrUpdateRequestForInformation_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + + using RequestContent content = RequestContent.Create(new + { + customerRelationship = new + { + status = "", + comment = "", + }, + }); + Response response = client.CreateOrUpdateRequestForInformation("", content, requestConditions: null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("tenantId").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("productContext").ToString()); + Console.WriteLine(result.GetProperty("operatorId").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("consentedOn").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedOn").ToString()); + Console.WriteLine(result.GetProperty("consentedCountries")[0].ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("fullName").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("email").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companyName").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companySize").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("lastModifiedOn").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("comment").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RequestForInformationResource_CreateOrUpdateRequestForInformation_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + + using RequestContent content = RequestContent.Create(new + { + customerRelationship = new + { + status = "", + comment = "", + }, + }); + Response response = await client.CreateOrUpdateRequestForInformationAsync("", content, requestConditions: null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("tenantId").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("productContext").ToString()); + Console.WriteLine(result.GetProperty("operatorId").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("consentedOn").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedOn").ToString()); + Console.WriteLine(result.GetProperty("consentedCountries")[0].ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("fullName").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("email").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companyName").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companySize").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("lastModifiedOn").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("comment").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RequestForInformationResource_GetRequestForInformationResources_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + + foreach (BinaryData item in client.GetRequestForInformationResources(null, null, null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("tenantId").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RequestForInformationResource_GetRequestForInformationResources_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + + await foreach (BinaryData item in client.GetRequestForInformationResourcesAsync(null, null, null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("tenantId").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RequestForInformationResource_GetRequestForInformationResources_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + + foreach (RequestForInformationResource item in client.GetRequestForInformationResources()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RequestForInformationResource_GetRequestForInformationResources_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + + await foreach (RequestForInformationResource item in client.GetRequestForInformationResourcesAsync()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RequestForInformationResource_GetRequestForInformationResources_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + + foreach (BinaryData item in client.GetRequestForInformationResources(1234, 1234, 1234, "", true, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("tenantId").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("productContext").ToString()); + Console.WriteLine(result.GetProperty("operatorId").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("consentedOn").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedOn").ToString()); + Console.WriteLine(result.GetProperty("consentedCountries")[0].ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("fullName").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("email").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companyName").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companySize").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("lastModifiedOn").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("comment").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RequestForInformationResource_GetRequestForInformationResources_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + + await foreach (BinaryData item in client.GetRequestForInformationResourcesAsync(1234, 1234, 1234, "", true, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("tenantId").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("productContext").ToString()); + Console.WriteLine(result.GetProperty("operatorId").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("consentedOn").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedOn").ToString()); + Console.WriteLine(result.GetProperty("consentedCountries")[0].ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("fullName").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("email").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companyName").ToString()); + Console.WriteLine(result.GetProperty("contacts")[0].GetProperty("companySize").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("lastModifiedOn").ToString()); + Console.WriteLine(result.GetProperty("customerRelationship").GetProperty("comment").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RequestForInformationResource_GetRequestForInformationResources_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + + foreach (RequestForInformationResource item in client.GetRequestForInformationResources(maxCount: 1234, skip: 1234, maxpagesize: 1234, filter: "", countRecords: true)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RequestForInformationResource_GetRequestForInformationResources_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TeamsRequestsForInformation client = new VoiceServicesClient(endpoint, credential).GetTeamsRequestsForInformationClient(); + + await foreach (RequestForInformationResource item in client.GetRequestForInformationResourcesAsync(maxCount: 1234, skip: 1234, maxpagesize: 1234, filter: "", countRecords: true)) + { + } + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/tests/Generated/Samples/Samples_VoiceServicesClient.cs b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/tests/Generated/Samples/Samples_VoiceServicesClient.cs new file mode 100644 index 000000000000..1fc47e55ae68 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/tests/Generated/Samples/Samples_VoiceServicesClient.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Microsoft.VoiceServices.Provisioning.Samples +{ + public partial class Samples_VoiceServicesClient + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberResource_GetNumbers_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + VoiceServicesClient client = new VoiceServicesClient(endpoint, credential); + + foreach (BinaryData item in client.GetNumbers(null, null, null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberResource_GetNumbers_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + VoiceServicesClient client = new VoiceServicesClient(endpoint, credential); + + await foreach (BinaryData item in client.GetNumbersAsync(null, null, null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberResource_GetNumbers_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + VoiceServicesClient client = new VoiceServicesClient(endpoint, credential); + + foreach (NumberResource item in client.GetNumbers()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberResource_GetNumbers_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + VoiceServicesClient client = new VoiceServicesClient(endpoint, credential); + + await foreach (NumberResource item in client.GetNumbersAsync()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberResource_GetNumbers_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + VoiceServicesClient client = new VoiceServicesClient(endpoint, credential); + + foreach (BinaryData item in client.GetNumbers(1234, 1234, 1234, "", true, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("configuration").GetProperty("customSipHeader").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberResource_GetNumbers_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + VoiceServicesClient client = new VoiceServicesClient(endpoint, credential); + + await foreach (BinaryData item in client.GetNumbersAsync(1234, 1234, 1234, "", true, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("serviceProvisioningStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("serviceProvisioningErrors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("telephoneNumber").ToString()); + Console.WriteLine(result.GetProperty("accountName").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsOperatorConnect").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsDirectRouting").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("assignmentStatus").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("usage").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("choosableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("acquiredCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("availableCapabilities")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("additionalUsages")[0].ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("civicAddressId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("locationId").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("allowTenantAddressUpdate").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("teamsPhoneMobile").GetProperty("configuration").GetProperty("displayedCountryCode").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("zoomPhoneCloudPeering").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("serviceDetails").GetProperty("azureOperatorCallProtection").GetProperty("enabled").ToString()); + Console.WriteLine(result.GetProperty("configuration").GetProperty("customSipHeader").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberResource_GetNumbers_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + VoiceServicesClient client = new VoiceServicesClient(endpoint, credential); + + foreach (NumberResource item in client.GetNumbers(maxCount: 1234, skip: 1234, maxpagesize: 1234, filter: "", countRecords: true)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberResource_GetNumbers_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + VoiceServicesClient client = new VoiceServicesClient(endpoint, credential); + + await foreach (NumberResource item in client.GetNumbersAsync(maxCount: 1234, skip: 1234, maxpagesize: 1234, filter: "", countRecords: true)) + { + } + } + } +} diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/tests/Microsoft.VoiceServices.Provisioning.Tests.csproj b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/tests/Microsoft.VoiceServices.Provisioning.Tests.csproj new file mode 100644 index 000000000000..de28dc09a86a --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/tests/Microsoft.VoiceServices.Provisioning.Tests.csproj @@ -0,0 +1,19 @@ + + + $(RequiredTargetFrameworks) + + $(NoWarn);CS1591 + + + + + + + + + + + + + + diff --git a/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/tsp-location.yaml b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/tsp-location.yaml new file mode 100644 index 000000000000..70f61acb2f14 --- /dev/null +++ b/sdk/2024-02-29-preview/Microsoft.VoiceServices.Provisioning/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/voiceservices/VoiceServices.Provisioning +commit: 75af203a2e61f012df7acb36ecc7c5febe878a2d +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraClusterCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraClusterCollection.cs index 8d9aa53bf7f3..e37729d29934 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraClusterCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraClusterCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_CassandraClusterCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBManagedCassandraClusterListByResourceGroup() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraClusterListByResourceGroup.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBManagedCassandraClusterListByResourceGroup.json // this example is just showing the usage of "CassandraClusters_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task GetAll_CosmosDBManagedCassandraClusterListByResourceGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBManagedCassandraClusterGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraClusterGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBManagedCassandraClusterGet.json // this example is just showing the usage of "CassandraClusters_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -91,7 +91,7 @@ public async Task Get_CosmosDBManagedCassandraClusterGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBManagedCassandraClusterGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraClusterGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBManagedCassandraClusterGet.json // this example is just showing the usage of "CassandraClusters_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -121,7 +121,7 @@ public async Task Exists_CosmosDBManagedCassandraClusterGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBManagedCassandraClusterGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraClusterGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBManagedCassandraClusterGet.json // this example is just showing the usage of "CassandraClusters_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -163,7 +163,7 @@ public async Task GetIfExists_CosmosDBManagedCassandraClusterGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBManagedCassandraClusterCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraClusterCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBManagedCassandraClusterCreate.json // this example is just showing the usage of "CassandraClusters_CreateUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -173,7 +173,7 @@ public async Task CreateOrUpdate_CosmosDBManagedCassandraClusterCreate() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string subscriptionId = "subid"; string resourceGroupName = "cassandra-prod-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraClusterResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraClusterResource.cs index 8b8f956d370a..0cba8bd31d30 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraClusterResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraClusterResource.cs @@ -21,7 +21,7 @@ public partial class Sample_CassandraClusterResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetCassandraClusters_CosmosDBManagedCassandraClusterListBySubscription() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraClusterListBySubscription.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBManagedCassandraClusterListBySubscription.json // this example is just showing the usage of "CassandraClusters_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task GetCassandraClusters_CosmosDBManagedCassandraClusterListBySubs [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBManagedCassandraClusterGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraClusterGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBManagedCassandraClusterGet.json // this example is just showing the usage of "CassandraClusters_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -84,7 +84,7 @@ public async Task Get_CosmosDBManagedCassandraClusterGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBManagedCassandraClusterDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraClusterDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBManagedCassandraClusterDelete.json // this example is just showing the usage of "CassandraClusters_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -111,7 +111,7 @@ public async Task Delete_CosmosDBManagedCassandraClusterDelete() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBManagedCassandraClusterPatch() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraClusterPatch.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBManagedCassandraClusterPatch.json // this example is just showing the usage of "CassandraClusters_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -175,7 +175,7 @@ public async Task Update_CosmosDBManagedCassandraClusterPatch() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task InvokeCommand_CosmosDBManagedCassandraCommand() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraCommand.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBManagedCassandraCommand.json // this example is just showing the usage of "CassandraClusters_InvokeCommand" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -185,151 +185,26 @@ public async Task InvokeCommand_CosmosDBManagedCassandraCommand() // this example assumes you already have this CassandraClusterResource created on azure // for more information of creating CassandraClusterResource, please refer to the document of CassandraClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string subscriptionId = "subid"; string resourceGroupName = "cassandra-prod-rg"; string clusterName = "cassandra-prod"; ResourceIdentifier cassandraClusterResourceId = CassandraClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); CassandraClusterResource cassandraCluster = client.GetCassandraClusterResource(cassandraClusterResourceId); // invoke the operation - CassandraCommandPostBody body = new CassandraCommandPostBody("nodetool", "10.0.1.12") - { - Arguments = -{ -["status"] = "", -}, - }; + CassandraCommandPostBody body = new CassandraCommandPostBody("nodetool status", "10.0.1.12"); ArmOperation lro = await cassandraCluster.InvokeCommandAsync(WaitUntil.Completed, body); CassandraCommandOutput result = lro.Value; Console.WriteLine($"Succeeded: {result}"); } - // CosmosDBManagedCassandraListCommand - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetCommand_CosmosDBManagedCassandraListCommand() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraListCommand.json - // this example is just showing the usage of "CassandraClusters_ListCommand" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CassandraClusterResource created on azure - // for more information of creating CassandraClusterResource, please refer to the document of CassandraClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "cassandra-prod-rg"; - string clusterName = "cassandra-prod"; - ResourceIdentifier cassandraClusterResourceId = CassandraClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); - CassandraClusterResource cassandraCluster = client.GetCassandraClusterResource(cassandraClusterResourceId); - - // invoke the operation and iterate over the result - await foreach (CassandraClusterCommand item in cassandraCluster.GetCommandAsync()) - { - Console.WriteLine($"Succeeded: {item}"); - } - - Console.WriteLine($"Succeeded"); - } - - // CosmosDBManagedCassandraCommandResult - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetCommandAsync_CosmosDBManagedCassandraCommandResult() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraCommandResult.json - // this example is just showing the usage of "CassandraClusters_GetCommandAsync" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CassandraClusterResource created on azure - // for more information of creating CassandraClusterResource, please refer to the document of CassandraClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "cassandra-prod-rg"; - string clusterName = "cassandra-prod"; - ResourceIdentifier cassandraClusterResourceId = CassandraClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); - CassandraClusterResource cassandraCluster = client.GetCassandraClusterResource(cassandraClusterResourceId); - - // invoke the operation and iterate over the result - string commandId = "318653d0-3da5-4814-b8f6-429f2af0b2a4"; - await foreach (CassandraClusterCommand item in cassandraCluster.GetCommandAsyncAsync(commandId)) - { - Console.WriteLine($"Succeeded: {item}"); - } - - Console.WriteLine($"Succeeded"); - } - - // CosmosDBManagedCassandraBackupsList - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetBackups_CosmosDBManagedCassandraBackupsList() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraBackupsList.json - // this example is just showing the usage of "CassandraClusters_ListBackups" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CassandraClusterResource created on azure - // for more information of creating CassandraClusterResource, please refer to the document of CassandraClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "cassandra-prod-rg"; - string clusterName = "cassandra-prod"; - ResourceIdentifier cassandraClusterResourceId = CassandraClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); - CassandraClusterResource cassandraCluster = client.GetCassandraClusterResource(cassandraClusterResourceId); - - // invoke the operation and iterate over the result - await foreach (CassandraClusterBackupResourceInfo item in cassandraCluster.GetBackupsAsync()) - { - Console.WriteLine($"Succeeded: {item}"); - } - - Console.WriteLine($"Succeeded"); - } - - // CosmosDBManagedCassandraBackup - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetBackup_CosmosDBManagedCassandraBackup() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraBackup.json - // this example is just showing the usage of "CassandraClusters_GetBackup" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CassandraClusterResource created on azure - // for more information of creating CassandraClusterResource, please refer to the document of CassandraClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "cassandra-prod-rg"; - string clusterName = "cassandra-prod"; - ResourceIdentifier cassandraClusterResourceId = CassandraClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); - CassandraClusterResource cassandraCluster = client.GetCassandraClusterResource(cassandraClusterResourceId); - - // invoke the operation - string backupId = "1611250348"; - CassandraClusterBackupResourceInfo result = await cassandraCluster.GetBackupAsync(backupId); - - Console.WriteLine($"Succeeded: {result}"); - } - // CosmosDBManagedCassandraClusterDeallocate [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Deallocate_CosmosDBManagedCassandraClusterDeallocate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraClusterDeallocate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBManagedCassandraClusterDeallocate.json // this example is just showing the usage of "CassandraClusters_Deallocate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -339,7 +214,7 @@ public async Task Deallocate_CosmosDBManagedCassandraClusterDeallocate() // this example assumes you already have this CassandraClusterResource created on azure // for more information of creating CassandraClusterResource, please refer to the document of CassandraClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string subscriptionId = "subid"; string resourceGroupName = "cassandra-prod-rg"; string clusterName = "cassandra-prod"; ResourceIdentifier cassandraClusterResourceId = CassandraClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); @@ -356,7 +231,7 @@ public async Task Deallocate_CosmosDBManagedCassandraClusterDeallocate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Start_CosmosDBManagedCassandraClusterStart() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraClusterStart.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBManagedCassandraClusterStart.json // this example is just showing the usage of "CassandraClusters_Start" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -366,7 +241,7 @@ public async Task Start_CosmosDBManagedCassandraClusterStart() // this example assumes you already have this CassandraClusterResource created on azure // for more information of creating CassandraClusterResource, please refer to the document of CassandraClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string subscriptionId = "subid"; string resourceGroupName = "cassandra-prod-rg"; string clusterName = "cassandra-prod"; ResourceIdentifier cassandraClusterResourceId = CassandraClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); @@ -383,7 +258,7 @@ public async Task Start_CosmosDBManagedCassandraClusterStart() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Status_CosmosDBManagedCassandraStatus() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraStatus.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBManagedCassandraStatus.json // this example is just showing the usage of "CassandraClusters_Status" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -393,7 +268,7 @@ public async Task Status_CosmosDBManagedCassandraStatus() // this example assumes you already have this CassandraClusterResource created on azure // for more information of creating CassandraClusterResource, please refer to the document of CassandraClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string subscriptionId = "subid"; string resourceGroupName = "cassandra-prod-rg"; string clusterName = "cassandra-prod"; ResourceIdentifier cassandraClusterResourceId = CassandraClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraDataCenterCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraDataCenterCollection.cs index c902a3be9dd7..a75be92b57c9 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraDataCenterCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraDataCenterCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CassandraDataCenterCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBManagedCassandraDataCenterList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraDataCenterList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBManagedCassandraDataCenterList.json // this example is just showing the usage of "CassandraDataCenters_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task GetAll_CosmosDBManagedCassandraDataCenterList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBManagedCassandraDataCenterGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraDataCenterGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBManagedCassandraDataCenterGet.json // this example is just showing the usage of "CassandraDataCenters_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task Get_CosmosDBManagedCassandraDataCenterGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBManagedCassandraDataCenterGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraDataCenterGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBManagedCassandraDataCenterGet.json // this example is just showing the usage of "CassandraDataCenters_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +123,7 @@ public async Task Exists_CosmosDBManagedCassandraDataCenterGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBManagedCassandraDataCenterGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraDataCenterGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBManagedCassandraDataCenterGet.json // this example is just showing the usage of "CassandraDataCenters_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +166,7 @@ public async Task GetIfExists_CosmosDBManagedCassandraDataCenterGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBManagedCassandraDataCenterCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraDataCenterCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBManagedCassandraDataCenterCreate.json // this example is just showing the usage of "CassandraDataCenters_CreateUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraDataCenterResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraDataCenterResource.cs index 8fee33385b38..44691cd60e42 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraDataCenterResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraDataCenterResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CassandraDataCenterResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBManagedCassandraDataCenterGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraDataCenterGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBManagedCassandraDataCenterGet.json // this example is just showing the usage of "CassandraDataCenters_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBManagedCassandraDataCenterGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBManagedCassandraDataCenterDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraDataCenterDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBManagedCassandraDataCenterDelete.json // this example is just showing the usage of "CassandraDataCenters_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +80,7 @@ public async Task Delete_CosmosDBManagedCassandraDataCenterDelete() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBManagedCassandraDataCenterUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraDataCenterPatch.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBManagedCassandraDataCenterPatch.json // this example is just showing the usage of "CassandraDataCenters_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceCollection.cs index 8cfc8e8f9bf8..4b16d7f11fc2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CassandraKeyspaceCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBCassandraKeyspaceList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraKeyspaceList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBCassandraKeyspaceList.json // this example is just showing the usage of "CassandraResources_ListCassandraKeyspaces" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task GetAll_CosmosDBCassandraKeyspaceList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBCassandraKeyspaceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraKeyspaceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBCassandraKeyspaceGet.json // this example is just showing the usage of "CassandraResources_GetCassandraKeyspace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task Get_CosmosDBCassandraKeyspaceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBCassandraKeyspaceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraKeyspaceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBCassandraKeyspaceGet.json // this example is just showing the usage of "CassandraResources_GetCassandraKeyspace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +123,7 @@ public async Task Exists_CosmosDBCassandraKeyspaceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBCassandraKeyspaceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraKeyspaceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBCassandraKeyspaceGet.json // this example is just showing the usage of "CassandraResources_GetCassandraKeyspace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +166,7 @@ public async Task GetIfExists_CosmosDBCassandraKeyspaceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBCassandraKeyspaceCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraKeyspaceCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBCassandraKeyspaceCreateUpdate.json // this example is just showing the usage of "CassandraResources_CreateUpdateCassandraKeyspace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceResource.cs index 61c064ba9d13..553cf5cca1f9 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CassandraKeyspaceResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBCassandraKeyspaceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraKeyspaceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBCassandraKeyspaceGet.json // this example is just showing the usage of "CassandraResources_GetCassandraKeyspace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBCassandraKeyspaceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBCassandraKeyspaceCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraKeyspaceCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBCassandraKeyspaceCreateUpdate.json // this example is just showing the usage of "CassandraResources_CreateUpdateCassandraKeyspace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task Update_CosmosDBCassandraKeyspaceCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBCassandraKeyspaceDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraKeyspaceDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBCassandraKeyspaceDelete.json // this example is just showing the usage of "CassandraResources_DeleteCassandraKeyspace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceThroughputSettingResource.cs index 1a0b8bb08933..c5388b28c0b4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceThroughputSettingResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CassandraKeyspaceThroughputSettingResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBCassandraKeyspaceThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraKeyspaceThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBCassandraKeyspaceThroughputGet.json // this example is just showing the usage of "CassandraResources_GetCassandraKeyspaceThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBCassandraKeyspaceThroughputGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBCassandraKeyspaceThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraKeyspaceThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBCassandraKeyspaceThroughputUpdate.json // this example is just showing the usage of "CassandraResources_UpdateCassandraKeyspaceThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task CreateOrUpdate_CosmosDBCassandraKeyspaceThroughputUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateCassandraKeyspaceToAutoscale_CosmosDBCassandraKeyspaceMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraKeyspaceMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBCassandraKeyspaceMigrateToAutoscale.json // this example is just showing the usage of "CassandraResources_MigrateCassandraKeyspaceToAutoscale" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -127,7 +127,7 @@ public async Task MigrateCassandraKeyspaceToAutoscale_CosmosDBCassandraKeyspaceM [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateCassandraKeyspaceToManualThroughput_CosmosDBCassandraKeyspaceMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraKeyspaceMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBCassandraKeyspaceMigrateToManualThroughput.json // this example is just showing the usage of "CassandraResources_MigrateCassandraKeyspaceToManualThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableCollection.cs index 778fe3979f06..14f4ed372556 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CassandraTableCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBCassandraTableList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraTableList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBCassandraTableList.json // this example is just showing the usage of "CassandraResources_ListCassandraTables" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -58,7 +58,7 @@ public async Task GetAll_CosmosDBCassandraTableList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBCassandraTableGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraTableGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBCassandraTableGet.json // this example is just showing the usage of "CassandraResources_GetCassandraTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task Get_CosmosDBCassandraTableGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBCassandraTableGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraTableGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBCassandraTableGet.json // this example is just showing the usage of "CassandraResources_GetCassandraTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -126,7 +126,7 @@ public async Task Exists_CosmosDBCassandraTableGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBCassandraTableGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraTableGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBCassandraTableGet.json // this example is just showing the usage of "CassandraResources_GetCassandraTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -170,7 +170,7 @@ public async Task GetIfExists_CosmosDBCassandraTableGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBCassandraTableCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraTableCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBCassandraTableCreateUpdate.json // this example is just showing the usage of "CassandraResources_CreateUpdateCassandraTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -221,7 +221,6 @@ public async Task CreateOrUpdate_CosmosDBCassandraTableCreateUpdate() } }, }, - AnalyticalStorageTtl = 500, }) { Options = new CosmosDBCreateUpdateConfig(), diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableResource.cs index 9cb69423b219..eed8c3d49b23 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CassandraTableResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBCassandraTableGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraTableGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBCassandraTableGet.json // this example is just showing the usage of "CassandraResources_GetCassandraTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_CosmosDBCassandraTableGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBCassandraTableCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraTableCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBCassandraTableCreateUpdate.json // this example is just showing the usage of "CassandraResources_CreateUpdateCassandraTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -101,7 +101,6 @@ public async Task Update_CosmosDBCassandraTableCreateUpdate() } }, }, - AnalyticalStorageTtl = 500, }) { Options = new CosmosDBCreateUpdateConfig(), @@ -124,7 +123,7 @@ public async Task Update_CosmosDBCassandraTableCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBCassandraTableDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraTableDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBCassandraTableDelete.json // this example is just showing the usage of "CassandraResources_DeleteCassandraTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableThroughputSettingResource.cs index 346457eb5796..0f67008d6914 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableThroughputSettingResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CassandraTableThroughputSettingResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBCassandraTableThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraTableThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBCassandraTableThroughputGet.json // this example is just showing the usage of "CassandraResources_GetCassandraTableThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_CosmosDBCassandraTableThroughputGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBCassandraTableThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraTableThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBCassandraTableThroughputUpdate.json // this example is just showing the usage of "CassandraResources_UpdateCassandraTableThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -96,7 +96,7 @@ public async Task CreateOrUpdate_CosmosDBCassandraTableThroughputUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateCassandraTableToAutoscale_CosmosDBCassandraTableMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraTableMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBCassandraTableMigrateToAutoscale.json // this example is just showing the usage of "CassandraResources_MigrateCassandraTableToAutoscale" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -130,7 +130,7 @@ public async Task MigrateCassandraTableToAutoscale_CosmosDBCassandraTableMigrate [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateCassandraTableToManualThroughput_CosmosDBCassandraTableMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraTableMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBCassandraTableMigrateToManualThroughput.json // this example is just showing the usage of "CassandraResources_MigrateCassandraTableToManualThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewGetResultCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewGetResultCollection.cs deleted file mode 100644 index fc176283d4a5..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewGetResultCollection.cs +++ /dev/null @@ -1,212 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB.Samples -{ - public partial class Sample_CassandraViewGetResultCollection - { - // CosmosDBCassandraViewList - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_CosmosDBCassandraViewList() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraViewList.json - // this example is just showing the usage of "CassandraResources_ListCassandraViews" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CassandraKeyspaceResource created on azure - // for more information of creating CassandraKeyspaceResource, please refer to the document of CassandraKeyspaceResource - string subscriptionId = "subid"; - string resourceGroupName = "rgName"; - string accountName = "ddb1"; - string keyspaceName = "keyspacename"; - ResourceIdentifier cassandraKeyspaceResourceId = CassandraKeyspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, keyspaceName); - CassandraKeyspaceResource cassandraKeyspace = client.GetCassandraKeyspaceResource(cassandraKeyspaceResourceId); - - // get the collection of this CassandraViewGetResultResource - CassandraViewGetResultCollection collection = cassandraKeyspace.GetCassandraViewGetResults(); - - // invoke the operation and iterate over the result - await foreach (CassandraViewGetResultResource item in collection.GetAllAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CassandraViewGetResultData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // CosmosDBCassandraViewGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_CosmosDBCassandraViewGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraViewGet.json - // this example is just showing the usage of "CassandraResources_GetCassandraView" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CassandraKeyspaceResource created on azure - // for more information of creating CassandraKeyspaceResource, please refer to the document of CassandraKeyspaceResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string keyspaceName = "keyspacename"; - ResourceIdentifier cassandraKeyspaceResourceId = CassandraKeyspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, keyspaceName); - CassandraKeyspaceResource cassandraKeyspace = client.GetCassandraKeyspaceResource(cassandraKeyspaceResourceId); - - // get the collection of this CassandraViewGetResultResource - CassandraViewGetResultCollection collection = cassandraKeyspace.GetCassandraViewGetResults(); - - // invoke the operation - string viewName = "viewname"; - CassandraViewGetResultResource result = await collection.GetAsync(viewName); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CassandraViewGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBCassandraViewGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_CosmosDBCassandraViewGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraViewGet.json - // this example is just showing the usage of "CassandraResources_GetCassandraView" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CassandraKeyspaceResource created on azure - // for more information of creating CassandraKeyspaceResource, please refer to the document of CassandraKeyspaceResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string keyspaceName = "keyspacename"; - ResourceIdentifier cassandraKeyspaceResourceId = CassandraKeyspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, keyspaceName); - CassandraKeyspaceResource cassandraKeyspace = client.GetCassandraKeyspaceResource(cassandraKeyspaceResourceId); - - // get the collection of this CassandraViewGetResultResource - CassandraViewGetResultCollection collection = cassandraKeyspace.GetCassandraViewGetResults(); - - // invoke the operation - string viewName = "viewname"; - bool result = await collection.ExistsAsync(viewName); - - Console.WriteLine($"Succeeded: {result}"); - } - - // CosmosDBCassandraViewGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetIfExists_CosmosDBCassandraViewGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraViewGet.json - // this example is just showing the usage of "CassandraResources_GetCassandraView" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CassandraKeyspaceResource created on azure - // for more information of creating CassandraKeyspaceResource, please refer to the document of CassandraKeyspaceResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string keyspaceName = "keyspacename"; - ResourceIdentifier cassandraKeyspaceResourceId = CassandraKeyspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, keyspaceName); - CassandraKeyspaceResource cassandraKeyspace = client.GetCassandraKeyspaceResource(cassandraKeyspaceResourceId); - - // get the collection of this CassandraViewGetResultResource - CassandraViewGetResultCollection collection = cassandraKeyspace.GetCassandraViewGetResults(); - - // invoke the operation - string viewName = "viewname"; - NullableResponse response = await collection.GetIfExistsAsync(viewName); - CassandraViewGetResultResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine($"Succeeded with null as result"); - } - else - { - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CassandraViewGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - - // CosmosDBCassandraViewCreateUpdate - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CosmosDBCassandraViewCreateUpdate() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraViewCreateUpdate.json - // this example is just showing the usage of "CassandraResources_CreateUpdateCassandraView" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CassandraKeyspaceResource created on azure - // for more information of creating CassandraKeyspaceResource, please refer to the document of CassandraKeyspaceResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string keyspaceName = "keyspacename"; - ResourceIdentifier cassandraKeyspaceResourceId = CassandraKeyspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, keyspaceName); - CassandraKeyspaceResource cassandraKeyspace = client.GetCassandraKeyspaceResource(cassandraKeyspaceResourceId); - - // get the collection of this CassandraViewGetResultResource - CassandraViewGetResultCollection collection = cassandraKeyspace.GetCassandraViewGetResults(); - - // invoke the operation - string viewName = "viewname"; - CassandraViewGetResultCreateOrUpdateContent content = new CassandraViewGetResultCreateOrUpdateContent(new AzureLocation("placeholder"), new CassandraViewResource("viewname", "SELECT columna, columnb, columnc FROM keyspacename.srctablename WHERE columna IS NOT NULL AND columnc IS NOT NULL PRIMARY (columnc, columna)")) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = -{ -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, viewName, content); - CassandraViewGetResultResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CassandraViewGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewGetResultResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewGetResultResource.cs deleted file mode 100644 index 27e9706ebc5e..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewGetResultResource.cs +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB.Samples -{ - public partial class Sample_CassandraViewGetResultResource - { - // CosmosDBCassandraViewGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_CosmosDBCassandraViewGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraViewGet.json - // this example is just showing the usage of "CassandraResources_GetCassandraView" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CassandraViewGetResultResource created on azure - // for more information of creating CassandraViewGetResultResource, please refer to the document of CassandraViewGetResultResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string keyspaceName = "keyspacename"; - string viewName = "viewname"; - ResourceIdentifier cassandraViewGetResultResourceId = CassandraViewGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - CassandraViewGetResultResource cassandraViewGetResult = client.GetCassandraViewGetResultResource(cassandraViewGetResultResourceId); - - // invoke the operation - CassandraViewGetResultResource result = await cassandraViewGetResult.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CassandraViewGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBCassandraViewCreateUpdate - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CosmosDBCassandraViewCreateUpdate() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraViewCreateUpdate.json - // this example is just showing the usage of "CassandraResources_CreateUpdateCassandraView" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CassandraViewGetResultResource created on azure - // for more information of creating CassandraViewGetResultResource, please refer to the document of CassandraViewGetResultResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string keyspaceName = "keyspacename"; - string viewName = "viewname"; - ResourceIdentifier cassandraViewGetResultResourceId = CassandraViewGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - CassandraViewGetResultResource cassandraViewGetResult = client.GetCassandraViewGetResultResource(cassandraViewGetResultResourceId); - - // invoke the operation - CassandraViewGetResultCreateOrUpdateContent content = new CassandraViewGetResultCreateOrUpdateContent(new AzureLocation("placeholder"), new CassandraViewResource("viewname", "SELECT columna, columnb, columnc FROM keyspacename.srctablename WHERE columna IS NOT NULL AND columnc IS NOT NULL PRIMARY (columnc, columna)")) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = -{ -}, - }; - ArmOperation lro = await cassandraViewGetResult.UpdateAsync(WaitUntil.Completed, content); - CassandraViewGetResultResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CassandraViewGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBCassandraViewDelete - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Delete_CosmosDBCassandraViewDelete() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraViewDelete.json - // this example is just showing the usage of "CassandraResources_DeleteCassandraView" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CassandraViewGetResultResource created on azure - // for more information of creating CassandraViewGetResultResource, please refer to the document of CassandraViewGetResultResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string keyspaceName = "keyspacename"; - string viewName = "viewname"; - ResourceIdentifier cassandraViewGetResultResourceId = CassandraViewGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - CassandraViewGetResultResource cassandraViewGetResult = client.GetCassandraViewGetResultResource(cassandraViewGetResultResourceId); - - // invoke the operation - await cassandraViewGetResult.DeleteAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewThroughputSettingResource.cs deleted file mode 100644 index 45d08bf67e5d..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewThroughputSettingResource.cs +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB.Samples -{ - public partial class Sample_CassandraViewThroughputSettingResource - { - // CosmosDBCassandraViewThroughputGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_CosmosDBCassandraViewThroughputGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraViewThroughputGet.json - // this example is just showing the usage of "CassandraResources_GetCassandraViewThroughput" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CassandraViewThroughputSettingResource created on azure - // for more information of creating CassandraViewThroughputSettingResource, please refer to the document of CassandraViewThroughputSettingResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string keyspaceName = "keyspacename"; - string viewName = "viewname"; - ResourceIdentifier cassandraViewThroughputSettingResourceId = CassandraViewThroughputSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - CassandraViewThroughputSettingResource cassandraViewThroughputSetting = client.GetCassandraViewThroughputSettingResource(cassandraViewThroughputSettingResourceId); - - // invoke the operation - CassandraViewThroughputSettingResource result = await cassandraViewThroughputSetting.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ThroughputSettingData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBCassandraViewThroughputUpdate - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CosmosDBCassandraViewThroughputUpdate() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraViewThroughputUpdate.json - // this example is just showing the usage of "CassandraResources_UpdateCassandraViewThroughput" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CassandraViewThroughputSettingResource created on azure - // for more information of creating CassandraViewThroughputSettingResource, please refer to the document of CassandraViewThroughputSettingResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string keyspaceName = "keyspacename"; - string viewName = "viewname"; - ResourceIdentifier cassandraViewThroughputSettingResourceId = CassandraViewThroughputSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - CassandraViewThroughputSettingResource cassandraViewThroughputSetting = client.GetCassandraViewThroughputSettingResource(cassandraViewThroughputSettingResourceId); - - // invoke the operation - ThroughputSettingsUpdateData data = new ThroughputSettingsUpdateData(new AzureLocation("placeholder"), new ThroughputSettingsResourceInfo() - { - Throughput = 400, - }) - { - Tags = -{ -}, - }; - ArmOperation lro = await cassandraViewThroughputSetting.CreateOrUpdateAsync(WaitUntil.Completed, data); - CassandraViewThroughputSettingResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ThroughputSettingData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBCassandraViewMigrateToAutoscale - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task MigrateCassandraViewToAutoscale_CosmosDBCassandraViewMigrateToAutoscale() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraViewMigrateToAutoscale.json - // this example is just showing the usage of "CassandraResources_MigrateCassandraViewToAutoscale" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CassandraViewThroughputSettingResource created on azure - // for more information of creating CassandraViewThroughputSettingResource, please refer to the document of CassandraViewThroughputSettingResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string keyspaceName = "keyspacename"; - string viewName = "viewname"; - ResourceIdentifier cassandraViewThroughputSettingResourceId = CassandraViewThroughputSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - CassandraViewThroughputSettingResource cassandraViewThroughputSetting = client.GetCassandraViewThroughputSettingResource(cassandraViewThroughputSettingResourceId); - - // invoke the operation - ArmOperation lro = await cassandraViewThroughputSetting.MigrateCassandraViewToAutoscaleAsync(WaitUntil.Completed); - CassandraViewThroughputSettingResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ThroughputSettingData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBCassandraViewMigrateToManualThroughput - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task MigrateCassandraViewToManualThroughput_CosmosDBCassandraViewMigrateToManualThroughput() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraViewMigrateToManualThroughput.json - // this example is just showing the usage of "CassandraResources_MigrateCassandraViewToManualThroughput" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CassandraViewThroughputSettingResource created on azure - // for more information of creating CassandraViewThroughputSettingResource, please refer to the document of CassandraViewThroughputSettingResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string keyspaceName = "keyspacename"; - string viewName = "viewname"; - ResourceIdentifier cassandraViewThroughputSettingResourceId = CassandraViewThroughputSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - CassandraViewThroughputSettingResource cassandraViewThroughputSetting = client.GetCassandraViewThroughputSettingResource(cassandraViewThroughputSettingResourceId); - - // invoke the operation - ArmOperation lro = await cassandraViewThroughputSetting.MigrateCassandraViewToManualThroughputAsync(WaitUntil.Completed); - CassandraViewThroughputSettingResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ThroughputSettingData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBAccountCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBAccountCollection.cs index 5a92cbae4f1e..794c2268dcc4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBAccountCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBAccountCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_CosmosDBAccountCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBDatabaseAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBDatabaseAccountGet.json // this example is just showing the usage of "DatabaseAccounts_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -56,7 +56,7 @@ public async Task Get_CosmosDBDatabaseAccountGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBDatabaseAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBDatabaseAccountGet.json // this example is just showing the usage of "DatabaseAccounts_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +86,7 @@ public async Task Exists_CosmosDBDatabaseAccountGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBDatabaseAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBDatabaseAccountGet.json // this example is just showing the usage of "DatabaseAccounts_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -128,7 +128,7 @@ public async Task GetIfExists_CosmosDBDatabaseAccountGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBDatabaseAccountCreateMax() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountCreateMax.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBDatabaseAccountCreateMax.json // this example is just showing the usage of "DatabaseAccounts_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -164,6 +164,13 @@ public async Task CreateOrUpdate_CosmosDBDatabaseAccountCreateMax() }) { Kind = CosmosDBAccountKind.MongoDB, + Identity = new ManagedServiceIdentity("SystemAssigned,UserAssigned") + { + UserAssignedIdentities = +{ +[new ResourceIdentifier("/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/eu2cgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1")] = new UserAssignedIdentity(), +}, + }, ConsistencyPolicy = new ConsistencyPolicy(DefaultConsistencyLevel.BoundedStaleness) { MaxStalenessPrefix = 200, @@ -215,20 +222,8 @@ public async Task CreateOrUpdate_CosmosDBDatabaseAccountCreateMax() new ResourceIdentifier("/subscriptions/subId/resourcegroups/rgName/providers/Microsoft.Synapse/workspaces/workspaceName") }, CapacityTotalThroughputLimit = 2000, - CapacityMode = CapacityMode.Provisioned, - EnableMaterializedViews = false, - EnableBurstCapacity = true, MinimalTlsVersion = CosmosDBMinimalTlsVersion.Tls12, - EnablePriorityBasedExecution = true, - DefaultPriorityLevel = DefaultPriorityLevel.Low, - EnablePerRegionPerPartitionAutoscale = true, - Identity = new ManagedServiceIdentity("SystemAssigned,UserAssigned") - { - UserAssignedIdentities = -{ -[new ResourceIdentifier("/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/eu2cgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1")] = new UserAssignedIdentity(), -}, - }, + EnableBurstCapacity = true, Tags = { }, @@ -248,7 +243,7 @@ public async Task CreateOrUpdate_CosmosDBDatabaseAccountCreateMax() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBDatabaseAccountCreateMin() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountCreateMin.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBDatabaseAccountCreateMin.json // this example is just showing the usage of "DatabaseAccounts_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -295,7 +290,7 @@ public async Task CreateOrUpdate_CosmosDBDatabaseAccountCreateMin() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBRestoreDatabaseAccountCreateUpdateJson() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBRestoreDatabaseAccountCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBRestoreDatabaseAccountCreateUpdate.json // this example is just showing the usage of "DatabaseAccounts_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -361,12 +356,10 @@ public async Task CreateOrUpdate_CosmosDBRestoreDatabaseAccountCreateUpdateJson( }, } }, - SourceBackupLocation = "westus", RestoreSource = "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/westus/restorableDatabaseAccounts/1a97b4bb-f6a0-430e-ade1-638d781830cc", RestoreTimestampInUtc = DateTimeOffset.Parse("2021-03-11T22:05:09Z"), IsRestoreWithTtlDisabled = false, }, - EnableMaterializedViews = false, MinimalTlsVersion = CosmosDBMinimalTlsVersion.Tls, Tags = { @@ -387,7 +380,7 @@ public async Task CreateOrUpdate_CosmosDBRestoreDatabaseAccountCreateUpdateJson( [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBDatabaseAccountListByResourceGroup() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountListByResourceGroup.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBDatabaseAccountListByResourceGroup.json // this example is just showing the usage of "DatabaseAccounts_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBAccountResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBAccountResource.cs index 6023b3f192a0..4d9305b75a1e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBAccountResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBAccountResource.cs @@ -22,7 +22,7 @@ public partial class Sample_CosmosDBAccountResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBDatabaseAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBDatabaseAccountGet.json // this example is just showing the usage of "DatabaseAccounts_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_CosmosDBDatabaseAccountGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBDatabaseAccountPatch() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountPatch.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBDatabaseAccountPatch.json // this example is just showing the usage of "DatabaseAccounts_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -118,7 +118,7 @@ public async Task Update_CosmosDBDatabaseAccountPatch() { BackupIntervalInMinutes = 240, BackupRetentionIntervalInHours = 720, - BackupStorageRedundancy = CosmosDBBackupStorageRedundancy.Geo, + BackupStorageRedundancy = CosmosDBBackupStorageRedundancy.Local, }, }, NetworkAclBypass = NetworkAclBypass.AzureServices, @@ -126,15 +126,10 @@ public async Task Update_CosmosDBDatabaseAccountPatch() { new ResourceIdentifier("/subscriptions/subId/resourcegroups/rgName/providers/Microsoft.Synapse/workspaces/workspaceName") }, - DiagnosticLogEnableFullTextQuery = EnableFullTextQuery.True, CapacityTotalThroughputLimit = 2000, - CapacityMode = CapacityMode.Provisioned, EnablePartitionMerge = true, - EnableBurstCapacity = true, MinimalTlsVersion = CosmosDBMinimalTlsVersion.Tls, - EnablePriorityBasedExecution = true, - DefaultPriorityLevel = DefaultPriorityLevel.Low, - EnablePerRegionPerPartitionAutoscale = true, + EnableBurstCapacity = true, }; ArmOperation lro = await cosmosDBAccount.UpdateAsync(WaitUntil.Completed, patch); CosmosDBAccountResource result = lro.Value; @@ -151,7 +146,7 @@ public async Task Update_CosmosDBDatabaseAccountPatch() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBDatabaseAccountDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBDatabaseAccountDelete.json // this example is just showing the usage of "DatabaseAccounts_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -178,7 +173,7 @@ public async Task Delete_CosmosDBDatabaseAccountDelete() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task FailoverPriorityChange_CosmosDBDatabaseAccountFailoverPriorityChange() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountFailoverPriorityChange.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBDatabaseAccountFailoverPriorityChange.json // this example is just showing the usage of "DatabaseAccounts_FailoverPriorityChange" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -217,7 +212,7 @@ public async Task FailoverPriorityChange_CosmosDBDatabaseAccountFailoverPriority [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetCosmosDBAccounts_CosmosDBDatabaseAccountList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBDatabaseAccountList.json // this example is just showing the usage of "DatabaseAccounts_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -249,7 +244,7 @@ public async Task GetCosmosDBAccounts_CosmosDBDatabaseAccountList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetKeys_CosmosDBDatabaseAccountListKeys() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountListKeys.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBDatabaseAccountListKeys.json // this example is just showing the usage of "DatabaseAccounts_ListKeys" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -276,7 +271,7 @@ public async Task GetKeys_CosmosDBDatabaseAccountListKeys() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetConnectionStrings_CosmosDBDatabaseAccountListConnectionStrings() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountListConnectionStrings.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBDatabaseAccountListConnectionStrings.json // this example is just showing the usage of "DatabaseAccounts_ListConnectionStrings" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -306,7 +301,7 @@ public async Task GetConnectionStrings_CosmosDBDatabaseAccountListConnectionStri [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetConnectionStrings_CosmosDBDatabaseAccountListConnectionStringsMongo() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountListConnectionStringsMongo.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBDatabaseAccountListConnectionStringsMongo.json // this example is just showing the usage of "DatabaseAccounts_ListConnectionStrings" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -336,7 +331,7 @@ public async Task GetConnectionStrings_CosmosDBDatabaseAccountListConnectionStri [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task OfflineRegion_CosmosDBDatabaseAccountOfflineRegion() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountOfflineRegion.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBDatabaseAccountOfflineRegion.json // this example is just showing the usage of "DatabaseAccounts_OfflineRegion" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -364,7 +359,7 @@ public async Task OfflineRegion_CosmosDBDatabaseAccountOfflineRegion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task OnlineRegion_CosmosDBDatabaseAccountOnlineRegion() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountOnlineRegion.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBDatabaseAccountOnlineRegion.json // this example is just showing the usage of "DatabaseAccounts_OnlineRegion" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -392,7 +387,7 @@ public async Task OnlineRegion_CosmosDBDatabaseAccountOnlineRegion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetReadOnlyKeys_CosmosDBDatabaseAccountListReadOnlyKeys() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json // this example is just showing the usage of "DatabaseAccounts_ListReadOnlyKeys" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -419,7 +414,7 @@ public async Task GetReadOnlyKeys_CosmosDBDatabaseAccountListReadOnlyKeys() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task RegenerateKey_CosmosDBDatabaseAccountRegenerateKey() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountRegenerateKey.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBDatabaseAccountRegenerateKey.json // this example is just showing the usage of "DatabaseAccounts_RegenerateKey" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -447,7 +442,7 @@ public async Task RegenerateKey_CosmosDBDatabaseAccountRegenerateKey() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CheckNameExistsDatabaseAccount_CosmosDBDatabaseAccountCheckNameExists() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountCheckNameExists.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBDatabaseAccountCheckNameExists.json // this example is just showing the usage of "DatabaseAccounts_CheckNameExists" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -471,7 +466,7 @@ public async Task CheckNameExistsDatabaseAccount_CosmosDBDatabaseAccountCheckNam [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetrics_CosmosDBDatabaseAccountGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBDatabaseAccountGetMetrics.json // this example is just showing the usage of "DatabaseAccounts_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -502,7 +497,7 @@ public async Task GetMetrics_CosmosDBDatabaseAccountGetMetrics() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetUsages_CosmosDBDatabaseAccountGetUsages() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountGetUsages.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBDatabaseAccountGetUsages.json // this example is just showing the usage of "DatabaseAccounts_ListUsages" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -533,7 +528,7 @@ public async Task GetUsages_CosmosDBDatabaseAccountGetUsages() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricDefinitions_CosmosDBDatabaseAccountGetMetricDefinitions() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountGetMetricDefinitions.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBDatabaseAccountGetMetricDefinitions.json // this example is just showing the usage of "DatabaseAccounts_ListMetricDefinitions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -563,7 +558,7 @@ public async Task GetMetricDefinitions_CosmosDBDatabaseAccountGetMetricDefinitio [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricsDatabases_CosmosDBDatabaseGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBDatabaseGetMetrics.json // this example is just showing the usage of "Database_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -595,7 +590,7 @@ public async Task GetMetricsDatabases_CosmosDBDatabaseGetMetrics() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetUsagesDatabases_CosmosDBDatabaseGetUsages() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseGetUsages.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBDatabaseGetUsages.json // this example is just showing the usage of "Database_ListUsages" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -627,7 +622,7 @@ public async Task GetUsagesDatabases_CosmosDBDatabaseGetUsages() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricDefinitionsDatabases_CosmosDBDatabaseGetMetricDefinitions() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseGetMetricDefinitions.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBDatabaseGetMetricDefinitions.json // this example is just showing the usage of "Database_ListMetricDefinitions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -658,7 +653,7 @@ public async Task GetMetricDefinitionsDatabases_CosmosDBDatabaseGetMetricDefinit [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricsCollections_CosmosDBCollectionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCollectionGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBCollectionGetMetrics.json // this example is just showing the usage of "Collection_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -691,7 +686,7 @@ public async Task GetMetricsCollections_CosmosDBCollectionGetMetrics() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetUsagesCollections_CosmosDBCollectionGetUsages() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCollectionGetUsages.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBCollectionGetUsages.json // this example is just showing the usage of "Collection_ListUsages" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -724,7 +719,7 @@ public async Task GetUsagesCollections_CosmosDBCollectionGetUsages() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricDefinitionsCollections_CosmosDBCollectionGetMetricDefinitions() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCollectionGetMetricDefinitions.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBCollectionGetMetricDefinitions.json // this example is just showing the usage of "Collection_ListMetricDefinitions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -756,7 +751,7 @@ public async Task GetMetricDefinitionsCollections_CosmosDBCollectionGetMetricDef [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricsCollectionRegions_CosmosDBRegionCollectionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBRegionCollectionGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBRegionCollectionGetMetrics.json // this example is just showing the usage of "CollectionRegion_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -790,7 +785,7 @@ public async Task GetMetricsCollectionRegions_CosmosDBRegionCollectionGetMetrics [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricsDatabaseAccountRegions_CosmosDBDatabaseAccountRegionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountRegionGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBDatabaseAccountRegionGetMetrics.json // this example is just showing the usage of "DatabaseAccountRegion_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -822,7 +817,7 @@ public async Task GetMetricsDatabaseAccountRegions_CosmosDBDatabaseAccountRegion [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricsPercentileSourceTargets_CosmosDBDatabaseAccountRegionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBPercentileSourceTargetGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBPercentileSourceTargetGetMetrics.json // this example is just showing the usage of "PercentileSourceTarget_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -855,7 +850,7 @@ public async Task GetMetricsPercentileSourceTargets_CosmosDBDatabaseAccountRegio [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricsPercentileTargets_CosmosDBDatabaseAccountRegionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBPercentileTargetGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBPercentileTargetGetMetrics.json // this example is just showing the usage of "PercentileTarget_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -887,7 +882,7 @@ public async Task GetMetricsPercentileTargets_CosmosDBDatabaseAccountRegionGetMe [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricsPercentiles_CosmosDBDatabaseAccountRegionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBPercentileGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBPercentileGetMetrics.json // this example is just showing the usage of "Percentile_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -918,7 +913,7 @@ public async Task GetMetricsPercentiles_CosmosDBDatabaseAccountRegionGetMetrics( [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricsCollectionPartitionRegions_CosmosDBDatabaseAccountRegionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCollectionPartitionRegionGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBCollectionPartitionRegionGetMetrics.json // this example is just showing the usage of "CollectionPartitionRegion_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -952,7 +947,7 @@ public async Task GetMetricsCollectionPartitionRegions_CosmosDBDatabaseAccountRe [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricsCollectionPartitions_CosmosDBDatabaseAccountRegionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCollectionPartitionGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBCollectionPartitionGetMetrics.json // this example is just showing the usage of "CollectionPartition_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -985,7 +980,7 @@ public async Task GetMetricsCollectionPartitions_CosmosDBDatabaseAccountRegionGe [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetUsagesCollectionPartitions_CosmosDBCollectionGetUsages() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCollectionPartitionGetUsages.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBCollectionPartitionGetUsages.json // this example is just showing the usage of "CollectionPartition_ListUsages" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1018,7 +1013,7 @@ public async Task GetUsagesCollectionPartitions_CosmosDBCollectionGetUsages() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricsPartitionKeyRangeIds_CosmosDBDatabaseAccountRegionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBPKeyRangeIdGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBPKeyRangeIdGetMetrics.json // this example is just showing the usage of "PartitionKeyRangeId_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1052,7 +1047,7 @@ public async Task GetMetricsPartitionKeyRangeIds_CosmosDBDatabaseAccountRegionGe [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricsPartitionKeyRangeIdRegions_CosmosDBDatabaseAccountRegionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBPKeyRangeIdRegionGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBPKeyRangeIdRegionGetMetrics.json // this example is just showing the usage of "PartitionKeyRangeIdRegion_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBLocationCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBLocationCollection.cs index a460a410eecd..6ad22367c231 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBLocationCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBLocationCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBLocationCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBLocationList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBLocationList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBLocationList.json // this example is just showing the usage of "Locations_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +55,7 @@ public async Task GetAll_CosmosDBLocationList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBLocationGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBLocationGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBLocationGet.json // this example is just showing the usage of "Locations_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -88,7 +88,7 @@ public async Task Get_CosmosDBLocationGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBLocationGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBLocationGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBLocationGet.json // this example is just showing the usage of "Locations_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -117,7 +117,7 @@ public async Task Exists_CosmosDBLocationGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBLocationGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBLocationGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBLocationGet.json // this example is just showing the usage of "Locations_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBLocationResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBLocationResource.cs index f53d344e5350..31243bcf76f5 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBLocationResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBLocationResource.cs @@ -19,7 +19,7 @@ public partial class Sample_CosmosDBLocationResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBLocationGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBLocationGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBLocationGet.json // this example is just showing the usage of "Locations_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateEndpointConnectionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateEndpointConnectionCollection.cs index e634ffcbe932..66c0282bf0f3 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateEndpointConnectionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateEndpointConnectionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBPrivateEndpointConnectionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBPrivateEndpointConnectionListGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBPrivateEndpointConnectionListGet.json // this example is just showing the usage of "PrivateEndpointConnections_ListByDatabaseAccount" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task GetAll_GetsPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBPrivateEndpointConnectionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBPrivateEndpointConnectionGet.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task Get_GetsPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBPrivateEndpointConnectionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBPrivateEndpointConnectionGet.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +123,7 @@ public async Task Exists_GetsPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBPrivateEndpointConnectionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBPrivateEndpointConnectionGet.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +166,7 @@ public async Task GetIfExists_GetsPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_ApproveOrRejectAPrivateEndpointConnectionWithAGivenName() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBPrivateEndpointConnectionUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBPrivateEndpointConnectionUpdate.json // this example is just showing the usage of "PrivateEndpointConnections_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateEndpointConnectionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateEndpointConnectionResource.cs index 268966eef58b..f8ea5f9ff22d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateEndpointConnectionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateEndpointConnectionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBPrivateEndpointConnectionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBPrivateEndpointConnectionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBPrivateEndpointConnectionGet.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_GetsPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_ApproveOrRejectAPrivateEndpointConnectionWithAGivenName() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBPrivateEndpointConnectionUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBPrivateEndpointConnectionUpdate.json // this example is just showing the usage of "PrivateEndpointConnections_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -93,7 +93,7 @@ public async Task Update_ApproveOrRejectAPrivateEndpointConnectionWithAGivenName [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeletesAPrivateEndpointConnectionWithAGivenName() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBPrivateEndpointConnectionDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBPrivateEndpointConnectionDelete.json // this example is just showing the usage of "PrivateEndpointConnections_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateLinkResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateLinkResource.cs index ac2df8555f2e..2c1858098e2e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateLinkResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateLinkResource.cs @@ -19,7 +19,7 @@ public partial class Sample_CosmosDBPrivateLinkResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBPrivateLinkResourceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBPrivateLinkResourceGet.json // this example is just showing the usage of "PrivateLinkResources_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateLinkResourceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateLinkResourceCollection.cs index fab685bff74f..97648fd49422 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateLinkResourceCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateLinkResourceCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_CosmosDBPrivateLinkResourceCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBPrivateLinkResourceListGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBPrivateLinkResourceListGet.json // this example is just showing the usage of "PrivateLinkResources_ListByDatabaseAccount" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -56,7 +56,7 @@ public async Task GetAll_GetsPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBPrivateLinkResourceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBPrivateLinkResourceGet.json // this example is just showing the usage of "PrivateLinkResources_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -91,7 +91,7 @@ public async Task Get_GetsPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBPrivateLinkResourceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBPrivateLinkResourceGet.json // this example is just showing the usage of "PrivateLinkResources_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -122,7 +122,7 @@ public async Task Exists_GetsPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBPrivateLinkResourceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBPrivateLinkResourceGet.json // this example is just showing the usage of "PrivateLinkResources_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBServiceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBServiceCollection.cs index 8608a74b625e..43a84768bffc 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBServiceCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBServiceCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBServiceCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBServicesList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBServicesList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBServicesList.json // this example is just showing the usage of "Service_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task GetAll_CosmosDBServicesList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_DataTransferServiceCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDataTransferServiceCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBDataTransferServiceCreate.json // this example is just showing the usage of "Service_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -101,7 +101,7 @@ public async Task CreateOrUpdate_DataTransferServiceCreate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_GraphAPIComputeServiceCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGraphAPIComputeServiceCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBGraphAPIComputeServiceCreate.json // this example is just showing the usage of "Service_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -145,7 +145,7 @@ public async Task CreateOrUpdate_GraphAPIComputeServiceCreate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_MaterializedViewsBuilderServiceCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMaterializedViewsBuilderServiceCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMaterializedViewsBuilderServiceCreate.json // this example is just showing the usage of "Service_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -189,7 +189,7 @@ public async Task CreateOrUpdate_MaterializedViewsBuilderServiceCreate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_SqlDedicatedGatewayServiceCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceCreate.json // this example is just showing the usage of "Service_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -234,7 +234,7 @@ public async Task CreateOrUpdate_SqlDedicatedGatewayServiceCreate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_DataTransferServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDataTransferServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBDataTransferServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -269,7 +269,7 @@ public async Task Get_DataTransferServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_DataTransferServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDataTransferServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBDataTransferServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -300,7 +300,7 @@ public async Task Exists_DataTransferServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_DataTransferServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDataTransferServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBDataTransferServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -343,7 +343,7 @@ public async Task GetIfExists_DataTransferServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GraphAPIComputeServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGraphAPIComputeServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBGraphAPIComputeServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -378,7 +378,7 @@ public async Task Get_GraphAPIComputeServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GraphAPIComputeServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGraphAPIComputeServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBGraphAPIComputeServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -409,7 +409,7 @@ public async Task Exists_GraphAPIComputeServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GraphAPIComputeServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGraphAPIComputeServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBGraphAPIComputeServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -452,7 +452,7 @@ public async Task GetIfExists_GraphAPIComputeServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_MaterializedViewsBuilderServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMaterializedViewsBuilderServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMaterializedViewsBuilderServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -487,7 +487,7 @@ public async Task Get_MaterializedViewsBuilderServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_MaterializedViewsBuilderServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMaterializedViewsBuilderServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMaterializedViewsBuilderServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -518,7 +518,7 @@ public async Task Exists_MaterializedViewsBuilderServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_MaterializedViewsBuilderServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMaterializedViewsBuilderServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMaterializedViewsBuilderServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -561,7 +561,7 @@ public async Task GetIfExists_MaterializedViewsBuilderServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_SqlDedicatedGatewayServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -596,7 +596,7 @@ public async Task Get_SqlDedicatedGatewayServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_SqlDedicatedGatewayServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -627,7 +627,7 @@ public async Task Exists_SqlDedicatedGatewayServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_SqlDedicatedGatewayServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBServiceResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBServiceResource.cs index c41fae0252bc..69c4e05d306b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBServiceResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBServiceResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBServiceResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_DataTransferServiceCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDataTransferServiceCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBDataTransferServiceCreate.json // this example is just showing the usage of "Service_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -61,7 +61,7 @@ public async Task Update_DataTransferServiceCreate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_GraphAPIComputeServiceCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGraphAPIComputeServiceCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBGraphAPIComputeServiceCreate.json // this example is just showing the usage of "Service_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -102,7 +102,7 @@ public async Task Update_GraphAPIComputeServiceCreate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_MaterializedViewsBuilderServiceCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMaterializedViewsBuilderServiceCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMaterializedViewsBuilderServiceCreate.json // this example is just showing the usage of "Service_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -143,7 +143,7 @@ public async Task Update_MaterializedViewsBuilderServiceCreate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_SqlDedicatedGatewayServiceCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceCreate.json // this example is just showing the usage of "Service_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -185,7 +185,7 @@ public async Task Update_SqlDedicatedGatewayServiceCreate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_DataTransferServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDataTransferServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBDataTransferServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -217,7 +217,7 @@ public async Task Get_DataTransferServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GraphAPIComputeServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGraphAPIComputeServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBGraphAPIComputeServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -249,7 +249,7 @@ public async Task Get_GraphAPIComputeServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_MaterializedViewsBuilderServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMaterializedViewsBuilderServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMaterializedViewsBuilderServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -281,7 +281,7 @@ public async Task Get_MaterializedViewsBuilderServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_SqlDedicatedGatewayServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -313,7 +313,7 @@ public async Task Get_SqlDedicatedGatewayServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DataTransferServiceDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDataTransferServiceDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBDataTransferServiceDelete.json // this example is just showing the usage of "Service_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -341,7 +341,7 @@ public async Task Delete_DataTransferServiceDelete() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_GraphAPIComputeServiceDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGraphAPIComputeServiceDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBGraphAPIComputeServiceDelete.json // this example is just showing the usage of "Service_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -369,7 +369,7 @@ public async Task Delete_GraphAPIComputeServiceDelete() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_MaterializedViewsBuilderServiceDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMaterializedViewsBuilderServiceDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMaterializedViewsBuilderServiceDelete.json // this example is just showing the usage of "Service_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -397,7 +397,7 @@ public async Task Delete_MaterializedViewsBuilderServiceDelete() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_SqlDedicatedGatewayServiceDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceDelete.json // this example is just showing the usage of "Service_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlClientEncryptionKeyCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlClientEncryptionKeyCollection.cs index 21efad21f4bd..ac1deb9b3985 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlClientEncryptionKeyCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlClientEncryptionKeyCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlClientEncryptionKeyCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBClientEncryptionKeysList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlClientEncryptionKeysList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlClientEncryptionKeysList.json // this example is just showing the usage of "SqlResources_ListClientEncryptionKeys" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -58,7 +58,7 @@ public async Task GetAll_CosmosDBClientEncryptionKeysList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBClientEncryptionKeyGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlClientEncryptionKeyGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlClientEncryptionKeyGet.json // this example is just showing the usage of "SqlResources_GetClientEncryptionKey" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task Get_CosmosDBClientEncryptionKeyGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBClientEncryptionKeyGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlClientEncryptionKeyGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlClientEncryptionKeyGet.json // this example is just showing the usage of "SqlResources_GetClientEncryptionKey" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -126,7 +126,7 @@ public async Task Exists_CosmosDBClientEncryptionKeyGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBClientEncryptionKeyGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlClientEncryptionKeyGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlClientEncryptionKeyGet.json // this example is just showing the usage of "SqlResources_GetClientEncryptionKey" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -170,7 +170,7 @@ public async Task GetIfExists_CosmosDBClientEncryptionKeyGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBClientEncryptionKeyCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlClientEncryptionKeyCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlClientEncryptionKeyCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateClientEncryptionKey" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -196,7 +196,7 @@ public async Task CreateOrUpdate_CosmosDBClientEncryptionKeyCreateUpdate() { Id = "cekName", EncryptionAlgorithm = "AEAD_AES_256_CBC_HMAC_SHA256", - WrappedDataEncryptionKey = Convert.FromBase64String("VGhpcyBpcyBhY3R1YWxseSBhbiBhcnJheSBvZiBieXRlcy4gVGhpcyByZXF1ZXN0L3Jlc3BvbnNlIGlzIGJlaW5nIHByZXNlbnRlZCBhcyBhIHN0cmluZyBmb3IgcmVhZGFiaWxpdHkgaW4gdGhlIGV4YW1wbGU="), + WrappedDataEncryptionKey = Convert.FromBase64String("U3dhZ2dlciByb2Nrcw=="), KeyWrapMetadata = new CosmosDBKeyWrapMetadata() { Name = "customerManagedKey", diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlClientEncryptionKeyResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlClientEncryptionKeyResource.cs index bf41ec5651cc..0afc338a3223 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlClientEncryptionKeyResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlClientEncryptionKeyResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlClientEncryptionKeyResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBClientEncryptionKeyGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlClientEncryptionKeyGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlClientEncryptionKeyGet.json // this example is just showing the usage of "SqlResources_GetClientEncryptionKey" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_CosmosDBClientEncryptionKeyGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBClientEncryptionKeyCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlClientEncryptionKeyCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlClientEncryptionKeyCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateClientEncryptionKey" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -76,7 +76,7 @@ public async Task Update_CosmosDBClientEncryptionKeyCreateUpdate() { Id = "cekName", EncryptionAlgorithm = "AEAD_AES_256_CBC_HMAC_SHA256", - WrappedDataEncryptionKey = Convert.FromBase64String("VGhpcyBpcyBhY3R1YWxseSBhbiBhcnJheSBvZiBieXRlcy4gVGhpcyByZXF1ZXN0L3Jlc3BvbnNlIGlzIGJlaW5nIHByZXNlbnRlZCBhcyBhIHN0cmluZyBmb3IgcmVhZGFiaWxpdHkgaW4gdGhlIGV4YW1wbGU="), + WrappedDataEncryptionKey = Convert.FromBase64String("U3dhZ2dlciByb2Nrcw=="), KeyWrapMetadata = new CosmosDBKeyWrapMetadata() { Name = "customerManagedKey", diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerCollection.cs index e68d67db3981..3f423152bd37 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlContainerCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBSqlContainerList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlContainerList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlContainerList.json // this example is just showing the usage of "SqlResources_ListSqlContainers" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -58,7 +58,7 @@ public async Task GetAll_CosmosDBSqlContainerList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlContainerGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlContainerGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlContainerGet.json // this example is just showing the usage of "SqlResources_GetSqlContainer" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task Get_CosmosDBSqlContainerGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBSqlContainerGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlContainerGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlContainerGet.json // this example is just showing the usage of "SqlResources_GetSqlContainer" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -126,7 +126,7 @@ public async Task Exists_CosmosDBSqlContainerGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBSqlContainerGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlContainerGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlContainerGet.json // this example is just showing the usage of "SqlResources_GetSqlContainer" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -170,7 +170,7 @@ public async Task GetIfExists_CosmosDBSqlContainerGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBSqlContainerCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlContainerCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlContainerCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlContainer" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -275,142 +275,5 @@ public async Task CreateOrUpdate_CosmosDBSqlContainerCreateUpdate() // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - - // CosmosDBSqlContainerRestore - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CosmosDBSqlContainerRestore() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlContainerRestore.json - // this example is just showing the usage of "SqlResources_CreateUpdateSqlContainer" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBSqlDatabaseResource created on azure - // for more information of creating CosmosDBSqlDatabaseResource, please refer to the document of CosmosDBSqlDatabaseResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - ResourceIdentifier cosmosDBSqlDatabaseResourceId = CosmosDBSqlDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName); - CosmosDBSqlDatabaseResource cosmosDBSqlDatabase = client.GetCosmosDBSqlDatabaseResource(cosmosDBSqlDatabaseResourceId); - - // get the collection of this CosmosDBSqlContainerResource - CosmosDBSqlContainerCollection collection = cosmosDBSqlDatabase.GetCosmosDBSqlContainers(); - - // invoke the operation - string containerName = "containerName"; - CosmosDBSqlContainerCreateOrUpdateContent content = new CosmosDBSqlContainerCreateOrUpdateContent(new AzureLocation("West US"), new CosmosDBSqlContainerResourceInfo("containerName") - { - RestoreParameters = new ResourceRestoreParameters() - { - RestoreSource = "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId", - RestoreTimestampInUtc = DateTimeOffset.Parse("2022-07-20T18:28:00Z"), - IsRestoreWithTtlDisabled = true, - }, - CreateMode = CosmosDBAccountCreateMode.Restore, - }) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = -{ -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, containerName, content); - CosmosDBSqlContainerResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBSqlContainerData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBSqlMaterializedViewCreateUpdate - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CosmosDBSqlMaterializedViewCreateUpdate() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlMaterializedViewCreateUpdate.json - // this example is just showing the usage of "SqlResources_CreateUpdateSqlContainer" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBSqlDatabaseResource created on azure - // for more information of creating CosmosDBSqlDatabaseResource, please refer to the document of CosmosDBSqlDatabaseResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - ResourceIdentifier cosmosDBSqlDatabaseResourceId = CosmosDBSqlDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName); - CosmosDBSqlDatabaseResource cosmosDBSqlDatabase = client.GetCosmosDBSqlDatabaseResource(cosmosDBSqlDatabaseResourceId); - - // get the collection of this CosmosDBSqlContainerResource - CosmosDBSqlContainerCollection collection = cosmosDBSqlDatabase.GetCosmosDBSqlContainers(); - - // invoke the operation - string containerName = "mvContainerName"; - CosmosDBSqlContainerCreateOrUpdateContent content = new CosmosDBSqlContainerCreateOrUpdateContent(new AzureLocation("West US"), new CosmosDBSqlContainerResourceInfo("mvContainerName") - { - IndexingPolicy = new CosmosDBIndexingPolicy() - { - IsAutomatic = true, - IndexingMode = CosmosDBIndexingMode.Consistent, - IncludedPaths = -{ -new CosmosDBIncludedPath() -{ -Path = "/*", -Indexes = -{ -new CosmosDBPathIndexes() -{ -DataType = CosmosDBDataType.String, -Precision = -1, -Kind = CosmosDBIndexKind.Range, -},new CosmosDBPathIndexes() -{ -DataType = CosmosDBDataType.Number, -Precision = -1, -Kind = CosmosDBIndexKind.Range, -} -}, -} -}, - ExcludedPaths = -{ -}, - }, - PartitionKey = new CosmosDBContainerPartitionKey() - { - Paths = -{ -"/mvpk" -}, - Kind = CosmosDBPartitionKind.Hash, - }, - MaterializedViewDefinition = new MaterializedViewDefinition("sourceContainerName", "select * from ROOT"), - }) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = -{ -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, containerName, content); - CosmosDBSqlContainerResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBSqlContainerData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerResource.cs index 60a45c1c1422..0f95d3f5649d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlContainerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlContainerGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlContainerGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlContainerGet.json // this example is just showing the usage of "SqlResources_GetSqlContainer" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_CosmosDBSqlContainerGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBSqlContainerCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlContainerCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlContainerCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlContainer" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -156,143 +156,12 @@ public async Task Update_CosmosDBSqlContainerCreateUpdate() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - // CosmosDBSqlContainerRestore - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CosmosDBSqlContainerRestore() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlContainerRestore.json - // this example is just showing the usage of "SqlResources_CreateUpdateSqlContainer" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBSqlContainerResource created on azure - // for more information of creating CosmosDBSqlContainerResource, please refer to the document of CosmosDBSqlContainerResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - string containerName = "containerName"; - ResourceIdentifier cosmosDBSqlContainerResourceId = CosmosDBSqlContainerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName, containerName); - CosmosDBSqlContainerResource cosmosDBSqlContainer = client.GetCosmosDBSqlContainerResource(cosmosDBSqlContainerResourceId); - - // invoke the operation - CosmosDBSqlContainerCreateOrUpdateContent content = new CosmosDBSqlContainerCreateOrUpdateContent(new AzureLocation("West US"), new CosmosDBSqlContainerResourceInfo("containerName") - { - RestoreParameters = new ResourceRestoreParameters() - { - RestoreSource = "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId", - RestoreTimestampInUtc = DateTimeOffset.Parse("2022-07-20T18:28:00Z"), - IsRestoreWithTtlDisabled = true, - }, - CreateMode = CosmosDBAccountCreateMode.Restore, - }) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = -{ -}, - }; - ArmOperation lro = await cosmosDBSqlContainer.UpdateAsync(WaitUntil.Completed, content); - CosmosDBSqlContainerResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBSqlContainerData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBSqlMaterializedViewCreateUpdate - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CosmosDBSqlMaterializedViewCreateUpdate() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlMaterializedViewCreateUpdate.json - // this example is just showing the usage of "SqlResources_CreateUpdateSqlContainer" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBSqlContainerResource created on azure - // for more information of creating CosmosDBSqlContainerResource, please refer to the document of CosmosDBSqlContainerResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - string containerName = "mvContainerName"; - ResourceIdentifier cosmosDBSqlContainerResourceId = CosmosDBSqlContainerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName, containerName); - CosmosDBSqlContainerResource cosmosDBSqlContainer = client.GetCosmosDBSqlContainerResource(cosmosDBSqlContainerResourceId); - - // invoke the operation - CosmosDBSqlContainerCreateOrUpdateContent content = new CosmosDBSqlContainerCreateOrUpdateContent(new AzureLocation("West US"), new CosmosDBSqlContainerResourceInfo("mvContainerName") - { - IndexingPolicy = new CosmosDBIndexingPolicy() - { - IsAutomatic = true, - IndexingMode = CosmosDBIndexingMode.Consistent, - IncludedPaths = -{ -new CosmosDBIncludedPath() -{ -Path = "/*", -Indexes = -{ -new CosmosDBPathIndexes() -{ -DataType = CosmosDBDataType.String, -Precision = -1, -Kind = CosmosDBIndexKind.Range, -},new CosmosDBPathIndexes() -{ -DataType = CosmosDBDataType.Number, -Precision = -1, -Kind = CosmosDBIndexKind.Range, -} -}, -} -}, - ExcludedPaths = -{ -}, - }, - PartitionKey = new CosmosDBContainerPartitionKey() - { - Paths = -{ -"/mvpk" -}, - Kind = CosmosDBPartitionKind.Hash, - }, - MaterializedViewDefinition = new MaterializedViewDefinition("sourceContainerName", "select * from ROOT"), - }) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = -{ -}, - }; - ArmOperation lro = await cosmosDBSqlContainer.UpdateAsync(WaitUntil.Completed, content); - CosmosDBSqlContainerResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBSqlContainerData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - // CosmosDBSqlContainerDelete [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBSqlContainerDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlContainerDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlContainerDelete.json // this example is just showing the usage of "SqlResources_DeleteSqlContainer" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -316,46 +185,12 @@ public async Task Delete_CosmosDBSqlContainerDelete() Console.WriteLine($"Succeeded"); } - // CosmosDBSqlContainerPartitionMerge - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetSqlContainerPartitionMerge_CosmosDBSqlContainerPartitionMerge() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlContainerPartitionMerge.json - // this example is just showing the usage of "SqlResources_ListSqlContainerPartitionMerge" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBSqlContainerResource created on azure - // for more information of creating CosmosDBSqlContainerResource, please refer to the document of CosmosDBSqlContainerResource - string subscriptionId = "subid"; - string resourceGroupName = "rgName"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - string containerName = "containerName"; - ResourceIdentifier cosmosDBSqlContainerResourceId = CosmosDBSqlContainerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName, containerName); - CosmosDBSqlContainerResource cosmosDBSqlContainer = client.GetCosmosDBSqlContainerResource(cosmosDBSqlContainerResourceId); - - // invoke the operation - MergeParameters mergeParameters = new MergeParameters() - { - IsDryRun = false, - }; - ArmOperation lro = await cosmosDBSqlContainer.GetSqlContainerPartitionMergeAsync(WaitUntil.Completed, mergeParameters); - PhysicalPartitionStorageInfoCollection result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } - // CosmosDBSqlContainerBackupInformation [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task RetrieveContinuousBackupInformation_CosmosDBSqlContainerBackupInformation() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlContainerBackupInformation.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlContainerBackupInformation.json // this example is just showing the usage of "SqlResources_RetrieveContinuousBackupInformation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerThroughputSettingResource.cs index 5e4592fe8e49..a625a36bea92 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerThroughputSettingResource.cs @@ -10,7 +10,6 @@ using Azure.Core; using Azure.Identity; using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.CosmosDB.Samples { @@ -21,7 +20,7 @@ public partial class Sample_CosmosDBSqlContainerThroughputSettingResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlContainerThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlContainerThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlContainerThroughputGet.json // this example is just showing the usage of "SqlResources_GetSqlContainerThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -54,7 +53,7 @@ public async Task Get_CosmosDBSqlContainerThroughputGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBSqlContainerThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlContainerThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlContainerThroughputUpdate.json // this example is just showing the usage of "SqlResources_UpdateSqlContainerThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -97,7 +96,7 @@ public async Task CreateOrUpdate_CosmosDBSqlContainerThroughputUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateSqlContainerToAutoscale_CosmosDBSqlContainerMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlContainerMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlContainerMigrateToAutoscale.json // this example is just showing the usage of "SqlResources_MigrateSqlContainerToAutoscale" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -131,7 +130,7 @@ public async Task MigrateSqlContainerToAutoscale_CosmosDBSqlContainerMigrateToAu [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateSqlContainerToManualThroughput_CosmosDBSqlContainerMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlContainerMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlContainerMigrateToManualThroughput.json // this example is just showing the usage of "SqlResources_MigrateSqlContainerToManualThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -159,91 +158,5 @@ public async Task MigrateSqlContainerToManualThroughput_CosmosDBSqlContainerMigr // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - - // CosmosDBSqlContainerRetrieveThroughputDistribution - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task SqlContainerRetrieveThroughputDistribution_CosmosDBSqlContainerRetrieveThroughputDistribution() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlContainerRetrieveThroughputDistribution.json - // this example is just showing the usage of "SqlResources_SqlContainerRetrieveThroughputDistribution" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBSqlContainerThroughputSettingResource created on azure - // for more information of creating CosmosDBSqlContainerThroughputSettingResource, please refer to the document of CosmosDBSqlContainerThroughputSettingResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - string containerName = "containerName"; - ResourceIdentifier cosmosDBSqlContainerThroughputSettingResourceId = CosmosDBSqlContainerThroughputSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName, containerName); - CosmosDBSqlContainerThroughputSettingResource cosmosDBSqlContainerThroughputSetting = client.GetCosmosDBSqlContainerThroughputSettingResource(cosmosDBSqlContainerThroughputSettingResourceId); - - // invoke the operation - RetrieveThroughputParameters retrieveThroughputParameters = new RetrieveThroughputParameters(new AzureLocation("placeholder"), new RetrieveThroughputPropertiesResource(new WritableSubResource[] - { -new WritableSubResource() -{ -Id = new ResourceIdentifier("0"), -},new WritableSubResource() -{ -Id = new ResourceIdentifier("1"), -} - })); - ArmOperation lro = await cosmosDBSqlContainerThroughputSetting.SqlContainerRetrieveThroughputDistributionAsync(WaitUntil.Completed, retrieveThroughputParameters); - PhysicalPartitionThroughputInfoResult result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } - - // CosmosDBSqlContainerRedistributeThroughput - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task SqlContainerRedistributeThroughput_CosmosDBSqlContainerRedistributeThroughput() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlContainerRedistributeThroughput.json - // this example is just showing the usage of "SqlResources_SqlContainerRedistributeThroughput" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBSqlContainerThroughputSettingResource created on azure - // for more information of creating CosmosDBSqlContainerThroughputSettingResource, please refer to the document of CosmosDBSqlContainerThroughputSettingResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - string containerName = "containerName"; - ResourceIdentifier cosmosDBSqlContainerThroughputSettingResourceId = CosmosDBSqlContainerThroughputSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName, containerName); - CosmosDBSqlContainerThroughputSettingResource cosmosDBSqlContainerThroughputSetting = client.GetCosmosDBSqlContainerThroughputSettingResource(cosmosDBSqlContainerThroughputSettingResourceId); - - // invoke the operation - RedistributeThroughputParameters redistributeThroughputParameters = new RedistributeThroughputParameters(new AzureLocation("placeholder"), new RedistributeThroughputPropertiesResource(ThroughputPolicyType.Custom, new PhysicalPartitionThroughputInfoResource[] - { -new PhysicalPartitionThroughputInfoResource("0") -{ -Throughput = 5000, -},new PhysicalPartitionThroughputInfoResource("1") -{ -Throughput = 5000, -} - }, new PhysicalPartitionThroughputInfoResource[] - { -new PhysicalPartitionThroughputInfoResource("2") -{ -Throughput = 5000, -},new PhysicalPartitionThroughputInfoResource("3") - })); - ArmOperation lro = await cosmosDBSqlContainerThroughputSetting.SqlContainerRedistributeThroughputAsync(WaitUntil.Completed, redistributeThroughputParameters); - PhysicalPartitionThroughputInfoResult result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseCollection.cs index 3020efbbef40..7c52116b41c9 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlDatabaseCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBSqlDatabaseList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlDatabaseList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlDatabaseList.json // this example is just showing the usage of "SqlResources_ListSqlDatabases" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task GetAll_CosmosDBSqlDatabaseList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlDatabaseGet.json // this example is just showing the usage of "SqlResources_GetSqlDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task Get_CosmosDBSqlDatabaseGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBSqlDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlDatabaseGet.json // this example is just showing the usage of "SqlResources_GetSqlDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +123,7 @@ public async Task Exists_CosmosDBSqlDatabaseGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBSqlDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlDatabaseGet.json // this example is just showing the usage of "SqlResources_GetSqlDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +166,7 @@ public async Task GetIfExists_CosmosDBSqlDatabaseGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBSqlDatabaseCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlDatabaseCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlDatabaseCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -203,57 +203,5 @@ public async Task CreateOrUpdate_CosmosDBSqlDatabaseCreateUpdate() // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - - // CosmosDBSqlDatabaseRestore - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CosmosDBSqlDatabaseRestore() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlDatabaseRestore.json - // this example is just showing the usage of "SqlResources_CreateUpdateSqlDatabase" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBAccountResource created on azure - // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this CosmosDBSqlDatabaseResource - CosmosDBSqlDatabaseCollection collection = cosmosDBAccount.GetCosmosDBSqlDatabases(); - - // invoke the operation - string databaseName = "databaseName"; - CosmosDBSqlDatabaseCreateOrUpdateContent content = new CosmosDBSqlDatabaseCreateOrUpdateContent(new AzureLocation("West US"), new CosmosDBSqlDatabaseResourceInfo("databaseName") - { - RestoreParameters = new ResourceRestoreParameters() - { - RestoreSource = "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId", - RestoreTimestampInUtc = DateTimeOffset.Parse("2022-07-20T18:28:00Z"), - IsRestoreWithTtlDisabled = true, - }, - CreateMode = CosmosDBAccountCreateMode.Restore, - }) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = -{ -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, databaseName, content); - CosmosDBSqlDatabaseResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBSqlDatabaseData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseResource.cs index 266216a4e0b9..86d20611c27c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlDatabaseResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlDatabaseGet.json // this example is just showing the usage of "SqlResources_GetSqlDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBSqlDatabaseGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBSqlDatabaseCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlDatabaseCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlDatabaseCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -87,61 +87,12 @@ public async Task Update_CosmosDBSqlDatabaseCreateUpdate() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - // CosmosDBSqlDatabaseRestore - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CosmosDBSqlDatabaseRestore() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlDatabaseRestore.json - // this example is just showing the usage of "SqlResources_CreateUpdateSqlDatabase" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBSqlDatabaseResource created on azure - // for more information of creating CosmosDBSqlDatabaseResource, please refer to the document of CosmosDBSqlDatabaseResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - ResourceIdentifier cosmosDBSqlDatabaseResourceId = CosmosDBSqlDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName); - CosmosDBSqlDatabaseResource cosmosDBSqlDatabase = client.GetCosmosDBSqlDatabaseResource(cosmosDBSqlDatabaseResourceId); - - // invoke the operation - CosmosDBSqlDatabaseCreateOrUpdateContent content = new CosmosDBSqlDatabaseCreateOrUpdateContent(new AzureLocation("West US"), new CosmosDBSqlDatabaseResourceInfo("databaseName") - { - RestoreParameters = new ResourceRestoreParameters() - { - RestoreSource = "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId", - RestoreTimestampInUtc = DateTimeOffset.Parse("2022-07-20T18:28:00Z"), - IsRestoreWithTtlDisabled = true, - }, - CreateMode = CosmosDBAccountCreateMode.Restore, - }) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = -{ -}, - }; - ArmOperation lro = await cosmosDBSqlDatabase.UpdateAsync(WaitUntil.Completed, content); - CosmosDBSqlDatabaseResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBSqlDatabaseData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - // CosmosDBSqlDatabaseDelete [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBSqlDatabaseDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlDatabaseDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlDatabaseDelete.json // this example is just showing the usage of "SqlResources_DeleteSqlDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -163,38 +114,5 @@ public async Task Delete_CosmosDBSqlDatabaseDelete() Console.WriteLine($"Succeeded"); } - - // CosmosDBSqlDatabasePartitionMerge - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task SqlDatabasePartitionMerge_CosmosDBSqlDatabasePartitionMerge() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlDatabasePartitionMerge.json - // this example is just showing the usage of "SqlResources_SqlDatabasePartitionMerge" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBSqlDatabaseResource created on azure - // for more information of creating CosmosDBSqlDatabaseResource, please refer to the document of CosmosDBSqlDatabaseResource - string subscriptionId = "subid"; - string resourceGroupName = "rgName"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - ResourceIdentifier cosmosDBSqlDatabaseResourceId = CosmosDBSqlDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName); - CosmosDBSqlDatabaseResource cosmosDBSqlDatabase = client.GetCosmosDBSqlDatabaseResource(cosmosDBSqlDatabaseResourceId); - - // invoke the operation - MergeParameters mergeParameters = new MergeParameters() - { - IsDryRun = false, - }; - ArmOperation lro = await cosmosDBSqlDatabase.SqlDatabasePartitionMergeAsync(WaitUntil.Completed, mergeParameters); - PhysicalPartitionStorageInfoCollection result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseThroughputSettingResource.cs index 9c0372ea7c5c..e41aeebdf5b3 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseThroughputSettingResource.cs @@ -10,7 +10,6 @@ using Azure.Core; using Azure.Identity; using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.CosmosDB.Samples { @@ -21,7 +20,7 @@ public partial class Sample_CosmosDBSqlDatabaseThroughputSettingResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlDatabaseThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlDatabaseThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlDatabaseThroughputGet.json // this example is just showing the usage of "SqlResources_GetSqlDatabaseThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +52,7 @@ public async Task Get_CosmosDBSqlDatabaseThroughputGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBSqlDatabaseThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlDatabaseThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlDatabaseThroughputUpdate.json // this example is just showing the usage of "SqlResources_UpdateSqlDatabaseThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -95,7 +94,7 @@ public async Task CreateOrUpdate_CosmosDBSqlDatabaseThroughputUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateSqlDatabaseToAutoscale_CosmosDBSqlDatabaseMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlDatabaseMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlDatabaseMigrateToAutoscale.json // this example is just showing the usage of "SqlResources_MigrateSqlDatabaseToAutoscale" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -128,7 +127,7 @@ public async Task MigrateSqlDatabaseToAutoscale_CosmosDBSqlDatabaseMigrateToAuto [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateSqlDatabaseToManualThroughput_CosmosDBSqlDatabaseMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlDatabaseMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlDatabaseMigrateToManualThroughput.json // this example is just showing the usage of "SqlResources_MigrateSqlDatabaseToManualThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -155,89 +154,5 @@ public async Task MigrateSqlDatabaseToManualThroughput_CosmosDBSqlDatabaseMigrat // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - - // CosmosDBSqlDatabaseRetrieveThroughputDistribution - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task SqlDatabaseRetrieveThroughputDistribution_CosmosDBSqlDatabaseRetrieveThroughputDistribution() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlDatabaseRetrieveThroughputDistribution.json - // this example is just showing the usage of "SqlResources_SqlDatabaseRetrieveThroughputDistribution" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBSqlDatabaseThroughputSettingResource created on azure - // for more information of creating CosmosDBSqlDatabaseThroughputSettingResource, please refer to the document of CosmosDBSqlDatabaseThroughputSettingResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - ResourceIdentifier cosmosDBSqlDatabaseThroughputSettingResourceId = CosmosDBSqlDatabaseThroughputSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName); - CosmosDBSqlDatabaseThroughputSettingResource cosmosDBSqlDatabaseThroughputSetting = client.GetCosmosDBSqlDatabaseThroughputSettingResource(cosmosDBSqlDatabaseThroughputSettingResourceId); - - // invoke the operation - RetrieveThroughputParameters retrieveThroughputParameters = new RetrieveThroughputParameters(new AzureLocation("placeholder"), new RetrieveThroughputPropertiesResource(new WritableSubResource[] - { -new WritableSubResource() -{ -Id = new ResourceIdentifier("0"), -},new WritableSubResource() -{ -Id = new ResourceIdentifier("1"), -} - })); - ArmOperation lro = await cosmosDBSqlDatabaseThroughputSetting.SqlDatabaseRetrieveThroughputDistributionAsync(WaitUntil.Completed, retrieveThroughputParameters); - PhysicalPartitionThroughputInfoResult result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } - - // CosmosDBSqlDatabaseRedistributeThroughput - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task SqlDatabaseRedistributeThroughput_CosmosDBSqlDatabaseRedistributeThroughput() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlDatabaseRedistributeThroughput.json - // this example is just showing the usage of "SqlResources_SqlDatabaseRedistributeThroughput" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBSqlDatabaseThroughputSettingResource created on azure - // for more information of creating CosmosDBSqlDatabaseThroughputSettingResource, please refer to the document of CosmosDBSqlDatabaseThroughputSettingResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - ResourceIdentifier cosmosDBSqlDatabaseThroughputSettingResourceId = CosmosDBSqlDatabaseThroughputSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName); - CosmosDBSqlDatabaseThroughputSettingResource cosmosDBSqlDatabaseThroughputSetting = client.GetCosmosDBSqlDatabaseThroughputSettingResource(cosmosDBSqlDatabaseThroughputSettingResourceId); - - // invoke the operation - RedistributeThroughputParameters redistributeThroughputParameters = new RedistributeThroughputParameters(new AzureLocation("placeholder"), new RedistributeThroughputPropertiesResource(ThroughputPolicyType.Custom, new PhysicalPartitionThroughputInfoResource[] - { -new PhysicalPartitionThroughputInfoResource("0") -{ -Throughput = 5000, -},new PhysicalPartitionThroughputInfoResource("1") -{ -Throughput = 5000, -} - }, new PhysicalPartitionThroughputInfoResource[] - { -new PhysicalPartitionThroughputInfoResource("2") -{ -Throughput = 5000, -},new PhysicalPartitionThroughputInfoResource("3") - })); - ArmOperation lro = await cosmosDBSqlDatabaseThroughputSetting.SqlDatabaseRedistributeThroughputAsync(WaitUntil.Completed, redistributeThroughputParameters); - PhysicalPartitionThroughputInfoResult result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleAssignmentCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleAssignmentCollection.cs index a39f7f741c1f..0690af50ca3d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleAssignmentCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleAssignmentCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlRoleAssignmentCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlRoleAssignmentGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlRoleAssignmentGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlRoleAssignmentGet.json // this example is just showing the usage of "SqlResources_GetSqlRoleAssignment" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +55,7 @@ public async Task Get_CosmosDBSqlRoleAssignmentGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBSqlRoleAssignmentGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlRoleAssignmentGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlRoleAssignmentGet.json // this example is just showing the usage of "SqlResources_GetSqlRoleAssignment" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +86,7 @@ public async Task Exists_CosmosDBSqlRoleAssignmentGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBSqlRoleAssignmentGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlRoleAssignmentGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlRoleAssignmentGet.json // this example is just showing the usage of "SqlResources_GetSqlRoleAssignment" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -129,7 +129,7 @@ public async Task GetIfExists_CosmosDBSqlRoleAssignmentGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBSqlRoleAssignmentCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlRoleAssignmentCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlRoleAssignmentCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlRoleAssignment" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -171,7 +171,7 @@ public async Task CreateOrUpdate_CosmosDBSqlRoleAssignmentCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBSqlRoleAssignmentList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlRoleAssignmentList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlRoleAssignmentList.json // this example is just showing the usage of "SqlResources_ListSqlRoleAssignments" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleAssignmentResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleAssignmentResource.cs index e8579f522da0..aaf539a57dc0 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleAssignmentResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleAssignmentResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlRoleAssignmentResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlRoleAssignmentGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlRoleAssignmentGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlRoleAssignmentGet.json // this example is just showing the usage of "SqlResources_GetSqlRoleAssignment" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBSqlRoleAssignmentGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBSqlRoleAssignmentCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlRoleAssignmentCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlRoleAssignmentCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlRoleAssignment" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -91,7 +91,7 @@ public async Task Update_CosmosDBSqlRoleAssignmentCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBSqlRoleAssignmentDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlRoleAssignmentDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlRoleAssignmentDelete.json // this example is just showing the usage of "SqlResources_DeleteSqlRoleAssignment" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleDefinitionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleDefinitionCollection.cs index ace41de6ceb2..7d85d40a92dd 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleDefinitionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleDefinitionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlRoleDefinitionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlRoleDefinitionGet.json // this example is just showing the usage of "SqlResources_GetSqlRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +55,7 @@ public async Task Get_CosmosDBSqlRoleDefinitionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBSqlRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlRoleDefinitionGet.json // this example is just showing the usage of "SqlResources_GetSqlRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +86,7 @@ public async Task Exists_CosmosDBSqlRoleDefinitionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBSqlRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlRoleDefinitionGet.json // this example is just showing the usage of "SqlResources_GetSqlRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -129,7 +129,7 @@ public async Task GetIfExists_CosmosDBSqlRoleDefinitionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBSqlRoleDefinitionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlRoleDefinitionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlRoleDefinitionCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -187,7 +187,7 @@ public async Task CreateOrUpdate_CosmosDBSqlRoleDefinitionCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBSqlRoleDefinitionList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlRoleDefinitionList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlRoleDefinitionList.json // this example is just showing the usage of "SqlResources_ListSqlRoleDefinitions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleDefinitionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleDefinitionResource.cs index fcc5d2b88afc..8c59461c139f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleDefinitionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleDefinitionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlRoleDefinitionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlRoleDefinitionGet.json // this example is just showing the usage of "SqlResources_GetSqlRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBSqlRoleDefinitionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBSqlRoleDefinitionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlRoleDefinitionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlRoleDefinitionCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -107,7 +107,7 @@ public async Task Update_CosmosDBSqlRoleDefinitionCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBSqlRoleDefinitionDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlRoleDefinitionDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlRoleDefinitionDelete.json // this example is just showing the usage of "SqlResources_DeleteSqlRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlStoredProcedureCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlStoredProcedureCollection.cs index 46805cc4da33..851e4dbd47fa 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlStoredProcedureCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlStoredProcedureCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlStoredProcedureCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBSqlStoredProcedureList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlStoredProcedureList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlStoredProcedureList.json // this example is just showing the usage of "SqlResources_ListSqlStoredProcedures" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +59,7 @@ public async Task GetAll_CosmosDBSqlStoredProcedureList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlStoredProcedureGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlStoredProcedureGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlStoredProcedureGet.json // this example is just showing the usage of "SqlResources_GetSqlStoredProcedure" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -96,7 +96,7 @@ public async Task Get_CosmosDBSqlStoredProcedureGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBSqlStoredProcedureGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlStoredProcedureGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlStoredProcedureGet.json // this example is just showing the usage of "SqlResources_GetSqlStoredProcedure" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -129,7 +129,7 @@ public async Task Exists_CosmosDBSqlStoredProcedureGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBSqlStoredProcedureGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlStoredProcedureGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlStoredProcedureGet.json // this example is just showing the usage of "SqlResources_GetSqlStoredProcedure" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -174,7 +174,7 @@ public async Task GetIfExists_CosmosDBSqlStoredProcedureGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBSqlStoredProcedureCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlStoredProcedureCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlStoredProcedureCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlStoredProcedure" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlStoredProcedureResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlStoredProcedureResource.cs index 4f61a0dc609e..523667fe95fe 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlStoredProcedureResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlStoredProcedureResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlStoredProcedureResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlStoredProcedureGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlStoredProcedureGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlStoredProcedureGet.json // this example is just showing the usage of "SqlResources_GetSqlStoredProcedure" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -54,7 +54,7 @@ public async Task Get_CosmosDBSqlStoredProcedureGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBSqlStoredProcedureCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlStoredProcedureCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlStoredProcedureCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlStoredProcedure" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -96,7 +96,7 @@ public async Task Update_CosmosDBSqlStoredProcedureCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBSqlStoredProcedureDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlStoredProcedureDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlStoredProcedureDelete.json // this example is just showing the usage of "SqlResources_DeleteSqlStoredProcedure" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlTriggerCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlTriggerCollection.cs index fb91cda7ffa2..e3210df10272 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlTriggerCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlTriggerCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlTriggerCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBSqlTriggerList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlTriggerList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlTriggerList.json // this example is just showing the usage of "SqlResources_ListSqlTriggers" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +59,7 @@ public async Task GetAll_CosmosDBSqlTriggerList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlTriggerGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlTriggerGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlTriggerGet.json // this example is just showing the usage of "SqlResources_GetSqlTrigger" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -96,7 +96,7 @@ public async Task Get_CosmosDBSqlTriggerGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBSqlTriggerGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlTriggerGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlTriggerGet.json // this example is just showing the usage of "SqlResources_GetSqlTrigger" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -129,7 +129,7 @@ public async Task Exists_CosmosDBSqlTriggerGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBSqlTriggerGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlTriggerGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlTriggerGet.json // this example is just showing the usage of "SqlResources_GetSqlTrigger" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -174,7 +174,7 @@ public async Task GetIfExists_CosmosDBSqlTriggerGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBSqlTriggerCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlTriggerCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlTriggerCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlTrigger" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlTriggerResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlTriggerResource.cs index 035ee2cf3926..581423501845 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlTriggerResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlTriggerResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlTriggerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlTriggerGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlTriggerGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlTriggerGet.json // this example is just showing the usage of "SqlResources_GetSqlTrigger" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -54,7 +54,7 @@ public async Task Get_CosmosDBSqlTriggerGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBSqlTriggerCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlTriggerCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlTriggerCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlTrigger" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -98,7 +98,7 @@ public async Task Update_CosmosDBSqlTriggerCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBSqlTriggerDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlTriggerDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlTriggerDelete.json // this example is just showing the usage of "SqlResources_DeleteSqlTrigger" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlUserDefinedFunctionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlUserDefinedFunctionCollection.cs index 59397909014f..d0e82cb7187a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlUserDefinedFunctionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlUserDefinedFunctionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlUserDefinedFunctionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBSqlUserDefinedFunctionList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlUserDefinedFunctionList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlUserDefinedFunctionList.json // this example is just showing the usage of "SqlResources_ListSqlUserDefinedFunctions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +59,7 @@ public async Task GetAll_CosmosDBSqlUserDefinedFunctionList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlUserDefinedFunctionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlUserDefinedFunctionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlUserDefinedFunctionGet.json // this example is just showing the usage of "SqlResources_GetSqlUserDefinedFunction" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -96,7 +96,7 @@ public async Task Get_CosmosDBSqlUserDefinedFunctionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBSqlUserDefinedFunctionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlUserDefinedFunctionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlUserDefinedFunctionGet.json // this example is just showing the usage of "SqlResources_GetSqlUserDefinedFunction" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -129,7 +129,7 @@ public async Task Exists_CosmosDBSqlUserDefinedFunctionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBSqlUserDefinedFunctionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlUserDefinedFunctionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlUserDefinedFunctionGet.json // this example is just showing the usage of "SqlResources_GetSqlUserDefinedFunction" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -174,7 +174,7 @@ public async Task GetIfExists_CosmosDBSqlUserDefinedFunctionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBSqlUserDefinedFunctionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlUserDefinedFunctionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlUserDefinedFunctionCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlUserDefinedFunction" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlUserDefinedFunctionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlUserDefinedFunctionResource.cs index 33b55d9f70ef..60c428f51b4a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlUserDefinedFunctionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlUserDefinedFunctionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlUserDefinedFunctionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlUserDefinedFunctionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlUserDefinedFunctionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlUserDefinedFunctionGet.json // this example is just showing the usage of "SqlResources_GetSqlUserDefinedFunction" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -54,7 +54,7 @@ public async Task Get_CosmosDBSqlUserDefinedFunctionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBSqlUserDefinedFunctionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlUserDefinedFunctionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlUserDefinedFunctionCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlUserDefinedFunction" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -96,7 +96,7 @@ public async Task Update_CosmosDBSqlUserDefinedFunctionCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBSqlUserDefinedFunctionDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlUserDefinedFunctionDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBSqlUserDefinedFunctionDelete.json // this example is just showing the usage of "SqlResources_DeleteSqlUserDefinedFunction" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableCollection.cs index dff9d4501093..7cbbe1d1c0f7 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBTableCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBTableList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBTableList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBTableList.json // this example is just showing the usage of "TableResources_ListTables" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task GetAll_CosmosDBTableList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBTableGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBTableGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBTableGet.json // this example is just showing the usage of "TableResources_GetTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task Get_CosmosDBTableGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBTableGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBTableGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBTableGet.json // this example is just showing the usage of "TableResources_GetTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +123,7 @@ public async Task Exists_CosmosDBTableGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBTableGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBTableGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBTableGet.json // this example is just showing the usage of "TableResources_GetTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +166,7 @@ public async Task GetIfExists_CosmosDBTableGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBTableReplace() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBTableCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBTableCreateUpdate.json // this example is just showing the usage of "TableResources_CreateUpdateTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableResource.cs index 9383ab558139..8c317943f46b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBTableResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBTableGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBTableGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBTableGet.json // this example is just showing the usage of "TableResources_GetTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBTableGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBTableReplace() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBTableCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBTableCreateUpdate.json // this example is just showing the usage of "TableResources_CreateUpdateTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task Update_CosmosDBTableReplace() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBTableDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBTableDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBTableDelete.json // this example is just showing the usage of "TableResources_DeleteTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -120,7 +120,7 @@ public async Task Delete_CosmosDBTableDelete() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task RetrieveContinuousBackupInformation_CosmosDBTableCollectionBackupInformation() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBTableBackupInformation.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBTableBackupInformation.json // this example is just showing the usage of "TableResources_RetrieveContinuousBackupInformation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolAccountCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolAccountCollection.cs deleted file mode 100644 index 18b8079ee86c..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolAccountCollection.cs +++ /dev/null @@ -1,204 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; - -namespace Azure.ResourceManager.CosmosDB.Samples -{ - public partial class Sample_CosmosDBThroughputPoolAccountCollection - { - // CosmosDB ThroughputPool Account List - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_CosmosDBThroughputPoolAccountList() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/throughputPool/CosmosDBThroughputPoolAccountsList.json - // this example is just showing the usage of "ThroughputPoolAccounts_List" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBThroughputPoolResource created on azure - // for more information of creating CosmosDBThroughputPoolResource, please refer to the document of CosmosDBThroughputPoolResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rgName"; - string throughputPoolName = "tp1"; - ResourceIdentifier cosmosDBThroughputPoolResourceId = CosmosDBThroughputPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, throughputPoolName); - CosmosDBThroughputPoolResource cosmosDBThroughputPool = client.GetCosmosDBThroughputPoolResource(cosmosDBThroughputPoolResourceId); - - // get the collection of this CosmosDBThroughputPoolAccountResource - CosmosDBThroughputPoolAccountCollection collection = cosmosDBThroughputPool.GetCosmosDBThroughputPoolAccounts(); - - // invoke the operation and iterate over the result - await foreach (CosmosDBThroughputPoolAccountResource item in collection.GetAllAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBThroughputPoolAccountData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // CosmosDB ThroughputPool Account Get - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_CosmosDBThroughputPoolAccountGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/throughputPool/CosmosDBThroughputPoolAccountGet.json - // this example is just showing the usage of "ThroughputPoolAccount_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBThroughputPoolResource created on azure - // for more information of creating CosmosDBThroughputPoolResource, please refer to the document of CosmosDBThroughputPoolResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rgName"; - string throughputPoolName = "tp1"; - ResourceIdentifier cosmosDBThroughputPoolResourceId = CosmosDBThroughputPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, throughputPoolName); - CosmosDBThroughputPoolResource cosmosDBThroughputPool = client.GetCosmosDBThroughputPoolResource(cosmosDBThroughputPoolResourceId); - - // get the collection of this CosmosDBThroughputPoolAccountResource - CosmosDBThroughputPoolAccountCollection collection = cosmosDBThroughputPool.GetCosmosDBThroughputPoolAccounts(); - - // invoke the operation - string throughputPoolAccountName = "db1"; - CosmosDBThroughputPoolAccountResource result = await collection.GetAsync(throughputPoolAccountName); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBThroughputPoolAccountData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDB ThroughputPool Account Get - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_CosmosDBThroughputPoolAccountGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/throughputPool/CosmosDBThroughputPoolAccountGet.json - // this example is just showing the usage of "ThroughputPoolAccount_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBThroughputPoolResource created on azure - // for more information of creating CosmosDBThroughputPoolResource, please refer to the document of CosmosDBThroughputPoolResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rgName"; - string throughputPoolName = "tp1"; - ResourceIdentifier cosmosDBThroughputPoolResourceId = CosmosDBThroughputPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, throughputPoolName); - CosmosDBThroughputPoolResource cosmosDBThroughputPool = client.GetCosmosDBThroughputPoolResource(cosmosDBThroughputPoolResourceId); - - // get the collection of this CosmosDBThroughputPoolAccountResource - CosmosDBThroughputPoolAccountCollection collection = cosmosDBThroughputPool.GetCosmosDBThroughputPoolAccounts(); - - // invoke the operation - string throughputPoolAccountName = "db1"; - bool result = await collection.ExistsAsync(throughputPoolAccountName); - - Console.WriteLine($"Succeeded: {result}"); - } - - // CosmosDB ThroughputPool Account Get - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetIfExists_CosmosDBThroughputPoolAccountGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/throughputPool/CosmosDBThroughputPoolAccountGet.json - // this example is just showing the usage of "ThroughputPoolAccount_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBThroughputPoolResource created on azure - // for more information of creating CosmosDBThroughputPoolResource, please refer to the document of CosmosDBThroughputPoolResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rgName"; - string throughputPoolName = "tp1"; - ResourceIdentifier cosmosDBThroughputPoolResourceId = CosmosDBThroughputPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, throughputPoolName); - CosmosDBThroughputPoolResource cosmosDBThroughputPool = client.GetCosmosDBThroughputPoolResource(cosmosDBThroughputPoolResourceId); - - // get the collection of this CosmosDBThroughputPoolAccountResource - CosmosDBThroughputPoolAccountCollection collection = cosmosDBThroughputPool.GetCosmosDBThroughputPoolAccounts(); - - // invoke the operation - string throughputPoolAccountName = "db1"; - NullableResponse response = await collection.GetIfExistsAsync(throughputPoolAccountName); - CosmosDBThroughputPoolAccountResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine($"Succeeded with null as result"); - } - else - { - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBThroughputPoolAccountData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - - // CosmosDB ThroughputPool Account Create - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CosmosDBThroughputPoolAccountCreate() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/throughputPool/CosmosDBThroughputPoolAccountCreate.json - // this example is just showing the usage of "ThroughputPoolAccount_Create" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBThroughputPoolResource created on azure - // for more information of creating CosmosDBThroughputPoolResource, please refer to the document of CosmosDBThroughputPoolResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rg1"; - string throughputPoolName = "tp1"; - ResourceIdentifier cosmosDBThroughputPoolResourceId = CosmosDBThroughputPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, throughputPoolName); - CosmosDBThroughputPoolResource cosmosDBThroughputPool = client.GetCosmosDBThroughputPoolResource(cosmosDBThroughputPoolResourceId); - - // get the collection of this CosmosDBThroughputPoolAccountResource - CosmosDBThroughputPoolAccountCollection collection = cosmosDBThroughputPool.GetCosmosDBThroughputPoolAccounts(); - - // invoke the operation - string throughputPoolAccountName = "db1"; - CosmosDBThroughputPoolAccountData data = new CosmosDBThroughputPoolAccountData() - { - AccountResourceIdentifier = new ResourceIdentifier("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DocumentDB/resourceGroup/rg1/databaseAccounts/db1/"), - AccountLocation = new AzureLocation("West US"), - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, throughputPoolAccountName, data); - CosmosDBThroughputPoolAccountResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBThroughputPoolAccountData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolAccountResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolAccountResource.cs deleted file mode 100644 index 2193863d85ae..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolAccountResource.cs +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; - -namespace Azure.ResourceManager.CosmosDB.Samples -{ - public partial class Sample_CosmosDBThroughputPoolAccountResource - { - // CosmosDB ThroughputPool Account Get - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_CosmosDBThroughputPoolAccountGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/throughputPool/CosmosDBThroughputPoolAccountGet.json - // this example is just showing the usage of "ThroughputPoolAccount_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBThroughputPoolAccountResource created on azure - // for more information of creating CosmosDBThroughputPoolAccountResource, please refer to the document of CosmosDBThroughputPoolAccountResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rgName"; - string throughputPoolName = "tp1"; - string throughputPoolAccountName = "db1"; - ResourceIdentifier cosmosDBThroughputPoolAccountResourceId = CosmosDBThroughputPoolAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, throughputPoolName, throughputPoolAccountName); - CosmosDBThroughputPoolAccountResource cosmosDBThroughputPoolAccount = client.GetCosmosDBThroughputPoolAccountResource(cosmosDBThroughputPoolAccountResourceId); - - // invoke the operation - CosmosDBThroughputPoolAccountResource result = await cosmosDBThroughputPoolAccount.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBThroughputPoolAccountData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDB ThroughputPool Account Create - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CosmosDBThroughputPoolAccountCreate() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/throughputPool/CosmosDBThroughputPoolAccountCreate.json - // this example is just showing the usage of "ThroughputPoolAccount_Create" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBThroughputPoolAccountResource created on azure - // for more information of creating CosmosDBThroughputPoolAccountResource, please refer to the document of CosmosDBThroughputPoolAccountResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rg1"; - string throughputPoolName = "tp1"; - string throughputPoolAccountName = "db1"; - ResourceIdentifier cosmosDBThroughputPoolAccountResourceId = CosmosDBThroughputPoolAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, throughputPoolName, throughputPoolAccountName); - CosmosDBThroughputPoolAccountResource cosmosDBThroughputPoolAccount = client.GetCosmosDBThroughputPoolAccountResource(cosmosDBThroughputPoolAccountResourceId); - - // invoke the operation - CosmosDBThroughputPoolAccountData data = new CosmosDBThroughputPoolAccountData() - { - AccountResourceIdentifier = new ResourceIdentifier("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DocumentDB/resourceGroup/rg1/databaseAccounts/db1/"), - AccountLocation = new AzureLocation("West US"), - }; - ArmOperation lro = await cosmosDBThroughputPoolAccount.UpdateAsync(WaitUntil.Completed, data); - CosmosDBThroughputPoolAccountResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBThroughputPoolAccountData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDB ThroughputPool Account Delete - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Delete_CosmosDBThroughputPoolAccountDelete() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/throughputPool/CosmosDBThroughputPoolAccountDelete.json - // this example is just showing the usage of "ThroughputPoolAccount_Delete" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBThroughputPoolAccountResource created on azure - // for more information of creating CosmosDBThroughputPoolAccountResource, please refer to the document of CosmosDBThroughputPoolAccountResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rgName"; - string throughputPoolName = "tp1"; - string throughputPoolAccountName = "db1"; - ResourceIdentifier cosmosDBThroughputPoolAccountResourceId = CosmosDBThroughputPoolAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, throughputPoolName, throughputPoolAccountName); - CosmosDBThroughputPoolAccountResource cosmosDBThroughputPoolAccount = client.GetCosmosDBThroughputPoolAccountResource(cosmosDBThroughputPoolAccountResourceId); - - // invoke the operation - await cosmosDBThroughputPoolAccount.DeleteAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolCollection.cs deleted file mode 100644 index 79202b0a1e6d..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolCollection.cs +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.CosmosDB.Samples -{ - public partial class Sample_CosmosDBThroughputPoolCollection - { - // CosmosDB ThroughputPool List by Resource Group - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_CosmosDBThroughputPoolListByResourceGroup() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/throughputPool/CosmosDBThroughputPoolList.json - // this example is just showing the usage of "ThroughputPools_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rgName"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this CosmosDBThroughputPoolResource - CosmosDBThroughputPoolCollection collection = resourceGroupResource.GetCosmosDBThroughputPools(); - - // invoke the operation and iterate over the result - await foreach (CosmosDBThroughputPoolResource item in collection.GetAllAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBThroughputPoolData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // CosmosDB ThroughputPool Get - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_CosmosDBThroughputPoolGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/throughputPool/CosmosDBThroughputPoolGet.json - // this example is just showing the usage of "ThroughputPool_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rgName"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this CosmosDBThroughputPoolResource - CosmosDBThroughputPoolCollection collection = resourceGroupResource.GetCosmosDBThroughputPools(); - - // invoke the operation - string throughputPoolName = "tp1"; - CosmosDBThroughputPoolResource result = await collection.GetAsync(throughputPoolName); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBThroughputPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDB ThroughputPool Get - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_CosmosDBThroughputPoolGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/throughputPool/CosmosDBThroughputPoolGet.json - // this example is just showing the usage of "ThroughputPool_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rgName"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this CosmosDBThroughputPoolResource - CosmosDBThroughputPoolCollection collection = resourceGroupResource.GetCosmosDBThroughputPools(); - - // invoke the operation - string throughputPoolName = "tp1"; - bool result = await collection.ExistsAsync(throughputPoolName); - - Console.WriteLine($"Succeeded: {result}"); - } - - // CosmosDB ThroughputPool Get - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetIfExists_CosmosDBThroughputPoolGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/throughputPool/CosmosDBThroughputPoolGet.json - // this example is just showing the usage of "ThroughputPool_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rgName"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this CosmosDBThroughputPoolResource - CosmosDBThroughputPoolCollection collection = resourceGroupResource.GetCosmosDBThroughputPools(); - - // invoke the operation - string throughputPoolName = "tp1"; - NullableResponse response = await collection.GetIfExistsAsync(throughputPoolName); - CosmosDBThroughputPoolResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine($"Succeeded with null as result"); - } - else - { - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBThroughputPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - - // CosmosDB ThroughputPool Create - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CosmosDBThroughputPoolCreate() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/throughputPool/CosmosDBThroughputPoolCreate.json - // this example is just showing the usage of "ThroughputPool_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rg1"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this CosmosDBThroughputPoolResource - CosmosDBThroughputPoolCollection collection = resourceGroupResource.GetCosmosDBThroughputPools(); - - // invoke the operation - string throughputPoolName = "tp1"; - CosmosDBThroughputPoolData data = new CosmosDBThroughputPoolData(new AzureLocation("westus2")) - { - MaxThroughput = 10000, - Tags = -{ -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, throughputPoolName, data); - CosmosDBThroughputPoolResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBThroughputPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolResource.cs deleted file mode 100644 index 7de73e52037f..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolResource.cs +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.CosmosDB.Samples -{ - public partial class Sample_CosmosDBThroughputPoolResource - { - // CosmosDB ThroughputPool List - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetCosmosDBThroughputPools_CosmosDBThroughputPoolList() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/throughputPool/CosmosDBThroughputPoolList.json - // this example is just showing the usage of "ThroughputPools_List" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this SubscriptionResource created on azure - // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); - SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); - - // invoke the operation and iterate over the result - await foreach (CosmosDBThroughputPoolResource item in subscriptionResource.GetCosmosDBThroughputPoolsAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBThroughputPoolData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // CosmosDB ThroughputPool Get - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_CosmosDBThroughputPoolGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/throughputPool/CosmosDBThroughputPoolGet.json - // this example is just showing the usage of "ThroughputPool_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBThroughputPoolResource created on azure - // for more information of creating CosmosDBThroughputPoolResource, please refer to the document of CosmosDBThroughputPoolResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rgName"; - string throughputPoolName = "tp1"; - ResourceIdentifier cosmosDBThroughputPoolResourceId = CosmosDBThroughputPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, throughputPoolName); - CosmosDBThroughputPoolResource cosmosDBThroughputPool = client.GetCosmosDBThroughputPoolResource(cosmosDBThroughputPoolResourceId); - - // invoke the operation - CosmosDBThroughputPoolResource result = await cosmosDBThroughputPool.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBThroughputPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDB ThroughputPool Update - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CosmosDBThroughputPoolUpdate() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/throughputPool/CosmosDBThroughputPoolUpdate.json - // this example is just showing the usage of "ThroughputPool_Update" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBThroughputPoolResource created on azure - // for more information of creating CosmosDBThroughputPoolResource, please refer to the document of CosmosDBThroughputPoolResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rg1"; - string throughputPoolName = "tp1"; - ResourceIdentifier cosmosDBThroughputPoolResourceId = CosmosDBThroughputPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, throughputPoolName); - CosmosDBThroughputPoolResource cosmosDBThroughputPool = client.GetCosmosDBThroughputPoolResource(cosmosDBThroughputPoolResourceId); - - // invoke the operation - CosmosDBThroughputPoolPatch patch = new CosmosDBThroughputPoolPatch() - { - MaxThroughput = 10000, - }; - ArmOperation lro = await cosmosDBThroughputPool.UpdateAsync(WaitUntil.Completed, patch); - CosmosDBThroughputPoolResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBThroughputPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDB ThroughputPool Delete - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Delete_CosmosDBThroughputPoolDelete() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/throughputPool/CosmosDBThroughputPoolDelete.json - // this example is just showing the usage of "ThroughputPool_Delete" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBThroughputPoolResource created on azure - // for more information of creating CosmosDBThroughputPoolResource, please refer to the document of CosmosDBThroughputPoolResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rgName"; - string throughputPoolName = "tp1"; - ResourceIdentifier cosmosDBThroughputPoolResourceId = CosmosDBThroughputPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, throughputPoolName); - CosmosDBThroughputPoolResource cosmosDBThroughputPool = client.GetCosmosDBThroughputPoolResource(cosmosDBThroughputPoolResourceId); - - // invoke the operation - await cosmosDBThroughputPool.DeleteAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosTableThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosTableThroughputSettingResource.cs index e1bc69e83dc6..86d47add57fb 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosTableThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosTableThroughputSettingResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosTableThroughputSettingResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBTableThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBTableThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBTableThroughputGet.json // this example is just showing the usage of "TableResources_GetTableThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBTableThroughputGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBTableThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBTableThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBTableThroughputUpdate.json // this example is just showing the usage of "TableResources_UpdateTableThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task CreateOrUpdate_CosmosDBTableThroughputUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateTableToAutoscale_CosmosDBTableMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBTableMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBTableMigrateToAutoscale.json // this example is just showing the usage of "TableResources_MigrateTableToAutoscale" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -127,7 +127,7 @@ public async Task MigrateTableToAutoscale_CosmosDBTableMigrateToAutoscale() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateTableToManualThroughput_CosmosDBTableMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBTableMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBTableMigrateToManualThroughput.json // this example is just showing the usage of "TableResources_MigrateTableToManualThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_DataTransferJobGetResultCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_DataTransferJobGetResultCollection.cs deleted file mode 100644 index 41edfd49c1b6..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_DataTransferJobGetResultCollection.cs +++ /dev/null @@ -1,204 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB.Samples -{ - public partial class Sample_DataTransferJobGetResultCollection - { - // CosmosDBDataTransferJobCreate - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CosmosDBDataTransferJobCreate() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobCreate.json - // this example is just showing the usage of "DataTransferJobs_Create" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBAccountResource created on azure - // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this DataTransferJobGetResultResource - DataTransferJobGetResultCollection collection = cosmosDBAccount.GetDataTransferJobGetResults(); - - // invoke the operation - string jobName = "j1"; - DataTransferJobGetResultCreateOrUpdateContent content = new DataTransferJobGetResultCreateOrUpdateContent(new DataTransferJobProperties(new CosmosCassandraDataTransferDataSourceSink("keyspace", "table"), new AzureBlobDataTransferDataSourceSink("blob_container") - { - EndpointUri = new Uri("https://blob.windows.net"), - })); - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, jobName, content); - DataTransferJobGetResultResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - DataTransferJobGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBDataTransferJobGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_CosmosDBDataTransferJobGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobGet.json - // this example is just showing the usage of "DataTransferJobs_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBAccountResource created on azure - // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this DataTransferJobGetResultResource - DataTransferJobGetResultCollection collection = cosmosDBAccount.GetDataTransferJobGetResults(); - - // invoke the operation - string jobName = "j1"; - DataTransferJobGetResultResource result = await collection.GetAsync(jobName); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - DataTransferJobGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBDataTransferJobGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_CosmosDBDataTransferJobGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobGet.json - // this example is just showing the usage of "DataTransferJobs_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBAccountResource created on azure - // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this DataTransferJobGetResultResource - DataTransferJobGetResultCollection collection = cosmosDBAccount.GetDataTransferJobGetResults(); - - // invoke the operation - string jobName = "j1"; - bool result = await collection.ExistsAsync(jobName); - - Console.WriteLine($"Succeeded: {result}"); - } - - // CosmosDBDataTransferJobGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetIfExists_CosmosDBDataTransferJobGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobGet.json - // this example is just showing the usage of "DataTransferJobs_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBAccountResource created on azure - // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this DataTransferJobGetResultResource - DataTransferJobGetResultCollection collection = cosmosDBAccount.GetDataTransferJobGetResults(); - - // invoke the operation - string jobName = "j1"; - NullableResponse response = await collection.GetIfExistsAsync(jobName); - DataTransferJobGetResultResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine($"Succeeded with null as result"); - } - else - { - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - DataTransferJobGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - - // CosmosDBDataTransferJobFeed - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_CosmosDBDataTransferJobFeed() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobFeed.json - // this example is just showing the usage of "DataTransferJobs_ListByDatabaseAccount" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBAccountResource created on azure - // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this DataTransferJobGetResultResource - DataTransferJobGetResultCollection collection = cosmosDBAccount.GetDataTransferJobGetResults(); - - // invoke the operation and iterate over the result - await foreach (DataTransferJobGetResultResource item in collection.GetAllAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - DataTransferJobGetResultData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_DataTransferJobGetResultResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_DataTransferJobGetResultResource.cs deleted file mode 100644 index 708eda3a2feb..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_DataTransferJobGetResultResource.cs +++ /dev/null @@ -1,215 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB.Samples -{ - public partial class Sample_DataTransferJobGetResultResource - { - // CosmosDBDataTransferJobCreate - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CosmosDBDataTransferJobCreate() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobCreate.json - // this example is just showing the usage of "DataTransferJobs_Create" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this DataTransferJobGetResultResource created on azure - // for more information of creating DataTransferJobGetResultResource, please refer to the document of DataTransferJobGetResultResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string jobName = "j1"; - ResourceIdentifier dataTransferJobGetResultResourceId = DataTransferJobGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, jobName); - DataTransferJobGetResultResource dataTransferJobGetResult = client.GetDataTransferJobGetResultResource(dataTransferJobGetResultResourceId); - - // invoke the operation - DataTransferJobGetResultCreateOrUpdateContent content = new DataTransferJobGetResultCreateOrUpdateContent(new DataTransferJobProperties(new CosmosCassandraDataTransferDataSourceSink("keyspace", "table"), new AzureBlobDataTransferDataSourceSink("blob_container") - { - EndpointUri = new Uri("https://blob.windows.net"), - })); - ArmOperation lro = await dataTransferJobGetResult.UpdateAsync(WaitUntil.Completed, content); - DataTransferJobGetResultResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - DataTransferJobGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBDataTransferJobGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_CosmosDBDataTransferJobGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobGet.json - // this example is just showing the usage of "DataTransferJobs_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this DataTransferJobGetResultResource created on azure - // for more information of creating DataTransferJobGetResultResource, please refer to the document of DataTransferJobGetResultResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string jobName = "j1"; - ResourceIdentifier dataTransferJobGetResultResourceId = DataTransferJobGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, jobName); - DataTransferJobGetResultResource dataTransferJobGetResult = client.GetDataTransferJobGetResultResource(dataTransferJobGetResultResourceId); - - // invoke the operation - DataTransferJobGetResultResource result = await dataTransferJobGetResult.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - DataTransferJobGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBDataTransferJobPause - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Pause_CosmosDBDataTransferJobPause() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobPause.json - // this example is just showing the usage of "DataTransferJobs_Pause" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this DataTransferJobGetResultResource created on azure - // for more information of creating DataTransferJobGetResultResource, please refer to the document of DataTransferJobGetResultResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string jobName = "j1"; - ResourceIdentifier dataTransferJobGetResultResourceId = DataTransferJobGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, jobName); - DataTransferJobGetResultResource dataTransferJobGetResult = client.GetDataTransferJobGetResultResource(dataTransferJobGetResultResourceId); - - // invoke the operation - DataTransferJobGetResultResource result = await dataTransferJobGetResult.PauseAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - DataTransferJobGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBDataTransferJobResume - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Resume_CosmosDBDataTransferJobResume() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobResume.json - // this example is just showing the usage of "DataTransferJobs_Resume" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this DataTransferJobGetResultResource created on azure - // for more information of creating DataTransferJobGetResultResource, please refer to the document of DataTransferJobGetResultResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string jobName = "j1"; - ResourceIdentifier dataTransferJobGetResultResourceId = DataTransferJobGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, jobName); - DataTransferJobGetResultResource dataTransferJobGetResult = client.GetDataTransferJobGetResultResource(dataTransferJobGetResultResourceId); - - // invoke the operation - DataTransferJobGetResultResource result = await dataTransferJobGetResult.ResumeAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - DataTransferJobGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBDataTransferJobCancel - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Cancel_CosmosDBDataTransferJobCancel() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobCancel.json - // this example is just showing the usage of "DataTransferJobs_Cancel" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this DataTransferJobGetResultResource created on azure - // for more information of creating DataTransferJobGetResultResource, please refer to the document of DataTransferJobGetResultResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string jobName = "j1"; - ResourceIdentifier dataTransferJobGetResultResourceId = DataTransferJobGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, jobName); - DataTransferJobGetResultResource dataTransferJobGetResult = client.GetDataTransferJobGetResultResource(dataTransferJobGetResultResourceId); - - // invoke the operation - DataTransferJobGetResultResource result = await dataTransferJobGetResult.CancelAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - DataTransferJobGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBDataTransferJobComplete - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Complete_CosmosDBDataTransferJobComplete() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobComplete.json - // this example is just showing the usage of "DataTransferJobs_Complete" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this DataTransferJobGetResultResource created on azure - // for more information of creating DataTransferJobGetResultResource, please refer to the document of DataTransferJobGetResultResource - string subscriptionId = "e35cc6eb-c8e3-447b-8de6-b83328cd0098"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string jobName = "j1"; - ResourceIdentifier dataTransferJobGetResultResourceId = DataTransferJobGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, jobName); - DataTransferJobGetResultResource dataTransferJobGetResult = client.GetDataTransferJobGetResultResource(dataTransferJobGetResultResourceId); - - // invoke the operation - DataTransferJobGetResultResource result = await dataTransferJobGetResult.CompleteAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - DataTransferJobGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GraphResourceGetResultCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GraphResourceGetResultCollection.cs deleted file mode 100644 index 0968bdaf985e..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GraphResourceGetResultCollection.cs +++ /dev/null @@ -1,211 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.CosmosDB.Samples -{ - public partial class Sample_GraphResourceGetResultCollection - { - // CosmosDBSqlDatabaseList - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_CosmosDBSqlDatabaseList() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGraphResourceList.json - // this example is just showing the usage of "GraphResources_ListGraphs" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBAccountResource created on azure - // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource - string subscriptionId = "subid"; - string resourceGroupName = "rgName"; - string accountName = "ddb1"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this GraphResourceGetResultResource - GraphResourceGetResultCollection collection = cosmosDBAccount.GetGraphResourceGetResults(); - - // invoke the operation and iterate over the result - await foreach (GraphResourceGetResultResource item in collection.GetAllAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - GraphResourceGetResultData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // CosmosDBSqlDatabaseGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_CosmosDBSqlDatabaseGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGraphResourceGet.json - // this example is just showing the usage of "GraphResources_GetGraph" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBAccountResource created on azure - // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this GraphResourceGetResultResource - GraphResourceGetResultCollection collection = cosmosDBAccount.GetGraphResourceGetResults(); - - // invoke the operation - string graphName = "graphName"; - GraphResourceGetResultResource result = await collection.GetAsync(graphName); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - GraphResourceGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBSqlDatabaseGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_CosmosDBSqlDatabaseGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGraphResourceGet.json - // this example is just showing the usage of "GraphResources_GetGraph" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBAccountResource created on azure - // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this GraphResourceGetResultResource - GraphResourceGetResultCollection collection = cosmosDBAccount.GetGraphResourceGetResults(); - - // invoke the operation - string graphName = "graphName"; - bool result = await collection.ExistsAsync(graphName); - - Console.WriteLine($"Succeeded: {result}"); - } - - // CosmosDBSqlDatabaseGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetIfExists_CosmosDBSqlDatabaseGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGraphResourceGet.json - // this example is just showing the usage of "GraphResources_GetGraph" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBAccountResource created on azure - // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this GraphResourceGetResultResource - GraphResourceGetResultCollection collection = cosmosDBAccount.GetGraphResourceGetResults(); - - // invoke the operation - string graphName = "graphName"; - NullableResponse response = await collection.GetIfExistsAsync(graphName); - GraphResourceGetResultResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine($"Succeeded with null as result"); - } - else - { - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - GraphResourceGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - - // CosmosDBGraphCreateUpdate - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CosmosDBGraphCreateUpdate() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGraphResourceCreateUpdate.json - // this example is just showing the usage of "GraphResources_CreateUpdateGraph" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBAccountResource created on azure - // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this GraphResourceGetResultResource - GraphResourceGetResultCollection collection = cosmosDBAccount.GetGraphResourceGetResults(); - - // invoke the operation - string graphName = "graphName"; - GraphResourceGetResultCreateOrUpdateContent content = new GraphResourceGetResultCreateOrUpdateContent(new AzureLocation("West US"), new WritableSubResource() - { - Id = new ResourceIdentifier("graphName"), - }) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = -{ -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, graphName, content); - GraphResourceGetResultResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - GraphResourceGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GraphResourceGetResultResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GraphResourceGetResultResource.cs deleted file mode 100644 index 8cb4b0ab8964..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GraphResourceGetResultResource.cs +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.CosmosDB.Samples -{ - public partial class Sample_GraphResourceGetResultResource - { - // CosmosDBSqlDatabaseGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_CosmosDBSqlDatabaseGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGraphResourceGet.json - // this example is just showing the usage of "GraphResources_GetGraph" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this GraphResourceGetResultResource created on azure - // for more information of creating GraphResourceGetResultResource, please refer to the document of GraphResourceGetResultResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string graphName = "graphName"; - ResourceIdentifier graphResourceGetResultResourceId = GraphResourceGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, graphName); - GraphResourceGetResultResource graphResourceGetResult = client.GetGraphResourceGetResultResource(graphResourceGetResultResourceId); - - // invoke the operation - GraphResourceGetResultResource result = await graphResourceGetResult.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - GraphResourceGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBGraphCreateUpdate - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CosmosDBGraphCreateUpdate() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGraphResourceCreateUpdate.json - // this example is just showing the usage of "GraphResources_CreateUpdateGraph" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this GraphResourceGetResultResource created on azure - // for more information of creating GraphResourceGetResultResource, please refer to the document of GraphResourceGetResultResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string graphName = "graphName"; - ResourceIdentifier graphResourceGetResultResourceId = GraphResourceGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, graphName); - GraphResourceGetResultResource graphResourceGetResult = client.GetGraphResourceGetResultResource(graphResourceGetResultResourceId); - - // invoke the operation - GraphResourceGetResultCreateOrUpdateContent content = new GraphResourceGetResultCreateOrUpdateContent(new AzureLocation("West US"), new WritableSubResource() - { - Id = new ResourceIdentifier("graphName"), - }) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = -{ -}, - }; - ArmOperation lro = await graphResourceGetResult.UpdateAsync(WaitUntil.Completed, content); - GraphResourceGetResultResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - GraphResourceGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBSqlDatabaseDelete - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Delete_CosmosDBSqlDatabaseDelete() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGraphResourceDelete.json - // this example is just showing the usage of "GraphResources_DeleteGraphResource" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this GraphResourceGetResultResource created on azure - // for more information of creating GraphResourceGetResultResource, please refer to the document of GraphResourceGetResultResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string graphName = "graphName"; - ResourceIdentifier graphResourceGetResultResourceId = GraphResourceGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, graphName); - GraphResourceGetResultResource graphResourceGetResult = client.GetGraphResourceGetResultResource(graphResourceGetResultResourceId); - - // invoke the operation - await graphResourceGetResult.DeleteAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseCollection.cs index 171ac7602b74..cb61314fcf9c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_GremlinDatabaseCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBGremlinDatabaseList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinDatabaseList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBGremlinDatabaseList.json // this example is just showing the usage of "GremlinResources_ListGremlinDatabases" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task GetAll_CosmosDBGremlinDatabaseList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBGremlinDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBGremlinDatabaseGet.json // this example is just showing the usage of "GremlinResources_GetGremlinDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task Get_CosmosDBGremlinDatabaseGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBGremlinDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBGremlinDatabaseGet.json // this example is just showing the usage of "GremlinResources_GetGremlinDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +123,7 @@ public async Task Exists_CosmosDBGremlinDatabaseGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBGremlinDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBGremlinDatabaseGet.json // this example is just showing the usage of "GremlinResources_GetGremlinDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +166,7 @@ public async Task GetIfExists_CosmosDBGremlinDatabaseGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBGremlinDatabaseCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinDatabaseCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBGremlinDatabaseCreateUpdate.json // this example is just showing the usage of "GremlinResources_CreateUpdateGremlinDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseResource.cs index 26417666d930..2749c4954939 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseResource.cs @@ -20,7 +20,7 @@ public partial class Sample_GremlinDatabaseResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBGremlinDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBGremlinDatabaseGet.json // this example is just showing the usage of "GremlinResources_GetGremlinDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBGremlinDatabaseGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBGremlinDatabaseCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinDatabaseCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBGremlinDatabaseCreateUpdate.json // this example is just showing the usage of "GremlinResources_CreateUpdateGremlinDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task Update_CosmosDBGremlinDatabaseCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBGremlinDatabaseDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinDatabaseDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBGremlinDatabaseDelete.json // this example is just showing the usage of "GremlinResources_DeleteGremlinDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseThroughputSettingResource.cs index 9b3989927d5b..e1b3b9b3c032 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseThroughputSettingResource.cs @@ -20,7 +20,7 @@ public partial class Sample_GremlinDatabaseThroughputSettingResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBGremlinDatabaseThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinDatabaseThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBGremlinDatabaseThroughputGet.json // this example is just showing the usage of "GremlinResources_GetGremlinDatabaseThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBGremlinDatabaseThroughputGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBGremlinDatabaseThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinDatabaseThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBGremlinDatabaseThroughputUpdate.json // this example is just showing the usage of "GremlinResources_UpdateGremlinDatabaseThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task CreateOrUpdate_CosmosDBGremlinDatabaseThroughputUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateGremlinDatabaseToAutoscale_CosmosDBGremlinDatabaseMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinDatabaseMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBGremlinDatabaseMigrateToAutoscale.json // this example is just showing the usage of "GremlinResources_MigrateGremlinDatabaseToAutoscale" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -127,7 +127,7 @@ public async Task MigrateGremlinDatabaseToAutoscale_CosmosDBGremlinDatabaseMigra [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateGremlinDatabaseToManualThroughput_CosmosDBGremlinDatabaseMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinDatabaseMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBGremlinDatabaseMigrateToManualThroughput.json // this example is just showing the usage of "GremlinResources_MigrateGremlinDatabaseToManualThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphCollection.cs index 2f42b77bcee8..dcf2a636152d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_GremlinGraphCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBGremlinGraphList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinGraphList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBGremlinGraphList.json // this example is just showing the usage of "GremlinResources_ListGremlinGraphs" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -58,7 +58,7 @@ public async Task GetAll_CosmosDBGremlinGraphList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBGremlinGraphGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinGraphGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBGremlinGraphGet.json // this example is just showing the usage of "GremlinResources_GetGremlinGraph" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task Get_CosmosDBGremlinGraphGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBGremlinGraphGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinGraphGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBGremlinGraphGet.json // this example is just showing the usage of "GremlinResources_GetGremlinGraph" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -126,7 +126,7 @@ public async Task Exists_CosmosDBGremlinGraphGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBGremlinGraphGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinGraphGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBGremlinGraphGet.json // this example is just showing the usage of "GremlinResources_GetGremlinGraph" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -170,7 +170,7 @@ public async Task GetIfExists_CosmosDBGremlinGraphGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBGremlinGraphCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinGraphCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBGremlinGraphCreateUpdate.json // this example is just showing the usage of "GremlinResources_CreateUpdateGremlinGraph" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphResource.cs index d11a53dee64b..a246211af1f1 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphResource.cs @@ -20,7 +20,7 @@ public partial class Sample_GremlinGraphResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBGremlinGraphGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinGraphGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBGremlinGraphGet.json // this example is just showing the usage of "GremlinResources_GetGremlinGraph" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_CosmosDBGremlinGraphGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBGremlinGraphCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinGraphCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBGremlinGraphCreateUpdate.json // this example is just showing the usage of "GremlinResources_CreateUpdateGremlinGraph" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -149,7 +149,7 @@ public async Task Update_CosmosDBGremlinGraphCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBGremlinGraphDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinGraphDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBGremlinGraphDelete.json // this example is just showing the usage of "GremlinResources_DeleteGremlinGraph" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -178,7 +178,7 @@ public async Task Delete_CosmosDBGremlinGraphDelete() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task RetrieveContinuousBackupInformation_CosmosDBGremlinGraphBackupInformation() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinGraphBackupInformation.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBGremlinGraphBackupInformation.json // this example is just showing the usage of "GremlinResources_RetrieveContinuousBackupInformation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphThroughputSettingResource.cs index 6e32eb2cd028..8923fa1bb440 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphThroughputSettingResource.cs @@ -20,7 +20,7 @@ public partial class Sample_GremlinGraphThroughputSettingResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBGremlinGraphThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinGraphThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBGremlinGraphThroughputGet.json // this example is just showing the usage of "GremlinResources_GetGremlinGraphThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_CosmosDBGremlinGraphThroughputGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBGremlinGraphThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinGraphThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBGremlinGraphThroughputUpdate.json // this example is just showing the usage of "GremlinResources_UpdateGremlinGraphThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -96,7 +96,7 @@ public async Task CreateOrUpdate_CosmosDBGremlinGraphThroughputUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateGremlinGraphToAutoscale_CosmosDBGremlinGraphMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinGraphMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBGremlinGraphMigrateToAutoscale.json // this example is just showing the usage of "GremlinResources_MigrateGremlinGraphToAutoscale" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -130,7 +130,7 @@ public async Task MigrateGremlinGraphToAutoscale_CosmosDBGremlinGraphMigrateToAu [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateGremlinGraphToManualThroughput_CosmosDBGremlinGraphMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinGraphMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBGremlinGraphMigrateToManualThroughput.json // this example is just showing the usage of "GremlinResources_MigrateGremlinGraphToManualThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionCollection.cs index 5284ba8b8b1a..c251d770f18f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoDBCollectionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBMongoDBCollectionList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBCollectionList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMongoDBCollectionList.json // this example is just showing the usage of "MongoDBResources_ListMongoDBCollections" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -58,7 +58,7 @@ public async Task GetAll_CosmosDBMongoDBCollectionList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBMongoDBCollectionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBCollectionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMongoDBCollectionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoDBCollection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task Get_CosmosDBMongoDBCollectionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBMongoDBCollectionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBCollectionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMongoDBCollectionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoDBCollection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -126,7 +126,7 @@ public async Task Exists_CosmosDBMongoDBCollectionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBMongoDBCollectionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBCollectionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMongoDBCollectionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoDBCollection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -170,7 +170,7 @@ public async Task GetIfExists_CosmosDBMongoDBCollectionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBMongoDBCollectionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBCollectionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMongoDBCollectionCreateUpdate.json // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoDBCollection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -219,60 +219,6 @@ public async Task CreateOrUpdate_CosmosDBMongoDBCollectionCreateUpdate() }, } }, - AnalyticalStorageTtl = 500, - }) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = -{ -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, collectionName, content); - MongoDBCollectionResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - MongoDBCollectionData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBMongoDBCollectionRestore - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CosmosDBMongoDBCollectionRestore() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBCollectionRestore.json - // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoDBCollection" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MongoDBDatabaseResource created on azure - // for more information of creating MongoDBDatabaseResource, please refer to the document of MongoDBDatabaseResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - ResourceIdentifier mongoDBDatabaseResourceId = MongoDBDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName); - MongoDBDatabaseResource mongoDBDatabase = client.GetMongoDBDatabaseResource(mongoDBDatabaseResourceId); - - // get the collection of this MongoDBCollectionResource - MongoDBCollectionCollection collection = mongoDBDatabase.GetMongoDBCollections(); - - // invoke the operation - string collectionName = "collectionName"; - MongoDBCollectionCreateOrUpdateContent content = new MongoDBCollectionCreateOrUpdateContent(new AzureLocation("West US"), new MongoDBCollectionResourceInfo("collectionName") - { - RestoreParameters = new ResourceRestoreParameters() - { - RestoreSource = "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId", - RestoreTimestampInUtc = DateTimeOffset.Parse("2022-07-20T18:28:00Z"), - IsRestoreWithTtlDisabled = false, - }, - CreateMode = CosmosDBAccountCreateMode.Restore, }) { Options = new CosmosDBCreateUpdateConfig(), diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionResource.cs index bd7a236329fb..3509bf1149f9 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoDBCollectionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBMongoDBCollectionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBCollectionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMongoDBCollectionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoDBCollection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_CosmosDBMongoDBCollectionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBMongoDBCollectionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBCollectionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMongoDBCollectionCreateUpdate.json // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoDBCollection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -99,57 +99,6 @@ public async Task Update_CosmosDBMongoDBCollectionCreateUpdate() }, } }, - AnalyticalStorageTtl = 500, - }) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = -{ -}, - }; - ArmOperation lro = await mongoDBCollection.UpdateAsync(WaitUntil.Completed, content); - MongoDBCollectionResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - MongoDBCollectionData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBMongoDBCollectionRestore - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CosmosDBMongoDBCollectionRestore() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBCollectionRestore.json - // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoDBCollection" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MongoDBCollectionResource created on azure - // for more information of creating MongoDBCollectionResource, please refer to the document of MongoDBCollectionResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - string collectionName = "collectionName"; - ResourceIdentifier mongoDBCollectionResourceId = MongoDBCollectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName, collectionName); - MongoDBCollectionResource mongoDBCollection = client.GetMongoDBCollectionResource(mongoDBCollectionResourceId); - - // invoke the operation - MongoDBCollectionCreateOrUpdateContent content = new MongoDBCollectionCreateOrUpdateContent(new AzureLocation("West US"), new MongoDBCollectionResourceInfo("collectionName") - { - RestoreParameters = new ResourceRestoreParameters() - { - RestoreSource = "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId", - RestoreTimestampInUtc = DateTimeOffset.Parse("2022-07-20T18:28:00Z"), - IsRestoreWithTtlDisabled = false, - }, - CreateMode = CosmosDBAccountCreateMode.Restore, }) { Options = new CosmosDBCreateUpdateConfig(), @@ -172,7 +121,7 @@ public async Task Update_CosmosDBMongoDBCollectionRestore() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBMongoDBCollectionDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBCollectionDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMongoDBCollectionDelete.json // this example is just showing the usage of "MongoDBResources_DeleteMongoDBCollection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -196,46 +145,12 @@ public async Task Delete_CosmosDBMongoDBCollectionDelete() Console.WriteLine($"Succeeded"); } - // CosmosDBMongoDBCollectionPartitionMerge - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetMongoDBCollectionPartitionMerge_CosmosDBMongoDBCollectionPartitionMerge() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBCollectionPartitionMerge.json - // this example is just showing the usage of "MongoDBResources_ListMongoDBCollectionPartitionMerge" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MongoDBCollectionResource created on azure - // for more information of creating MongoDBCollectionResource, please refer to the document of MongoDBCollectionResource - string subscriptionId = "subid"; - string resourceGroupName = "rgName"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - string collectionName = "collectionName"; - ResourceIdentifier mongoDBCollectionResourceId = MongoDBCollectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName, collectionName); - MongoDBCollectionResource mongoDBCollection = client.GetMongoDBCollectionResource(mongoDBCollectionResourceId); - - // invoke the operation - MergeParameters mergeParameters = new MergeParameters() - { - IsDryRun = false, - }; - ArmOperation lro = await mongoDBCollection.GetMongoDBCollectionPartitionMergeAsync(WaitUntil.Completed, mergeParameters); - PhysicalPartitionStorageInfoCollection result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } - // CosmosDBMongoDBCollectionBackupInformation [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task RetrieveContinuousBackupInformation_CosmosDBMongoDBCollectionBackupInformation() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBCollectionBackupInformation.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMongoDBCollectionBackupInformation.json // this example is just showing the usage of "MongoDBResources_RetrieveContinuousBackupInformation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionThroughputSettingResource.cs index 55353371b7b1..0ab47d7641ed 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionThroughputSettingResource.cs @@ -10,104 +10,17 @@ using Azure.Core; using Azure.Identity; using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.CosmosDB.Samples { public partial class Sample_MongoDBCollectionThroughputSettingResource { - // CosmosDBMongoDBCollectionRetrieveThroughputDistribution - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task MongoDBContainerRetrieveThroughputDistribution_CosmosDBMongoDBCollectionRetrieveThroughputDistribution() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBCollectionRetrieveThroughputDistribution.json - // this example is just showing the usage of "MongoDBResources_MongoDBContainerRetrieveThroughputDistribution" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MongoDBCollectionThroughputSettingResource created on azure - // for more information of creating MongoDBCollectionThroughputSettingResource, please refer to the document of MongoDBCollectionThroughputSettingResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - string collectionName = "collectionName"; - ResourceIdentifier mongoDBCollectionThroughputSettingResourceId = MongoDBCollectionThroughputSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName, collectionName); - MongoDBCollectionThroughputSettingResource mongoDBCollectionThroughputSetting = client.GetMongoDBCollectionThroughputSettingResource(mongoDBCollectionThroughputSettingResourceId); - - // invoke the operation - RetrieveThroughputParameters retrieveThroughputParameters = new RetrieveThroughputParameters(new AzureLocation("placeholder"), new RetrieveThroughputPropertiesResource(new WritableSubResource[] - { -new WritableSubResource() -{ -Id = new ResourceIdentifier("0"), -},new WritableSubResource() -{ -Id = new ResourceIdentifier("1"), -} - })); - ArmOperation lro = await mongoDBCollectionThroughputSetting.MongoDBContainerRetrieveThroughputDistributionAsync(WaitUntil.Completed, retrieveThroughputParameters); - PhysicalPartitionThroughputInfoResult result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } - - // CosmosDBMongoDBCollectionRedistributeThroughput - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task MongoDBContainerRedistributeThroughput_CosmosDBMongoDBCollectionRedistributeThroughput() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBCollectionRedistributeThroughput.json - // this example is just showing the usage of "MongoDBResources_MongoDBContainerRedistributeThroughput" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MongoDBCollectionThroughputSettingResource created on azure - // for more information of creating MongoDBCollectionThroughputSettingResource, please refer to the document of MongoDBCollectionThroughputSettingResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - string collectionName = "collectionName"; - ResourceIdentifier mongoDBCollectionThroughputSettingResourceId = MongoDBCollectionThroughputSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName, collectionName); - MongoDBCollectionThroughputSettingResource mongoDBCollectionThroughputSetting = client.GetMongoDBCollectionThroughputSettingResource(mongoDBCollectionThroughputSettingResourceId); - - // invoke the operation - RedistributeThroughputParameters redistributeThroughputParameters = new RedistributeThroughputParameters(new AzureLocation("placeholder"), new RedistributeThroughputPropertiesResource(ThroughputPolicyType.Custom, new PhysicalPartitionThroughputInfoResource[] - { -new PhysicalPartitionThroughputInfoResource("0") -{ -Throughput = 5000, -},new PhysicalPartitionThroughputInfoResource("1") -{ -Throughput = 5000, -} - }, new PhysicalPartitionThroughputInfoResource[] - { -new PhysicalPartitionThroughputInfoResource("2") -{ -Throughput = 5000, -},new PhysicalPartitionThroughputInfoResource("3") - })); - ArmOperation lro = await mongoDBCollectionThroughputSetting.MongoDBContainerRedistributeThroughputAsync(WaitUntil.Completed, redistributeThroughputParameters); - PhysicalPartitionThroughputInfoResult result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } - // CosmosDBMongoDBCollectionThroughputGet [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBMongoDBCollectionThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBCollectionThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMongoDBCollectionThroughputGet.json // this example is just showing the usage of "MongoDBResources_GetMongoDBCollectionThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -140,7 +53,7 @@ public async Task Get_CosmosDBMongoDBCollectionThroughputGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBMongoDBCollectionThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBCollectionThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMongoDBCollectionThroughputUpdate.json // this example is just showing the usage of "MongoDBResources_UpdateMongoDBCollectionThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -183,7 +96,7 @@ public async Task CreateOrUpdate_CosmosDBMongoDBCollectionThroughputUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateMongoDBCollectionToAutoscale_CosmosDBMongoDBCollectionMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBCollectionMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMongoDBCollectionMigrateToAutoscale.json // this example is just showing the usage of "MongoDBResources_MigrateMongoDBCollectionToAutoscale" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -217,7 +130,7 @@ public async Task MigrateMongoDBCollectionToAutoscale_CosmosDBMongoDBCollectionM [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateMongoDBCollectionToManualThroughput_CosmosDBMongoDBCollectionMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBCollectionMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMongoDBCollectionMigrateToManualThroughput.json // this example is just showing the usage of "MongoDBResources_MigrateMongoDBCollectionToManualThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseCollection.cs index 34712fe099f6..0268ff335580 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoDBDatabaseCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBMongoDBDatabaseList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBDatabaseList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMongoDBDatabaseList.json // this example is just showing the usage of "MongoDBResources_ListMongoDBDatabases" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task GetAll_CosmosDBMongoDBDatabaseList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBMongoDBDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMongoDBDatabaseGet.json // this example is just showing the usage of "MongoDBResources_GetMongoDBDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task Get_CosmosDBMongoDBDatabaseGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBMongoDBDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMongoDBDatabaseGet.json // this example is just showing the usage of "MongoDBResources_GetMongoDBDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +123,7 @@ public async Task Exists_CosmosDBMongoDBDatabaseGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBMongoDBDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMongoDBDatabaseGet.json // this example is just showing the usage of "MongoDBResources_GetMongoDBDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +166,7 @@ public async Task GetIfExists_CosmosDBMongoDBDatabaseGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBMongoDBDatabaseCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBDatabaseCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMongoDBDatabaseCreateUpdate.json // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoDBDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -203,57 +203,5 @@ public async Task CreateOrUpdate_CosmosDBMongoDBDatabaseCreateUpdate() // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - - // CosmosDBMongoDBDatabaseRestore - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CosmosDBMongoDBDatabaseRestore() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBDatabaseRestore.json - // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoDBDatabase" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBAccountResource created on azure - // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this MongoDBDatabaseResource - MongoDBDatabaseCollection collection = cosmosDBAccount.GetMongoDBDatabases(); - - // invoke the operation - string databaseName = "databaseName"; - MongoDBDatabaseCreateOrUpdateContent content = new MongoDBDatabaseCreateOrUpdateContent(new AzureLocation("West US"), new MongoDBDatabaseResourceInfo("databaseName") - { - RestoreParameters = new ResourceRestoreParameters() - { - RestoreSource = "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId", - RestoreTimestampInUtc = DateTimeOffset.Parse("2022-07-20T18:28:00Z"), - IsRestoreWithTtlDisabled = false, - }, - CreateMode = CosmosDBAccountCreateMode.Restore, - }) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = -{ -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, databaseName, content); - MongoDBDatabaseResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - MongoDBDatabaseData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseResource.cs index 742b554179f4..420ceaf55149 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoDBDatabaseResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBMongoDBDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMongoDBDatabaseGet.json // this example is just showing the usage of "MongoDBResources_GetMongoDBDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBMongoDBDatabaseGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBMongoDBDatabaseCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBDatabaseCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMongoDBDatabaseCreateUpdate.json // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoDBDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -87,61 +87,12 @@ public async Task Update_CosmosDBMongoDBDatabaseCreateUpdate() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - // CosmosDBMongoDBDatabaseRestore - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CosmosDBMongoDBDatabaseRestore() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBDatabaseRestore.json - // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoDBDatabase" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MongoDBDatabaseResource created on azure - // for more information of creating MongoDBDatabaseResource, please refer to the document of MongoDBDatabaseResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - ResourceIdentifier mongoDBDatabaseResourceId = MongoDBDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName); - MongoDBDatabaseResource mongoDBDatabase = client.GetMongoDBDatabaseResource(mongoDBDatabaseResourceId); - - // invoke the operation - MongoDBDatabaseCreateOrUpdateContent content = new MongoDBDatabaseCreateOrUpdateContent(new AzureLocation("West US"), new MongoDBDatabaseResourceInfo("databaseName") - { - RestoreParameters = new ResourceRestoreParameters() - { - RestoreSource = "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId", - RestoreTimestampInUtc = DateTimeOffset.Parse("2022-07-20T18:28:00Z"), - IsRestoreWithTtlDisabled = false, - }, - CreateMode = CosmosDBAccountCreateMode.Restore, - }) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = -{ -}, - }; - ArmOperation lro = await mongoDBDatabase.UpdateAsync(WaitUntil.Completed, content); - MongoDBDatabaseResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - MongoDBDatabaseData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - // CosmosDBMongoDBDatabaseDelete [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBMongoDBDatabaseDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBDatabaseDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMongoDBDatabaseDelete.json // this example is just showing the usage of "MongoDBResources_DeleteMongoDBDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -163,38 +114,5 @@ public async Task Delete_CosmosDBMongoDBDatabaseDelete() Console.WriteLine($"Succeeded"); } - - // CosmosDBMongoDBDatabasePartitionMerge - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task MongoDBDatabasePartitionMerge_CosmosDBMongoDBDatabasePartitionMerge() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBDatabasePartitionMerge.json - // this example is just showing the usage of "MongoDBResources_MongoDBDatabasePartitionMerge" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MongoDBDatabaseResource created on azure - // for more information of creating MongoDBDatabaseResource, please refer to the document of MongoDBDatabaseResource - string subscriptionId = "subid"; - string resourceGroupName = "rgName"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - ResourceIdentifier mongoDBDatabaseResourceId = MongoDBDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName); - MongoDBDatabaseResource mongoDBDatabase = client.GetMongoDBDatabaseResource(mongoDBDatabaseResourceId); - - // invoke the operation - MergeParameters mergeParameters = new MergeParameters() - { - IsDryRun = false, - }; - ArmOperation lro = await mongoDBDatabase.MongoDBDatabasePartitionMergeAsync(WaitUntil.Completed, mergeParameters); - PhysicalPartitionStorageInfoCollection result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseThroughputSettingResource.cs index 03ef8b9df4fc..68b7647a03c8 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseThroughputSettingResource.cs @@ -10,7 +10,6 @@ using Azure.Core; using Azure.Identity; using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.CosmosDB.Samples { @@ -21,7 +20,7 @@ public partial class Sample_MongoDBDatabaseThroughputSettingResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBMongoDBDatabaseThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBDatabaseThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMongoDBDatabaseThroughputGet.json // this example is just showing the usage of "MongoDBResources_GetMongoDBDatabaseThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +52,7 @@ public async Task Get_CosmosDBMongoDBDatabaseThroughputGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBMongoDBDatabaseThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBDatabaseThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMongoDBDatabaseThroughputUpdate.json // this example is just showing the usage of "MongoDBResources_UpdateMongoDBDatabaseThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -95,7 +94,7 @@ public async Task CreateOrUpdate_CosmosDBMongoDBDatabaseThroughputUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateMongoDBDatabaseToAutoscale_CosmosDBMongoDBDatabaseMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBDatabaseMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMongoDBDatabaseMigrateToAutoscale.json // this example is just showing the usage of "MongoDBResources_MigrateMongoDBDatabaseToAutoscale" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -128,7 +127,7 @@ public async Task MigrateMongoDBDatabaseToAutoscale_CosmosDBMongoDBDatabaseMigra [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateMongoDBDatabaseToManualThroughput_CosmosDBMongoDBDatabaseMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBDatabaseMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMongoDBDatabaseMigrateToManualThroughput.json // this example is just showing the usage of "MongoDBResources_MigrateMongoDBDatabaseToManualThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -155,89 +154,5 @@ public async Task MigrateMongoDBDatabaseToManualThroughput_CosmosDBMongoDBDataba // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - - // CosmosDBMongoDBDatabaseRetrieveThroughputDistribution - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task MongoDBDatabaseRetrieveThroughputDistribution_CosmosDBMongoDBDatabaseRetrieveThroughputDistribution() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBDatabaseRetrieveThroughputDistribution.json - // this example is just showing the usage of "MongoDBResources_MongoDBDatabaseRetrieveThroughputDistribution" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MongoDBDatabaseThroughputSettingResource created on azure - // for more information of creating MongoDBDatabaseThroughputSettingResource, please refer to the document of MongoDBDatabaseThroughputSettingResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - ResourceIdentifier mongoDBDatabaseThroughputSettingResourceId = MongoDBDatabaseThroughputSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName); - MongoDBDatabaseThroughputSettingResource mongoDBDatabaseThroughputSetting = client.GetMongoDBDatabaseThroughputSettingResource(mongoDBDatabaseThroughputSettingResourceId); - - // invoke the operation - RetrieveThroughputParameters retrieveThroughputParameters = new RetrieveThroughputParameters(new AzureLocation("placeholder"), new RetrieveThroughputPropertiesResource(new WritableSubResource[] - { -new WritableSubResource() -{ -Id = new ResourceIdentifier("0"), -},new WritableSubResource() -{ -Id = new ResourceIdentifier("1"), -} - })); - ArmOperation lro = await mongoDBDatabaseThroughputSetting.MongoDBDatabaseRetrieveThroughputDistributionAsync(WaitUntil.Completed, retrieveThroughputParameters); - PhysicalPartitionThroughputInfoResult result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } - - // CosmosDBMongoDBDatabaseRedistributeThroughput - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task MongoDBDatabaseRedistributeThroughput_CosmosDBMongoDBDatabaseRedistributeThroughput() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBDatabaseRedistributeThroughput.json - // this example is just showing the usage of "MongoDBResources_MongoDBDatabaseRedistributeThroughput" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MongoDBDatabaseThroughputSettingResource created on azure - // for more information of creating MongoDBDatabaseThroughputSettingResource, please refer to the document of MongoDBDatabaseThroughputSettingResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - ResourceIdentifier mongoDBDatabaseThroughputSettingResourceId = MongoDBDatabaseThroughputSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName); - MongoDBDatabaseThroughputSettingResource mongoDBDatabaseThroughputSetting = client.GetMongoDBDatabaseThroughputSettingResource(mongoDBDatabaseThroughputSettingResourceId); - - // invoke the operation - RedistributeThroughputParameters redistributeThroughputParameters = new RedistributeThroughputParameters(new AzureLocation("placeholder"), new RedistributeThroughputPropertiesResource(ThroughputPolicyType.Custom, new PhysicalPartitionThroughputInfoResource[] - { -new PhysicalPartitionThroughputInfoResource("0") -{ -Throughput = 5000, -},new PhysicalPartitionThroughputInfoResource("1") -{ -Throughput = 5000, -} - }, new PhysicalPartitionThroughputInfoResource[] - { -new PhysicalPartitionThroughputInfoResource("2") -{ -Throughput = 5000, -},new PhysicalPartitionThroughputInfoResource("3") - })); - ArmOperation lro = await mongoDBDatabaseThroughputSetting.MongoDBDatabaseRedistributeThroughputAsync(WaitUntil.Completed, redistributeThroughputParameters); - PhysicalPartitionThroughputInfoResult result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBRoleDefinitionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBRoleDefinitionCollection.cs index 419545b961ae..bce47c9046ca 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBRoleDefinitionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBRoleDefinitionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoDBRoleDefinitionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBMongoRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMongoDBRoleDefinitionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +55,7 @@ public async Task Get_CosmosDBMongoRoleDefinitionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBMongoRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMongoDBRoleDefinitionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +86,7 @@ public async Task Exists_CosmosDBMongoRoleDefinitionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBMongoRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMongoDBRoleDefinitionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -129,7 +129,7 @@ public async Task GetIfExists_CosmosDBMongoRoleDefinitionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBMongoDBRoleDefinitionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBRoleDefinitionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMongoDBRoleDefinitionCreateUpdate.json // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -193,7 +193,7 @@ public async Task CreateOrUpdate_CosmosDBMongoDBRoleDefinitionCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBMongoDBRoleDefinitionList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBRoleDefinitionList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMongoDBRoleDefinitionList.json // this example is just showing the usage of "MongoDBResources_ListMongoRoleDefinitions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBRoleDefinitionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBRoleDefinitionResource.cs index 8e74227a62d8..8177529af243 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBRoleDefinitionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBRoleDefinitionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoDBRoleDefinitionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBMongoRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMongoDBRoleDefinitionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBMongoRoleDefinitionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBMongoDBRoleDefinitionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBRoleDefinitionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMongoDBRoleDefinitionCreateUpdate.json // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -113,7 +113,7 @@ public async Task Update_CosmosDBMongoDBRoleDefinitionCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBMongoDBRoleDefinitionDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBRoleDefinitionDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMongoDBRoleDefinitionDelete.json // this example is just showing the usage of "MongoDBResources_DeleteMongoRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBUserDefinitionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBUserDefinitionCollection.cs index 4a56ca47e34c..b6916d26c380 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBUserDefinitionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBUserDefinitionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoDBUserDefinitionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBMongoDBUserDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBUserDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMongoDBUserDefinitionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoUserDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +55,7 @@ public async Task Get_CosmosDBMongoDBUserDefinitionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBMongoDBUserDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBUserDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMongoDBUserDefinitionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoUserDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +86,7 @@ public async Task Exists_CosmosDBMongoDBUserDefinitionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBMongoDBUserDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBUserDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMongoDBUserDefinitionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoUserDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -129,7 +129,7 @@ public async Task GetIfExists_CosmosDBMongoDBUserDefinitionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBMongoDBUserDefinitionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBUserDefinitionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMongoDBUserDefinitionCreateUpdate.json // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoUserDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -181,7 +181,7 @@ public async Task CreateOrUpdate_CosmosDBMongoDBUserDefinitionCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBMongoDBUserDefinitionList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBUserDefinitionList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMongoDBUserDefinitionList.json // this example is just showing the usage of "MongoDBResources_ListMongoUserDefinitions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBUserDefinitionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBUserDefinitionResource.cs index 33ae7a4ab1f4..04f96fbee2ff 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBUserDefinitionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBUserDefinitionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoDBUserDefinitionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBMongoDBUserDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBUserDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMongoDBUserDefinitionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoUserDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBMongoDBUserDefinitionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBMongoDBUserDefinitionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBUserDefinitionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMongoDBUserDefinitionCreateUpdate.json // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoUserDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -101,7 +101,7 @@ public async Task Update_CosmosDBMongoDBUserDefinitionCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBMongoDBUserDefinitionDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBUserDefinitionDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBMongoDBUserDefinitionDelete.json // this example is just showing the usage of "MongoDBResources_DeleteMongoUserDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationCollection.cs deleted file mode 100644 index f2e5f483e08f..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationCollection.cs +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; - -namespace Azure.ResourceManager.CosmosDB.Samples -{ - public partial class Sample_NetworkSecurityPerimeterConfigurationCollection - { - // NamspaceNetworkSecurityPerimeterConfigurationList - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_NamspaceNetworkSecurityPerimeterConfigurationList() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/NetworkSecurityPerimeterConfigurationList.json - // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_List" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBAccountResource created on azure - // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "res4410"; - string accountName = "cosmosTest"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this NetworkSecurityPerimeterConfigurationResource - NetworkSecurityPerimeterConfigurationCollection collection = cosmosDBAccount.GetNetworkSecurityPerimeterConfigurations(); - - // invoke the operation and iterate over the result - await foreach (NetworkSecurityPerimeterConfigurationResource item in collection.GetAllAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - NetworkSecurityPerimeterConfigurationData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // NamspaceNetworkSecurityPerimeterConfigurationList - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_NamspaceNetworkSecurityPerimeterConfigurationList() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/NetworkSecurityPerimeterConfigurationGet.json - // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBAccountResource created on azure - // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "res4410"; - string accountName = "cosmosTest"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this NetworkSecurityPerimeterConfigurationResource - NetworkSecurityPerimeterConfigurationCollection collection = cosmosDBAccount.GetNetworkSecurityPerimeterConfigurations(); - - // invoke the operation - string networkSecurityPerimeterConfigurationName = "dbedb4e0-40e6-4145-81f3-f1314c150774.resourceAssociation1"; - NetworkSecurityPerimeterConfigurationResource result = await collection.GetAsync(networkSecurityPerimeterConfigurationName); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - NetworkSecurityPerimeterConfigurationData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // NamspaceNetworkSecurityPerimeterConfigurationList - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_NamspaceNetworkSecurityPerimeterConfigurationList() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/NetworkSecurityPerimeterConfigurationGet.json - // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBAccountResource created on azure - // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "res4410"; - string accountName = "cosmosTest"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this NetworkSecurityPerimeterConfigurationResource - NetworkSecurityPerimeterConfigurationCollection collection = cosmosDBAccount.GetNetworkSecurityPerimeterConfigurations(); - - // invoke the operation - string networkSecurityPerimeterConfigurationName = "dbedb4e0-40e6-4145-81f3-f1314c150774.resourceAssociation1"; - bool result = await collection.ExistsAsync(networkSecurityPerimeterConfigurationName); - - Console.WriteLine($"Succeeded: {result}"); - } - - // NamspaceNetworkSecurityPerimeterConfigurationList - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetIfExists_NamspaceNetworkSecurityPerimeterConfigurationList() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/NetworkSecurityPerimeterConfigurationGet.json - // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBAccountResource created on azure - // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "res4410"; - string accountName = "cosmosTest"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this NetworkSecurityPerimeterConfigurationResource - NetworkSecurityPerimeterConfigurationCollection collection = cosmosDBAccount.GetNetworkSecurityPerimeterConfigurations(); - - // invoke the operation - string networkSecurityPerimeterConfigurationName = "dbedb4e0-40e6-4145-81f3-f1314c150774.resourceAssociation1"; - NullableResponse response = await collection.GetIfExistsAsync(networkSecurityPerimeterConfigurationName); - NetworkSecurityPerimeterConfigurationResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine($"Succeeded with null as result"); - } - else - { - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - NetworkSecurityPerimeterConfigurationData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationResource.cs deleted file mode 100644 index 499970937a60..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationResource.cs +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; - -namespace Azure.ResourceManager.CosmosDB.Samples -{ - public partial class Sample_NetworkSecurityPerimeterConfigurationResource - { - // NamspaceNetworkSecurityPerimeterConfigurationList - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_NamspaceNetworkSecurityPerimeterConfigurationList() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/NetworkSecurityPerimeterConfigurationGet.json - // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this NetworkSecurityPerimeterConfigurationResource created on azure - // for more information of creating NetworkSecurityPerimeterConfigurationResource, please refer to the document of NetworkSecurityPerimeterConfigurationResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "res4410"; - string accountName = "cosmosTest"; - string networkSecurityPerimeterConfigurationName = "dbedb4e0-40e6-4145-81f3-f1314c150774.resourceAssociation1"; - ResourceIdentifier networkSecurityPerimeterConfigurationResourceId = NetworkSecurityPerimeterConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, networkSecurityPerimeterConfigurationName); - NetworkSecurityPerimeterConfigurationResource networkSecurityPerimeterConfiguration = client.GetNetworkSecurityPerimeterConfigurationResource(networkSecurityPerimeterConfigurationResourceId); - - // invoke the operation - NetworkSecurityPerimeterConfigurationResource result = await networkSecurityPerimeterConfiguration.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - NetworkSecurityPerimeterConfigurationData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // NetworkSecurityPerimeterConfigurationList - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Reconcile_NetworkSecurityPerimeterConfigurationList() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/NetworkSecurityPerimeterConfigurationReconcile.json - // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_Reconcile" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this NetworkSecurityPerimeterConfigurationResource created on azure - // for more information of creating NetworkSecurityPerimeterConfigurationResource, please refer to the document of NetworkSecurityPerimeterConfigurationResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "res4410"; - string accountName = "sto8607"; - string networkSecurityPerimeterConfigurationName = "dbedb4e0-40e6-4145-81f3-f1314c150774.resourceAssociation1"; - ResourceIdentifier networkSecurityPerimeterConfigurationResourceId = NetworkSecurityPerimeterConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, networkSecurityPerimeterConfigurationName); - NetworkSecurityPerimeterConfigurationResource networkSecurityPerimeterConfiguration = client.GetNetworkSecurityPerimeterConfigurationResource(networkSecurityPerimeterConfigurationResourceId); - - // invoke the operation - await networkSecurityPerimeterConfiguration.ReconcileAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_RestorableCosmosDBAccountCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_RestorableCosmosDBAccountCollection.cs index 599aada1bad0..0063b7b9df95 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_RestorableCosmosDBAccountCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_RestorableCosmosDBAccountCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_RestorableCosmosDBAccountCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBRestorableDatabaseAccountList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBRestorableDatabaseAccountList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBRestorableDatabaseAccountList.json // this example is just showing the usage of "RestorableDatabaseAccounts_ListByLocation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +55,7 @@ public async Task GetAll_CosmosDBRestorableDatabaseAccountList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBRestorableDatabaseAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBRestorableDatabaseAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBRestorableDatabaseAccountGet.json // this example is just showing the usage of "RestorableDatabaseAccounts_GetByLocation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -89,7 +89,7 @@ public async Task Get_CosmosDBRestorableDatabaseAccountGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBRestorableDatabaseAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBRestorableDatabaseAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBRestorableDatabaseAccountGet.json // this example is just showing the usage of "RestorableDatabaseAccounts_GetByLocation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -119,7 +119,7 @@ public async Task Exists_CosmosDBRestorableDatabaseAccountGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBRestorableDatabaseAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBRestorableDatabaseAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBRestorableDatabaseAccountGet.json // this example is just showing the usage of "RestorableDatabaseAccounts_GetByLocation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_RestorableCosmosDBAccountResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_RestorableCosmosDBAccountResource.cs index 16b18f528d9c..3d280d9511fc 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_RestorableCosmosDBAccountResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_RestorableCosmosDBAccountResource.cs @@ -21,7 +21,7 @@ public partial class Sample_RestorableCosmosDBAccountResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetRestorableCosmosDBAccounts_CosmosDBRestorableDatabaseAccountNoLocationList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBRestorableDatabaseAccountNoLocationList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBRestorableDatabaseAccountNoLocationList.json // this example is just showing the usage of "RestorableDatabaseAccounts_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task GetRestorableCosmosDBAccounts_CosmosDBRestorableDatabaseAccoun [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBRestorableDatabaseAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBRestorableDatabaseAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBRestorableDatabaseAccountGet.json // this example is just showing the usage of "RestorableDatabaseAccounts_GetByLocation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -84,7 +84,7 @@ public async Task Get_CosmosDBRestorableDatabaseAccountGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetRestorableSqlDatabases_CosmosDBRestorableSqlDatabaseList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBRestorableSqlDatabaseList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBRestorableSqlDatabaseList.json // this example is just showing the usage of "RestorableSqlDatabases_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -114,7 +114,7 @@ public async Task GetRestorableSqlDatabases_CosmosDBRestorableSqlDatabaseList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetRestorableSqlContainers_CosmosDBRestorableSqlContainerList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBRestorableSqlContainerList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBRestorableSqlContainerList.json // this example is just showing the usage of "RestorableSqlContainers_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -145,7 +145,7 @@ public async Task GetRestorableSqlContainers_CosmosDBRestorableSqlContainerList( [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAllRestorableSqlResourceData_CosmosDBRestorableSqlResourceList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBRestorableSqlResourceList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBRestorableSqlResourceList.json // this example is just showing the usage of "RestorableSqlResources_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -177,7 +177,7 @@ public async Task GetAllRestorableSqlResourceData_CosmosDBRestorableSqlResourceL [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetRestorableMongoDBDatabases_CosmosDBRestorableMongodbDatabaseList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBRestorableMongodbDatabaseList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBRestorableMongodbDatabaseList.json // this example is just showing the usage of "RestorableMongodbDatabases_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -207,7 +207,7 @@ public async Task GetRestorableMongoDBDatabases_CosmosDBRestorableMongodbDatabas [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetRestorableMongoDBCollections_CosmosDBRestorableMongodbCollectionList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBRestorableMongodbCollectionList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBRestorableMongodbCollectionList.json // this example is just showing the usage of "RestorableMongodbCollections_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -238,7 +238,7 @@ public async Task GetRestorableMongoDBCollections_CosmosDBRestorableMongodbColle [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAllRestorableMongoDBResourceData_CosmosDBRestorableMongodbResourceList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBRestorableMongodbResourceList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBRestorableMongodbResourceList.json // this example is just showing the usage of "RestorableMongodbResources_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -270,7 +270,7 @@ public async Task GetAllRestorableMongoDBResourceData_CosmosDBRestorableMongodbR [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetRestorableGremlinDatabases_CosmosDBRestorableGremlinDatabaseList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBRestorableGremlinDatabaseList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBRestorableGremlinDatabaseList.json // this example is just showing the usage of "RestorableGremlinDatabases_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -300,7 +300,7 @@ public async Task GetRestorableGremlinDatabases_CosmosDBRestorableGremlinDatabas [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetRestorableGremlinGraphs_CosmosDBRestorableGremlinGraphList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBRestorableGremlinGraphList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBRestorableGremlinGraphList.json // this example is just showing the usage of "RestorableGremlinGraphs_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -331,7 +331,7 @@ public async Task GetRestorableGremlinGraphs_CosmosDBRestorableGremlinGraphList( [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetRestorableGremlinResources_CosmosDBRestorableGremlinResourceList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBRestorableGremlinResourceList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBRestorableGremlinResourceList.json // this example is just showing the usage of "RestorableGremlinResources_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -363,7 +363,7 @@ public async Task GetRestorableGremlinResources_CosmosDBRestorableGremlinResourc [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetRestorableTables_CosmosDBRestorableTableList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBRestorableTableList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBRestorableTableList.json // this example is just showing the usage of "RestorableTables_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -393,7 +393,7 @@ public async Task GetRestorableTables_CosmosDBRestorableTableList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetRestorableTableResources_CosmosDBRestorableTableResourceList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBRestorableTableResourceList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/examples/CosmosDBRestorableTableResourceList.json // this example is just showing the usage of "RestorableTableResources_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ArmCosmosDBModelFactory.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ArmCosmosDBModelFactory.cs index 49fc8fcdd8f2..b617d06647d1 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ArmCosmosDBModelFactory.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ArmCosmosDBModelFactory.cs @@ -10,81 +10,12 @@ using System.Linq; using Azure.Core; using Azure.ResourceManager.Models; -using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.CosmosDB.Models { /// Model factory for models. public static partial class ArmCosmosDBModelFactory { - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Network security configuration properties. - /// A new instance for mocking. - public static NetworkSecurityPerimeterConfigurationData NetworkSecurityPerimeterConfigurationData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, NetworkSecurityPerimeterConfigurationProperties properties = null) - { - return new NetworkSecurityPerimeterConfigurationData( - id, - name, - resourceType, - systemData, - properties, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Provisioning state of a network security perimeter configuration that is being created or updated. - /// List of provisioning issues, if any. - /// Information about a network security perimeter (NSP). - /// Information about resource association. - /// Network security perimeter configuration profile. - /// A new instance for mocking. - public static NetworkSecurityPerimeterConfigurationProperties NetworkSecurityPerimeterConfigurationProperties(NetworkSecurityPerimeterConfigurationProvisioningState? provisioningState = null, IEnumerable provisioningIssues = null, NetworkSecurityPerimeter networkSecurityPerimeter = null, ResourceAssociation resourceAssociation = null, NetworkSecurityProfile profile = null) - { - provisioningIssues ??= new List(); - - return new NetworkSecurityPerimeterConfigurationProperties( - provisioningState, - provisioningIssues?.ToList(), - networkSecurityPerimeter, - resourceAssociation, - profile, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Name of the issue. - /// Details of a provisioning issue for a network security perimeter (NSP) configuration. Resource providers should generate separate provisioning issue elements for each separate issue detected, and include a meaningful and distinctive description, as well as any appropriate suggestedResourceIds and suggestedAccessRules. - /// A new instance for mocking. - public static ProvisioningIssue ProvisioningIssue(string name = null, ProvisioningIssueProperties properties = null) - { - return new ProvisioningIssue(name, properties, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Type of issue. - /// Severity of the issue. - /// Description of the issue. - /// Fully qualified resource IDs of suggested resources that can be associated to the network security perimeter (NSP) to remediate the issue. - /// Access rules that can be added to the network security profile (NSP) to remediate the issue. - /// A new instance for mocking. - public static ProvisioningIssueProperties ProvisioningIssueProperties(IssueType? issueType = null, Severity? severity = null, string description = null, IEnumerable suggestedResourceIds = null, IEnumerable suggestedAccessRules = null) - { - suggestedResourceIds ??= new List(); - suggestedAccessRules ??= new List(); - - return new ProvisioningIssueProperties( - issueType, - severity, - description, - suggestedResourceIds?.ToList(), - suggestedAccessRules?.ToList(), - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The id. /// The name. @@ -93,6 +24,7 @@ public static ProvisioningIssueProperties ProvisioningIssueProperties(IssueType? /// The tags. /// The location. /// Indicates the type of database account. This can only be set at database account creation. + /// Identity for the resource. /// The status of the Cosmos DB account at the time the operation was called. The status can be one of following. 'Creating' – the Cosmos DB account is being created. When an account is in Creating state, only properties that are specified as input for the Create Cosmos DB account operation are returned. 'Succeeded' – the Cosmos DB account is active for use. 'Updating' – the Cosmos DB account is being updated. 'Deleting' – the Cosmos DB account is being deleted. 'Failed' – the Cosmos DB account failed creation. 'DeletionFailed' – the Cosmos DB account deletion failed. /// The connection endpoint for the Cosmos DB database account. /// The offer type for the Cosmos DB database account. Default value: Standard. @@ -129,23 +61,15 @@ public static ProvisioningIssueProperties ProvisioningIssueProperties(IssueType? /// The CORS policy for the Cosmos DB database account. /// Indicates what services are allowed to bypass firewall checks. /// An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. - /// The Object representing the different Diagnostic log settings for the Cosmos DB Account. /// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. /// The object that represents all properties related to capacity enforcement on an account. - /// Indicates the capacityMode of the Cosmos DB account. - /// The object that represents the migration state for the CapacityMode of the Cosmos DB account. - /// Flag to indicate whether to enable MaterializedViews on the Cosmos DB account. /// The object that represents the metadata for the Account Keys of the Cosmos DB account. /// Flag to indicate enabling/disabling of Partition Merge feature on the account. - /// Flag to indicate enabling/disabling of Burst Capacity Preview feature on the account. - /// Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. + /// Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. + /// Flag to indicate enabling/disabling of Burst Capacity feature on the account. /// Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides troubleshooting guidance. - /// Flag to indicate enabling/disabling of Priority Based Execution Preview feature on the account. - /// Enum to indicate default Priority Level of request for Priority Based Execution. - /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account. - /// Identity for the resource. /// A new instance for mocking. - public static CosmosDBAccountData CosmosDBAccountData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBAccountKind? kind = null, string provisioningState = null, string documentEndpoint = null, CosmosDBAccountOfferType? databaseAccountOfferType = null, IEnumerable ipRules = null, bool? isVirtualNetworkFilterEnabled = null, bool? enableAutomaticFailover = null, ConsistencyPolicy consistencyPolicy = null, IEnumerable capabilities = null, IEnumerable writeLocations = null, IEnumerable readLocations = null, IEnumerable locations = null, IEnumerable failoverPolicies = null, IEnumerable virtualNetworkRules = null, IEnumerable privateEndpointConnections = null, bool? enableMultipleWriteLocations = null, bool? enableCassandraConnector = null, ConnectorOffer? connectorOffer = null, bool? disableKeyBasedMetadataWriteAccess = null, Uri keyVaultKeyUri = null, string defaultIdentity = null, CosmosDBPublicNetworkAccess? publicNetworkAccess = null, bool? isFreeTierEnabled = null, CosmosDBServerVersion? apiServerVersion = null, bool? isAnalyticalStorageEnabled = null, AnalyticalStorageSchemaType? analyticalStorageSchemaType = null, Guid? instanceId = null, CosmosDBAccountCreateMode? createMode = null, CosmosDBAccountRestoreParameters restoreParameters = null, CosmosDBAccountBackupPolicy backupPolicy = null, IEnumerable cors = null, NetworkAclBypass? networkAclBypass = null, IEnumerable networkAclBypassResourceIds = null, EnableFullTextQuery? diagnosticLogEnableFullTextQuery = null, bool? disableLocalAuth = null, int? capacityTotalThroughputLimit = null, CapacityMode? capacityMode = null, CapacityModeChangeTransitionState capacityModeChangeTransitionState = null, bool? enableMaterializedViews = null, DatabaseAccountKeysMetadata keysMetadata = null, bool? enablePartitionMerge = null, bool? enableBurstCapacity = null, CosmosDBMinimalTlsVersion? minimalTlsVersion = null, string customerManagedKeyStatus = null, bool? enablePriorityBasedExecution = null, DefaultPriorityLevel? defaultPriorityLevel = null, bool? enablePerRegionPerPartitionAutoscale = null, ManagedServiceIdentity identity = null) + public static CosmosDBAccountData CosmosDBAccountData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBAccountKind? kind = null, ManagedServiceIdentity identity = null, string provisioningState = null, string documentEndpoint = null, CosmosDBAccountOfferType? databaseAccountOfferType = null, IEnumerable ipRules = null, bool? isVirtualNetworkFilterEnabled = null, bool? enableAutomaticFailover = null, ConsistencyPolicy consistencyPolicy = null, IEnumerable capabilities = null, IEnumerable writeLocations = null, IEnumerable readLocations = null, IEnumerable locations = null, IEnumerable failoverPolicies = null, IEnumerable virtualNetworkRules = null, IEnumerable privateEndpointConnections = null, bool? enableMultipleWriteLocations = null, bool? enableCassandraConnector = null, ConnectorOffer? connectorOffer = null, bool? disableKeyBasedMetadataWriteAccess = null, Uri keyVaultKeyUri = null, string defaultIdentity = null, CosmosDBPublicNetworkAccess? publicNetworkAccess = null, bool? isFreeTierEnabled = null, CosmosDBServerVersion? apiServerVersion = null, bool? isAnalyticalStorageEnabled = null, AnalyticalStorageSchemaType? analyticalStorageSchemaType = null, Guid? instanceId = null, CosmosDBAccountCreateMode? createMode = null, CosmosDBAccountRestoreParameters restoreParameters = null, CosmosDBAccountBackupPolicy backupPolicy = null, IEnumerable cors = null, NetworkAclBypass? networkAclBypass = null, IEnumerable networkAclBypassResourceIds = null, bool? disableLocalAuth = null, int? capacityTotalThroughputLimit = null, DatabaseAccountKeysMetadata keysMetadata = null, bool? enablePartitionMerge = null, CosmosDBMinimalTlsVersion? minimalTlsVersion = null, bool? enableBurstCapacity = null, string customerManagedKeyStatus = null) { tags ??= new Dictionary(); ipRules ??= new List(); @@ -167,6 +91,7 @@ public static CosmosDBAccountData CosmosDBAccountData(ResourceIdentifier id = nu tags, location, kind, + identity, provisioningState, documentEndpoint, databaseAccountOfferType, @@ -199,21 +124,13 @@ public static CosmosDBAccountData CosmosDBAccountData(ResourceIdentifier id = nu cors?.ToList(), networkAclBypass, networkAclBypassResourceIds?.ToList(), - diagnosticLogEnableFullTextQuery != null ? new DiagnosticLogSettings(diagnosticLogEnableFullTextQuery, serializedAdditionalRawData: null) : null, disableLocalAuth, capacityTotalThroughputLimit != null ? new CosmosDBAccountCapacity(capacityTotalThroughputLimit, serializedAdditionalRawData: null) : null, - capacityMode, - capacityModeChangeTransitionState, - enableMaterializedViews, keysMetadata, enablePartitionMerge, - enableBurstCapacity, minimalTlsVersion, + enableBurstCapacity, customerManagedKeyStatus, - enablePriorityBasedExecution, - defaultPriorityLevel, - enablePerRegionPerPartitionAutoscale, - identity, serializedAdditionalRawData: null); } @@ -281,26 +198,6 @@ public static CosmosDBPrivateLinkServiceConnectionStateProperty CosmosDBPrivateL return new CosmosDBPrivateLinkServiceConnectionStateProperty(status, description, actionsRequired, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The transition status of capacity mode. - /// Indicates the current capacity mode of the account. - /// Indicates the previous capacity mode of the account before successful transition. - /// Begin time in UTC of the capacity mode change. - /// End time in UTC of the capacity mode change. - /// End time in UTC of the last successful capacity mode change. - /// A new instance for mocking. - public static CapacityModeChangeTransitionState CapacityModeChangeTransitionState(CapacityModeTransitionStatus? capacityModeTransitionStatus = null, CapacityMode? currentCapacityMode = null, CapacityMode? previousCapacityMode = null, DateTimeOffset? capacityModeTransitionBeginTimestamp = null, DateTimeOffset? capacityModeTransitionEndTimestamp = null, DateTimeOffset? capacityModeLastSuccessfulTransitionEndTimestamp = null) - { - return new CapacityModeChangeTransitionState( - capacityModeTransitionStatus, - currentCapacityMode, - previousCapacityMode, - capacityModeTransitionBeginTimestamp, - capacityModeTransitionEndTimestamp, - capacityModeLastSuccessfulTransitionEndTimestamp, - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The metadata related to the Primary Read-Write Key for the given Cosmos DB database account. /// The metadata related to the Secondary Read-Write Key for the given Cosmos DB database account. @@ -342,21 +239,15 @@ public static DatabaseAccountKeysMetadata DatabaseAccountKeysMetadata(DateTimeOf /// The CORS policy for the Cosmos DB database account. /// Indicates what services are allowed to bypass firewall checks. /// An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. - /// The Object representing the different Diagnostic log settings for the Cosmos DB Account. /// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. /// The object that represents all properties related to capacity enforcement on an account. - /// Indicates the capacityMode of the Cosmos DB account. - /// Flag to indicate whether to enable MaterializedViews on the Cosmos DB account. /// This property is ignored during the update operation, as the metadata is read-only. The object represents the metadata for the Account Keys of the Cosmos DB account. /// Flag to indicate enabling/disabling of Partition Merge feature on the account. - /// Flag to indicate enabling/disabling of Burst Capacity Preview feature on the account. - /// Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. + /// Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. + /// Flag to indicate enabling/disabling of Burst Capacity feature on the account. /// Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides troubleshooting guidance. - /// Flag to indicate enabling/disabling of Priority Based Execution Preview feature on the account. - /// Enum to indicate default Priority Level of request for Priority Based Execution. - /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account. /// A new instance for mocking. - public static CosmosDBAccountPatch CosmosDBAccountPatch(IDictionary tags = null, AzureLocation? location = null, ManagedServiceIdentity identity = null, ConsistencyPolicy consistencyPolicy = null, IEnumerable locations = null, IEnumerable ipRules = null, bool? isVirtualNetworkFilterEnabled = null, bool? enableAutomaticFailover = null, IEnumerable capabilities = null, IEnumerable virtualNetworkRules = null, bool? enableMultipleWriteLocations = null, bool? enableCassandraConnector = null, ConnectorOffer? connectorOffer = null, bool? disableKeyBasedMetadataWriteAccess = null, Uri keyVaultKeyUri = null, string defaultIdentity = null, CosmosDBPublicNetworkAccess? publicNetworkAccess = null, bool? isFreeTierEnabled = null, CosmosDBServerVersion? apiServerVersion = null, bool? isAnalyticalStorageEnabled = null, AnalyticalStorageSchemaType? analyticalStorageSchemaType = null, CosmosDBAccountBackupPolicy backupPolicy = null, IEnumerable cors = null, NetworkAclBypass? networkAclBypass = null, IEnumerable networkAclBypassResourceIds = null, EnableFullTextQuery? diagnosticLogEnableFullTextQuery = null, bool? disableLocalAuth = null, int? capacityTotalThroughputLimit = null, CapacityMode? capacityMode = null, bool? enableMaterializedViews = null, DatabaseAccountKeysMetadata keysMetadata = null, bool? enablePartitionMerge = null, bool? enableBurstCapacity = null, CosmosDBMinimalTlsVersion? minimalTlsVersion = null, string customerManagedKeyStatus = null, bool? enablePriorityBasedExecution = null, DefaultPriorityLevel? defaultPriorityLevel = null, bool? enablePerRegionPerPartitionAutoscale = null) + public static CosmosDBAccountPatch CosmosDBAccountPatch(IDictionary tags = null, AzureLocation? location = null, ManagedServiceIdentity identity = null, ConsistencyPolicy consistencyPolicy = null, IEnumerable locations = null, IEnumerable ipRules = null, bool? isVirtualNetworkFilterEnabled = null, bool? enableAutomaticFailover = null, IEnumerable capabilities = null, IEnumerable virtualNetworkRules = null, bool? enableMultipleWriteLocations = null, bool? enableCassandraConnector = null, ConnectorOffer? connectorOffer = null, bool? disableKeyBasedMetadataWriteAccess = null, Uri keyVaultKeyUri = null, string defaultIdentity = null, CosmosDBPublicNetworkAccess? publicNetworkAccess = null, bool? isFreeTierEnabled = null, CosmosDBServerVersion? apiServerVersion = null, bool? isAnalyticalStorageEnabled = null, AnalyticalStorageSchemaType? analyticalStorageSchemaType = null, CosmosDBAccountBackupPolicy backupPolicy = null, IEnumerable cors = null, NetworkAclBypass? networkAclBypass = null, IEnumerable networkAclBypassResourceIds = null, bool? disableLocalAuth = null, int? capacityTotalThroughputLimit = null, DatabaseAccountKeysMetadata keysMetadata = null, bool? enablePartitionMerge = null, CosmosDBMinimalTlsVersion? minimalTlsVersion = null, bool? enableBurstCapacity = null, string customerManagedKeyStatus = null) { tags ??= new Dictionary(); locations ??= new List(); @@ -392,19 +283,13 @@ public static CosmosDBAccountPatch CosmosDBAccountPatch(IDictionary The tags. /// The location. /// Indicates the type of database account. This can only be set at database account creation. + /// Identity for the resource. /// The consistency policy for the Cosmos DB account. /// An array that contains the georeplication locations enabled for the Cosmos DB account. /// The offer type for the database. @@ -444,23 +330,16 @@ public static CosmosDBAccountPatch CosmosDBAccountPatch(IDictionary The CORS policy for the Cosmos DB database account. /// Indicates what services are allowed to bypass firewall checks. /// An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. - /// The Object representing the different Diagnostic log settings for the Cosmos DB Account. /// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. /// Parameters to indicate the information about the restore. /// The object that represents all properties related to capacity enforcement on an account. - /// Indicates the capacityMode of the Cosmos DB account. - /// Flag to indicate whether to enable MaterializedViews on the Cosmos DB account. /// This property is ignored during the update/create operation, as the metadata is read-only. The object represents the metadata for the Account Keys of the Cosmos DB account. /// Flag to indicate enabling/disabling of Partition Merge feature on the account. - /// Flag to indicate enabling/disabling of Burst Capacity Preview feature on the account. - /// Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. + /// Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. + /// Flag to indicate enabling/disabling of Burst Capacity feature on the account. /// Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides troubleshooting guidance. - /// Flag to indicate enabling/disabling of Priority Based Execution Preview feature on the account. - /// Enum to indicate default Priority Level of request for Priority Based Execution. - /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account. - /// Identity for the resource. /// A new instance for mocking. - public static CosmosDBAccountCreateOrUpdateContent CosmosDBAccountCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBAccountKind? kind = null, ConsistencyPolicy consistencyPolicy = null, IEnumerable locations = null, CosmosDBAccountOfferType databaseAccountOfferType = default, IEnumerable ipRules = null, bool? isVirtualNetworkFilterEnabled = null, bool? enableAutomaticFailover = null, IEnumerable capabilities = null, IEnumerable virtualNetworkRules = null, bool? enableMultipleWriteLocations = null, bool? enableCassandraConnector = null, ConnectorOffer? connectorOffer = null, bool? disableKeyBasedMetadataWriteAccess = null, Uri keyVaultKeyUri = null, string defaultIdentity = null, CosmosDBPublicNetworkAccess? publicNetworkAccess = null, bool? isFreeTierEnabled = null, CosmosDBServerVersion? apiServerVersion = null, bool? isAnalyticalStorageEnabled = null, AnalyticalStorageSchemaType? analyticalStorageSchemaType = null, CosmosDBAccountCreateMode? createMode = null, CosmosDBAccountBackupPolicy backupPolicy = null, IEnumerable cors = null, NetworkAclBypass? networkAclBypass = null, IEnumerable networkAclBypassResourceIds = null, EnableFullTextQuery? diagnosticLogEnableFullTextQuery = null, bool? disableLocalAuth = null, CosmosDBAccountRestoreParameters restoreParameters = null, int? capacityTotalThroughputLimit = null, CapacityMode? capacityMode = null, bool? enableMaterializedViews = null, DatabaseAccountKeysMetadata keysMetadata = null, bool? enablePartitionMerge = null, bool? enableBurstCapacity = null, CosmosDBMinimalTlsVersion? minimalTlsVersion = null, string customerManagedKeyStatus = null, bool? enablePriorityBasedExecution = null, DefaultPriorityLevel? defaultPriorityLevel = null, bool? enablePerRegionPerPartitionAutoscale = null, ManagedServiceIdentity identity = null) + public static CosmosDBAccountCreateOrUpdateContent CosmosDBAccountCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBAccountKind? kind = null, ManagedServiceIdentity identity = null, ConsistencyPolicy consistencyPolicy = null, IEnumerable locations = null, CosmosDBAccountOfferType databaseAccountOfferType = default, IEnumerable ipRules = null, bool? isVirtualNetworkFilterEnabled = null, bool? enableAutomaticFailover = null, IEnumerable capabilities = null, IEnumerable virtualNetworkRules = null, bool? enableMultipleWriteLocations = null, bool? enableCassandraConnector = null, ConnectorOffer? connectorOffer = null, bool? disableKeyBasedMetadataWriteAccess = null, Uri keyVaultKeyUri = null, string defaultIdentity = null, CosmosDBPublicNetworkAccess? publicNetworkAccess = null, bool? isFreeTierEnabled = null, CosmosDBServerVersion? apiServerVersion = null, bool? isAnalyticalStorageEnabled = null, AnalyticalStorageSchemaType? analyticalStorageSchemaType = null, CosmosDBAccountCreateMode? createMode = null, CosmosDBAccountBackupPolicy backupPolicy = null, IEnumerable cors = null, NetworkAclBypass? networkAclBypass = null, IEnumerable networkAclBypassResourceIds = null, bool? disableLocalAuth = null, CosmosDBAccountRestoreParameters restoreParameters = null, int? capacityTotalThroughputLimit = null, DatabaseAccountKeysMetadata keysMetadata = null, bool? enablePartitionMerge = null, CosmosDBMinimalTlsVersion? minimalTlsVersion = null, bool? enableBurstCapacity = null, string customerManagedKeyStatus = null) { tags ??= new Dictionary(); locations ??= new List(); @@ -478,6 +357,7 @@ public static CosmosDBAccountCreateOrUpdateContent CosmosDBAccountCreateOrUpdate tags, location, kind, + identity, consistencyPolicy, locations?.ToList(), databaseAccountOfferType, @@ -502,21 +382,14 @@ public static CosmosDBAccountCreateOrUpdateContent CosmosDBAccountCreateOrUpdate cors?.ToList(), networkAclBypass, networkAclBypassResourceIds?.ToList(), - diagnosticLogEnableFullTextQuery != null ? new DiagnosticLogSettings(diagnosticLogEnableFullTextQuery, serializedAdditionalRawData: null) : null, disableLocalAuth, restoreParameters, capacityTotalThroughputLimit != null ? new CosmosDBAccountCapacity(capacityTotalThroughputLimit, serializedAdditionalRawData: null) : null, - capacityMode, - enableMaterializedViews, keysMetadata, enablePartitionMerge, - enableBurstCapacity, minimalTlsVersion, + enableBurstCapacity, customerManagedKeyStatus, - enablePriorityBasedExecution, - defaultPriorityLevel, - enablePerRegionPerPartitionAutoscale, - identity, serializedAdditionalRawData: null); } @@ -551,15 +424,6 @@ public static CosmosDBAccountConnectionString CosmosDBAccountConnectionString(st return new CosmosDBAccountConnectionString(connectionString, description, keyKind, keyType, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Error code. - /// Error message indicating why the operation failed. - /// A new instance for mocking. - public static CosmosDBErrorResult CosmosDBErrorResult(string code = null, string message = null) - { - return new CosmosDBErrorResult(code, message, serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The start time for the metric (ISO-8601 format). /// The end time for the metric (ISO-8601 format). @@ -762,62 +626,6 @@ public static CosmosDBMetricAvailability CosmosDBMetricAvailability(string timeG return new CosmosDBMetricAvailability(timeGrain, retention, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// Gets or sets the resource. - /// - /// Identity for the resource. - /// A new instance for mocking. - public static GraphResourceGetResultData GraphResourceGetResultData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ResourceIdentifier resourceId = null, GraphResourceGetPropertiesOptions options = null, ManagedServiceIdentity identity = null) - { - tags ??= new Dictionary(); - - return new GraphResourceGetResultData( - id, - name, - resourceType, - systemData, - tags, - location, - resourceId != null ? ResourceManagerModelFactory.WritableSubResource(resourceId) : null, - options, - identity, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The standard JSON format of a Graph resource. - /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. - /// A new instance for mocking. - public static GraphResourceGetResultCreateOrUpdateContent GraphResourceGetResultCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ResourceIdentifier resourceId = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) - { - tags ??= new Dictionary(); - - return new GraphResourceGetResultCreateOrUpdateContent( - id, - name, - resourceType, - systemData, - tags, - location, - resourceId != null ? ResourceManagerModelFactory.WritableSubResource(resourceId) : null, - options, - identity, - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The id. /// The name. @@ -827,9 +635,8 @@ public static GraphResourceGetResultCreateOrUpdateContent GraphResourceGetResult /// The location. /// /// - /// Identity for the resource. /// A new instance for mocking. - public static CosmosDBSqlDatabaseData CosmosDBSqlDatabaseData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCosmosDBSqlDatabaseResourceInfo resource = null, CosmosDBSqlDatabasePropertiesConfig options = null, ManagedServiceIdentity identity = null) + public static CosmosDBSqlDatabaseData CosmosDBSqlDatabaseData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCosmosDBSqlDatabaseResourceInfo resource = null, CosmosDBSqlDatabasePropertiesConfig options = null) { tags ??= new Dictionary(); @@ -842,7 +649,6 @@ public static CosmosDBSqlDatabaseData CosmosDBSqlDatabaseData(ResourceIdentifier location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -879,9 +685,8 @@ public static ExtendedCosmosDBSqlDatabaseResourceInfo ExtendedCosmosDBSqlDatabas /// The location. /// The standard JSON format of a SQL database. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// A new instance for mocking. - public static CosmosDBSqlDatabaseCreateOrUpdateContent CosmosDBSqlDatabaseCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBSqlDatabaseResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) + public static CosmosDBSqlDatabaseCreateOrUpdateContent CosmosDBSqlDatabaseCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBSqlDatabaseResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null) { tags ??= new Dictionary(); @@ -894,7 +699,6 @@ public static CosmosDBSqlDatabaseCreateOrUpdateContent CosmosDBSqlDatabaseCreate location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -906,9 +710,8 @@ public static CosmosDBSqlDatabaseCreateOrUpdateContent CosmosDBSqlDatabaseCreate /// The tags. /// The location. /// - /// Identity for the resource. /// A new instance for mocking. - public static ThroughputSettingData ThroughputSettingData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedThroughputSettingsResourceInfo resource = null, ManagedServiceIdentity identity = null) + public static ThroughputSettingData ThroughputSettingData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedThroughputSettingsResourceInfo resource = null) { tags ??= new Dictionary(); @@ -920,7 +723,6 @@ public static ThroughputSettingData ThroughputSettingData(ResourceIdentifier id tags, location, resource, - identity, serializedAdditionalRawData: null); } @@ -988,9 +790,8 @@ public static AutoscaleSettingsResourceInfo AutoscaleSettingsResourceInfo(int ma /// The tags. /// The location. /// The standard JSON format of a resource throughput. - /// Identity for the resource. /// A new instance for mocking. - public static ThroughputSettingsUpdateData ThroughputSettingsUpdateData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ThroughputSettingsResourceInfo resource = null, ManagedServiceIdentity identity = null) + public static ThroughputSettingsUpdateData ThroughputSettingsUpdateData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ThroughputSettingsResourceInfo resource = null) { tags ??= new Dictionary(); @@ -1002,50 +803,9 @@ public static ThroughputSettingsUpdateData ThroughputSettingsUpdateData(Resource tags, location, resource, - identity, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// - /// A new instance for mocking. - public static CosmosDBSqlClientEncryptionKeyData CosmosDBSqlClientEncryptionKeyData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, CosmosDBSqlClientEncryptionKeyProperties resource = null) - { - return new CosmosDBSqlClientEncryptionKeyData( - id, - name, - resourceType, - systemData, - resource, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Name of the ClientEncryptionKey. - /// Encryption algorithm that will be used along with this client encryption key to encrypt/decrypt data. - /// Wrapped (encrypted) form of the key represented as a byte array. - /// Metadata for the wrapping provider that can be used to unwrap the wrapped client encryption key. - /// A system generated property. A unique identifier. - /// A system generated property that denotes the last updated timestamp of the resource. - /// A system generated property representing the resource etag required for optimistic concurrency control. - /// A new instance for mocking. - public static CosmosDBSqlClientEncryptionKeyProperties CosmosDBSqlClientEncryptionKeyProperties(string id = null, string encryptionAlgorithm = null, byte[] wrappedDataEncryptionKey = null, CosmosDBKeyWrapMetadata keyWrapMetadata = null, string rid = null, float? timestamp = null, ETag? etag = null) - { - return new CosmosDBSqlClientEncryptionKeyProperties( - id, - encryptionAlgorithm, - wrappedDataEncryptionKey, - keyWrapMetadata, - serializedAdditionalRawData: null, - rid, - timestamp, - etag); - } - /// Initializes a new instance of . /// The id. /// The name. @@ -1055,9 +815,8 @@ public static CosmosDBSqlClientEncryptionKeyProperties CosmosDBSqlClientEncrypti /// The location. /// /// - /// Identity for the resource. /// A new instance for mocking. - public static CosmosDBSqlContainerData CosmosDBSqlContainerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCosmosDBSqlContainerResourceInfo resource = null, CosmosDBSqlContainerPropertiesConfig options = null, ManagedServiceIdentity identity = null) + public static CosmosDBSqlContainerData CosmosDBSqlContainerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCosmosDBSqlContainerResourceInfo resource = null, CosmosDBSqlContainerPropertiesConfig options = null) { tags ??= new Dictionary(); @@ -1070,7 +829,6 @@ public static CosmosDBSqlContainerData CosmosDBSqlContainerData(ResourceIdentifi location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1085,13 +843,12 @@ public static CosmosDBSqlContainerData CosmosDBSqlContainerData(ResourceIdentifi /// Analytical TTL. /// Parameters to indicate the information about the restore. /// Enum to indicate the mode of resource creation. - /// The configuration for defining Materialized Views. This must be specified only for creating a Materialized View container. /// List of computed properties. /// A system generated property. A unique identifier. /// A system generated property that denotes the last updated timestamp of the resource. /// A system generated property representing the resource etag required for optimistic concurrency control. /// A new instance for mocking. - public static ExtendedCosmosDBSqlContainerResourceInfo ExtendedCosmosDBSqlContainerResourceInfo(string containerName = null, CosmosDBIndexingPolicy indexingPolicy = null, CosmosDBContainerPartitionKey partitionKey = null, int? defaultTtl = null, IEnumerable uniqueKeys = null, ConflictResolutionPolicy conflictResolutionPolicy = null, CosmosDBClientEncryptionPolicy clientEncryptionPolicy = null, long? analyticalStorageTtl = null, ResourceRestoreParameters restoreParameters = null, CosmosDBAccountCreateMode? createMode = null, MaterializedViewDefinition materializedViewDefinition = null, IEnumerable computedProperties = null, string rid = null, float? timestamp = null, ETag? etag = null) + public static ExtendedCosmosDBSqlContainerResourceInfo ExtendedCosmosDBSqlContainerResourceInfo(string containerName = null, CosmosDBIndexingPolicy indexingPolicy = null, CosmosDBContainerPartitionKey partitionKey = null, int? defaultTtl = null, IEnumerable uniqueKeys = null, ConflictResolutionPolicy conflictResolutionPolicy = null, CosmosDBClientEncryptionPolicy clientEncryptionPolicy = null, long? analyticalStorageTtl = null, ResourceRestoreParameters restoreParameters = null, CosmosDBAccountCreateMode? createMode = null, IEnumerable computedProperties = null, string rid = null, float? timestamp = null, ETag? etag = null) { uniqueKeys ??= new List(); computedProperties ??= new List(); @@ -1107,7 +864,6 @@ public static ExtendedCosmosDBSqlContainerResourceInfo ExtendedCosmosDBSqlContai analyticalStorageTtl, restoreParameters, createMode, - materializedViewDefinition, computedProperties?.ToList(), serializedAdditionalRawData: null, rid, @@ -1128,16 +884,6 @@ public static CosmosDBContainerPartitionKey CosmosDBContainerPartitionKey(IEnume return new CosmosDBContainerPartitionKey(paths?.ToList(), kind, version, isSystemKey, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// An unique identifier for the source collection. This is a system generated property. - /// The name of the source container on which the Materialized View will be created. - /// The definition should be an SQL query which would be used to fetch data from the source container to populate into the Materialized View container. - /// A new instance for mocking. - public static MaterializedViewDefinition MaterializedViewDefinition(string sourceCollectionRid = null, string sourceCollectionId = null, string definition = null) - { - return new MaterializedViewDefinition(sourceCollectionRid, sourceCollectionId, definition, serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The id. /// The name. @@ -1147,9 +893,8 @@ public static MaterializedViewDefinition MaterializedViewDefinition(string sourc /// The location. /// The standard JSON format of a container. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// A new instance for mocking. - public static CosmosDBSqlContainerCreateOrUpdateContent CosmosDBSqlContainerCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBSqlContainerResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) + public static CosmosDBSqlContainerCreateOrUpdateContent CosmosDBSqlContainerCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBSqlContainerResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null) { tags ??= new Dictionary(); @@ -1162,107 +907,47 @@ public static CosmosDBSqlContainerCreateOrUpdateContent CosmosDBSqlContainerCrea location, resource, options, - identity, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// List of physical partitions and their properties. - /// A new instance for mocking. - public static PhysicalPartitionStorageInfoCollection PhysicalPartitionStorageInfoCollection(IEnumerable physicalPartitionStorageInfoCollectionValue = null) - { - physicalPartitionStorageInfoCollectionValue ??= new List(); - - return new PhysicalPartitionStorageInfoCollection(physicalPartitionStorageInfoCollectionValue?.ToList(), serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The unique identifier of the partition. - /// The storage in KB for the physical partition. - /// A new instance for mocking. - public static PhysicalPartitionStorageInfo PhysicalPartitionStorageInfo(string id = null, double? storageInKB = null) - { - return new PhysicalPartitionStorageInfo(id, storageInKB, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The standard JSON format of a resource throughput. - /// Identity for the resource. - /// A new instance for mocking. - public static RetrieveThroughputParameters RetrieveThroughputParameters(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, IEnumerable resourcePhysicalPartitionIds = null, ManagedServiceIdentity identity = null) - { - tags ??= new Dictionary(); - resourcePhysicalPartitionIds ??= new List(); - - return new RetrieveThroughputParameters( - id, - name, - resourceType, - systemData, - tags, - location, - resourcePhysicalPartitionIds != null ? new RetrieveThroughputPropertiesResource(resourcePhysicalPartitionIds?.ToList(), serializedAdditionalRawData: null) : null, - identity, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. - /// The tags. - /// The location. - /// properties of physical partition throughput info. - /// Identity for the resource. - /// A new instance for mocking. - public static PhysicalPartitionThroughputInfoResult PhysicalPartitionThroughputInfoResult(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, IEnumerable resourcePhysicalPartitionThroughputInfo = null, ManagedServiceIdentity identity = null) + /// + /// A new instance for mocking. + public static CosmosDBSqlClientEncryptionKeyData CosmosDBSqlClientEncryptionKeyData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, CosmosDBSqlClientEncryptionKeyProperties resource = null) { - tags ??= new Dictionary(); - resourcePhysicalPartitionThroughputInfo ??= new List(); - - return new PhysicalPartitionThroughputInfoResult( + return new CosmosDBSqlClientEncryptionKeyData( id, name, resourceType, systemData, - tags, - location, - resourcePhysicalPartitionThroughputInfo != null ? new PhysicalPartitionThroughputInfoResultPropertiesResource(resourcePhysicalPartitionThroughputInfo?.ToList(), serializedAdditionalRawData: null) : null, - identity, + resource, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The standard JSON format of a resource throughput. - /// Identity for the resource. - /// A new instance for mocking. - public static RedistributeThroughputParameters RedistributeThroughputParameters(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, RedistributeThroughputPropertiesResource resource = null, ManagedServiceIdentity identity = null) + /// Initializes a new instance of . + /// Name of the ClientEncryptionKey. + /// Encryption algorithm that will be used along with this client encryption key to encrypt/decrypt data. + /// Wrapped (encrypted) form of the key represented as a byte array. + /// Metadata for the wrapping provider that can be used to unwrap the wrapped client encryption key. + /// A system generated property. A unique identifier. + /// A system generated property that denotes the last updated timestamp of the resource. + /// A system generated property representing the resource etag required for optimistic concurrency control. + /// A new instance for mocking. + public static CosmosDBSqlClientEncryptionKeyProperties CosmosDBSqlClientEncryptionKeyProperties(string id = null, string encryptionAlgorithm = null, byte[] wrappedDataEncryptionKey = null, CosmosDBKeyWrapMetadata keyWrapMetadata = null, string rid = null, float? timestamp = null, ETag? etag = null) { - tags ??= new Dictionary(); - - return new RedistributeThroughputParameters( + return new CosmosDBSqlClientEncryptionKeyProperties( id, - name, - resourceType, - systemData, - tags, - location, - resource, - identity, - serializedAdditionalRawData: null); + encryptionAlgorithm, + wrappedDataEncryptionKey, + keyWrapMetadata, + serializedAdditionalRawData: null, + rid, + timestamp, + etag); } /// Initializes a new instance of . @@ -1273,9 +958,8 @@ public static RedistributeThroughputParameters RedistributeThroughputParameters( /// The tags. /// The location. /// - /// Identity for the resource. /// A new instance for mocking. - public static CosmosDBSqlStoredProcedureData CosmosDBSqlStoredProcedureData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCosmosDBSqlStoredProcedureResourceInfo resource = null, ManagedServiceIdentity identity = null) + public static CosmosDBSqlStoredProcedureData CosmosDBSqlStoredProcedureData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCosmosDBSqlStoredProcedureResourceInfo resource = null) { tags ??= new Dictionary(); @@ -1287,7 +971,6 @@ public static CosmosDBSqlStoredProcedureData CosmosDBSqlStoredProcedureData(Reso tags, location, resource, - identity, serializedAdditionalRawData: null); } @@ -1318,9 +1001,8 @@ public static ExtendedCosmosDBSqlStoredProcedureResourceInfo ExtendedCosmosDBSql /// The location. /// The standard JSON format of a storedProcedure. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// A new instance for mocking. - public static CosmosDBSqlStoredProcedureCreateOrUpdateContent CosmosDBSqlStoredProcedureCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBSqlStoredProcedureResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) + public static CosmosDBSqlStoredProcedureCreateOrUpdateContent CosmosDBSqlStoredProcedureCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBSqlStoredProcedureResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null) { tags ??= new Dictionary(); @@ -1333,7 +1015,6 @@ public static CosmosDBSqlStoredProcedureCreateOrUpdateContent CosmosDBSqlStoredP location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1345,9 +1026,8 @@ public static CosmosDBSqlStoredProcedureCreateOrUpdateContent CosmosDBSqlStoredP /// The tags. /// The location. /// - /// Identity for the resource. /// A new instance for mocking. - public static CosmosDBSqlUserDefinedFunctionData CosmosDBSqlUserDefinedFunctionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCosmosDBSqlUserDefinedFunctionResourceInfo resource = null, ManagedServiceIdentity identity = null) + public static CosmosDBSqlUserDefinedFunctionData CosmosDBSqlUserDefinedFunctionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCosmosDBSqlUserDefinedFunctionResourceInfo resource = null) { tags ??= new Dictionary(); @@ -1359,7 +1039,6 @@ public static CosmosDBSqlUserDefinedFunctionData CosmosDBSqlUserDefinedFunctionD tags, location, resource, - identity, serializedAdditionalRawData: null); } @@ -1390,9 +1069,8 @@ public static ExtendedCosmosDBSqlUserDefinedFunctionResourceInfo ExtendedCosmosD /// The location. /// The standard JSON format of a userDefinedFunction. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// A new instance for mocking. - public static CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBSqlUserDefinedFunctionResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) + public static CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBSqlUserDefinedFunctionResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null) { tags ??= new Dictionary(); @@ -1405,7 +1083,6 @@ public static CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent CosmosDBSqlUse location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1417,9 +1094,8 @@ public static CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent CosmosDBSqlUse /// The tags. /// The location. /// - /// Identity for the resource. /// A new instance for mocking. - public static CosmosDBSqlTriggerData CosmosDBSqlTriggerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCosmosDBSqlTriggerResourceInfo resource = null, ManagedServiceIdentity identity = null) + public static CosmosDBSqlTriggerData CosmosDBSqlTriggerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCosmosDBSqlTriggerResourceInfo resource = null) { tags ??= new Dictionary(); @@ -1431,7 +1107,6 @@ public static CosmosDBSqlTriggerData CosmosDBSqlTriggerData(ResourceIdentifier i tags, location, resource, - identity, serializedAdditionalRawData: null); } @@ -1466,9 +1141,8 @@ public static ExtendedCosmosDBSqlTriggerResourceInfo ExtendedCosmosDBSqlTriggerR /// The location. /// The standard JSON format of a trigger. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// A new instance for mocking. - public static CosmosDBSqlTriggerCreateOrUpdateContent CosmosDBSqlTriggerCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBSqlTriggerResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) + public static CosmosDBSqlTriggerCreateOrUpdateContent CosmosDBSqlTriggerCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBSqlTriggerResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null) { tags ??= new Dictionary(); @@ -1481,7 +1155,6 @@ public static CosmosDBSqlTriggerCreateOrUpdateContent CosmosDBSqlTriggerCreateOr location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1494,9 +1167,8 @@ public static CosmosDBSqlTriggerCreateOrUpdateContent CosmosDBSqlTriggerCreateOr /// The location. /// /// - /// Identity for the resource. /// A new instance for mocking. - public static MongoDBDatabaseData MongoDBDatabaseData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedMongoDBDatabaseResourceInfo resource = null, MongoDBDatabasePropertiesConfig options = null, ManagedServiceIdentity identity = null) + public static MongoDBDatabaseData MongoDBDatabaseData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedMongoDBDatabaseResourceInfo resource = null, MongoDBDatabasePropertiesConfig options = null) { tags ??= new Dictionary(); @@ -1509,7 +1181,6 @@ public static MongoDBDatabaseData MongoDBDatabaseData(ResourceIdentifier id = nu location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1542,9 +1213,8 @@ public static ExtendedMongoDBDatabaseResourceInfo ExtendedMongoDBDatabaseResourc /// The location. /// The standard JSON format of a MongoDB database. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// A new instance for mocking. - public static MongoDBDatabaseCreateOrUpdateContent MongoDBDatabaseCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, MongoDBDatabaseResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) + public static MongoDBDatabaseCreateOrUpdateContent MongoDBDatabaseCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, MongoDBDatabaseResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null) { tags ??= new Dictionary(); @@ -1557,7 +1227,6 @@ public static MongoDBDatabaseCreateOrUpdateContent MongoDBDatabaseCreateOrUpdate location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1570,9 +1239,8 @@ public static MongoDBDatabaseCreateOrUpdateContent MongoDBDatabaseCreateOrUpdate /// The location. /// /// - /// Identity for the resource. /// A new instance for mocking. - public static MongoDBCollectionData MongoDBCollectionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedMongoDBCollectionResourceInfo resource = null, MongoDBCollectionPropertiesConfig options = null, ManagedServiceIdentity identity = null) + public static MongoDBCollectionData MongoDBCollectionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedMongoDBCollectionResourceInfo resource = null, MongoDBCollectionPropertiesConfig options = null) { tags ??= new Dictionary(); @@ -1585,7 +1253,6 @@ public static MongoDBCollectionData MongoDBCollectionData(ResourceIdentifier id location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1627,9 +1294,8 @@ public static ExtendedMongoDBCollectionResourceInfo ExtendedMongoDBCollectionRes /// The location. /// The standard JSON format of a MongoDB collection. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// A new instance for mocking. - public static MongoDBCollectionCreateOrUpdateContent MongoDBCollectionCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, MongoDBCollectionResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) + public static MongoDBCollectionCreateOrUpdateContent MongoDBCollectionCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, MongoDBCollectionResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null) { tags ??= new Dictionary(); @@ -1642,7 +1308,6 @@ public static MongoDBCollectionCreateOrUpdateContent MongoDBCollectionCreateOrUp location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1655,9 +1320,8 @@ public static MongoDBCollectionCreateOrUpdateContent MongoDBCollectionCreateOrUp /// The location. /// /// - /// Identity for the resource. /// A new instance for mocking. - public static CosmosDBTableData CosmosDBTableData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBTablePropertiesResource resource = null, CosmosDBTablePropertiesOptions options = null, ManagedServiceIdentity identity = null) + public static CosmosDBTableData CosmosDBTableData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBTablePropertiesResource resource = null, CosmosDBTablePropertiesOptions options = null) { tags ??= new Dictionary(); @@ -1670,7 +1334,6 @@ public static CosmosDBTableData CosmosDBTableData(ResourceIdentifier id = null, location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1703,9 +1366,8 @@ public static CosmosDBTablePropertiesResource CosmosDBTablePropertiesResource(st /// The location. /// The standard JSON format of a Table. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// A new instance for mocking. - public static CosmosDBTableCreateOrUpdateContent CosmosDBTableCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBTableResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) + public static CosmosDBTableCreateOrUpdateContent CosmosDBTableCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBTableResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null) { tags ??= new Dictionary(); @@ -1718,7 +1380,6 @@ public static CosmosDBTableCreateOrUpdateContent CosmosDBTableCreateOrUpdateCont location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1731,9 +1392,8 @@ public static CosmosDBTableCreateOrUpdateContent CosmosDBTableCreateOrUpdateCont /// The location. /// /// - /// Identity for the resource. /// A new instance for mocking. - public static CassandraKeyspaceData CassandraKeyspaceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCassandraKeyspaceResourceInfo resource = null, CassandraKeyspacePropertiesConfig options = null, ManagedServiceIdentity identity = null) + public static CassandraKeyspaceData CassandraKeyspaceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCassandraKeyspaceResourceInfo resource = null, CassandraKeyspacePropertiesConfig options = null) { tags ??= new Dictionary(); @@ -1746,7 +1406,6 @@ public static CassandraKeyspaceData CassandraKeyspaceData(ResourceIdentifier id location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1770,9 +1429,8 @@ public static ExtendedCassandraKeyspaceResourceInfo ExtendedCassandraKeyspaceRes /// The location. /// The standard JSON format of a Cassandra keyspace. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// A new instance for mocking. - public static CassandraKeyspaceCreateOrUpdateContent CassandraKeyspaceCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string resourceKeyspaceName = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) + public static CassandraKeyspaceCreateOrUpdateContent CassandraKeyspaceCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string resourceKeyspaceName = null, CosmosDBCreateUpdateConfig options = null) { tags ??= new Dictionary(); @@ -1785,7 +1443,6 @@ public static CassandraKeyspaceCreateOrUpdateContent CassandraKeyspaceCreateOrUp location, resourceKeyspaceName != null ? new CassandraKeyspaceResourceInfo(resourceKeyspaceName, serializedAdditionalRawData: null) : null, options, - identity, serializedAdditionalRawData: null); } @@ -1798,9 +1455,8 @@ public static CassandraKeyspaceCreateOrUpdateContent CassandraKeyspaceCreateOrUp /// The location. /// /// - /// Identity for the resource. /// A new instance for mocking. - public static CassandraTableData CassandraTableData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCassandraTableResourceInfo resource = null, CassandraTablePropertiesConfig options = null, ManagedServiceIdentity identity = null) + public static CassandraTableData CassandraTableData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCassandraTableResourceInfo resource = null, CassandraTablePropertiesConfig options = null) { tags ??= new Dictionary(); @@ -1813,7 +1469,6 @@ public static CassandraTableData CassandraTableData(ResourceIdentifier id = null location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1848,9 +1503,8 @@ public static ExtendedCassandraTableResourceInfo ExtendedCassandraTableResourceI /// The location. /// The standard JSON format of a Cassandra table. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// A new instance for mocking. - public static CassandraTableCreateOrUpdateContent CassandraTableCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CassandraTableResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) + public static CassandraTableCreateOrUpdateContent CassandraTableCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CassandraTableResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null) { tags ??= new Dictionary(); @@ -1863,7 +1517,6 @@ public static CassandraTableCreateOrUpdateContent CassandraTableCreateOrUpdateCo location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1876,9 +1529,8 @@ public static CassandraTableCreateOrUpdateContent CassandraTableCreateOrUpdateCo /// The location. /// /// - /// Identity for the resource. /// A new instance for mocking. - public static GremlinDatabaseData GremlinDatabaseData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedGremlinDatabaseResourceInfo resource = null, GremlinDatabasePropertiesConfig options = null, ManagedServiceIdentity identity = null) + public static GremlinDatabaseData GremlinDatabaseData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedGremlinDatabaseResourceInfo resource = null, GremlinDatabasePropertiesConfig options = null) { tags ??= new Dictionary(); @@ -1891,7 +1543,6 @@ public static GremlinDatabaseData GremlinDatabaseData(ResourceIdentifier id = nu location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1924,9 +1575,8 @@ public static ExtendedGremlinDatabaseResourceInfo ExtendedGremlinDatabaseResourc /// The location. /// The standard JSON format of a Gremlin database. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// A new instance for mocking. - public static GremlinDatabaseCreateOrUpdateContent GremlinDatabaseCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, GremlinDatabaseResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) + public static GremlinDatabaseCreateOrUpdateContent GremlinDatabaseCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, GremlinDatabaseResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null) { tags ??= new Dictionary(); @@ -1939,7 +1589,6 @@ public static GremlinDatabaseCreateOrUpdateContent GremlinDatabaseCreateOrUpdate location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1952,9 +1601,8 @@ public static GremlinDatabaseCreateOrUpdateContent GremlinDatabaseCreateOrUpdate /// The location. /// /// - /// Identity for the resource. /// A new instance for mocking. - public static GremlinGraphData GremlinGraphData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedGremlinGraphResourceInfo resource = null, GremlinGraphPropertiesConfig options = null, ManagedServiceIdentity identity = null) + public static GremlinGraphData GremlinGraphData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedGremlinGraphResourceInfo resource = null, GremlinGraphPropertiesConfig options = null) { tags ??= new Dictionary(); @@ -1967,7 +1615,6 @@ public static GremlinGraphData GremlinGraphData(ResourceIdentifier id = null, st location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -2014,9 +1661,8 @@ public static ExtendedGremlinGraphResourceInfo ExtendedGremlinGraphResourceInfo( /// The location. /// The standard JSON format of a Gremlin graph. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// A new instance for mocking. - public static GremlinGraphCreateOrUpdateContent GremlinGraphCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, GremlinGraphResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) + public static GremlinGraphCreateOrUpdateContent GremlinGraphCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, GremlinGraphResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null) { tags ??= new Dictionary(); @@ -2029,7 +1675,6 @@ public static GremlinGraphCreateOrUpdateContent GremlinGraphCreateOrUpdateConten location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -2073,182 +1718,6 @@ public static CosmosDBLocationProperties CosmosDBLocationProperties(bool? doesSu serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// - /// - /// Identity for the resource. - /// A new instance for mocking. - public static CassandraViewGetResultData CassandraViewGetResultData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CassandraViewGetPropertiesResource resource = null, CassandraViewGetPropertiesOptions options = null, ManagedServiceIdentity identity = null) - { - tags ??= new Dictionary(); - - return new CassandraViewGetResultData( - id, - name, - resourceType, - systemData, - tags, - location, - resource, - options, - identity, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Name of the Cosmos DB Cassandra view. - /// View Definition of the Cosmos DB Cassandra view. - /// A system generated property. A unique identifier. - /// A system generated property that denotes the last updated timestamp of the resource. - /// A system generated property representing the resource etag required for optimistic concurrency control. - /// A new instance for mocking. - public static CassandraViewGetPropertiesResource CassandraViewGetPropertiesResource(string id = null, string viewDefinition = null, string rid = null, float? timestamp = null, ETag? etag = null) - { - return new CassandraViewGetPropertiesResource( - id, - viewDefinition, - serializedAdditionalRawData: null, - rid, - timestamp, - etag); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The standard JSON format of a Cassandra view. - /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. - /// A new instance for mocking. - public static CassandraViewGetResultCreateOrUpdateContent CassandraViewGetResultCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CassandraViewResource resource = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) - { - tags ??= new Dictionary(); - - return new CassandraViewGetResultCreateOrUpdateContent( - id, - name, - resourceType, - systemData, - tags, - location, - resource, - options, - identity, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Data Transfer Create Job Properties. - /// A new instance for mocking. - public static DataTransferJobGetResultCreateOrUpdateContent DataTransferJobGetResultCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DataTransferJobProperties properties = null) - { - return new DataTransferJobGetResultCreateOrUpdateContent( - id, - name, - resourceType, - systemData, - properties, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Job Name. - /// - /// Source DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . - /// - /// - /// Destination DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . - /// - /// Job Status. - /// Processed Count. - /// Total Count. - /// Last Updated Time (ISO-8601 format). - /// Worker count. - /// Error response for Faulted job. - /// Total Duration of Job. - /// Mode of job execution. - /// A new instance for mocking. - public static DataTransferJobProperties DataTransferJobProperties(string jobName = null, DataTransferDataSourceSink source = null, DataTransferDataSourceSink destination = null, string status = null, long? processedCount = null, long? totalCount = null, DateTimeOffset? lastUpdatedUtcOn = null, int? workerCount = null, CosmosDBErrorResult error = null, TimeSpan? duration = null, DataTransferJobMode? mode = null) - { - return new DataTransferJobProperties( - jobName, - source, - destination, - status, - processedCount, - totalCount, - lastUpdatedUtcOn, - workerCount, - error, - duration, - mode, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Job Name. - /// - /// Source DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . - /// - /// - /// Destination DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . - /// - /// Job Status. - /// Processed Count. - /// Total Count. - /// Last Updated Time (ISO-8601 format). - /// Worker count. - /// Error response for Faulted job. - /// Total Duration of Job. - /// Mode of job execution. - /// A new instance for mocking. - public static DataTransferJobGetResultData DataTransferJobGetResultData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string jobName = null, DataTransferDataSourceSink source = null, DataTransferDataSourceSink destination = null, string status = null, long? processedCount = null, long? totalCount = null, DateTimeOffset? lastUpdatedUtcOn = null, int? workerCount = null, CosmosDBErrorResult error = null, TimeSpan? duration = null, DataTransferJobMode? mode = null) - { - return new DataTransferJobGetResultData( - id, - name, - resourceType, - systemData, - jobName, - source, - destination, - status, - processedCount, - totalCount, - lastUpdatedUtcOn, - workerCount, - error, - duration, - mode, - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The id. /// The name. @@ -2285,34 +1754,25 @@ public static CassandraClusterData CassandraClusterData(ResourceIdentifier id = /// Initial password for clients connecting as admin to the cluster. Should be changed after cluster creation. Returns null on GET. This field only applies when the authenticationMethod field is 'Cassandra'. /// Hostname or IP address where the Prometheus endpoint containing data about the managed Cassandra nodes can be reached. /// Should automatic repairs run on this cluster? If omitted, this is true, and should stay true unless you are running a hybrid cluster where you are already doing your own repairs. - /// The form of AutoReplicate that is being used by this cluster. /// List of TLS certificates used to authorize clients connecting to the cluster. All connections are TLS encrypted whether clientCertificates is set or not, but if clientCertificates is set, the managed Cassandra cluster will reject all connections not bearing a TLS client certificate that can be validated from one or more of the public certificates in this property. /// List of TLS certificates used to authorize gossip from unmanaged data centers. The TLS certificates of all nodes in unmanaged data centers must be verifiable using one of the certificates provided in this property. /// List of TLS certificates that unmanaged nodes must trust for gossip with managed nodes. All managed nodes will present TLS client certificates that are verifiable using one of the certificates provided in this property. /// List of IP addresses of seed nodes in unmanaged data centers. These will be added to the seed node lists of all managed nodes. /// List of IP addresses of seed nodes in the managed data centers. These should be added to the seed node lists of all unmanaged nodes. - /// List of the data center names for unmanaged data centers in this cluster to be included in auto-replication. /// (Deprecated) Number of hours to wait between taking a backup of the cluster. /// Whether the cluster and associated data centers has been deallocated. /// Whether Cassandra audit logging is enabled. - /// Type of the cluster. If set to Production, some operations might not be permitted on cluster. /// Error related to resource provisioning. - /// Extensions to be added or updated on cluster. - /// List of backup schedules that define when you want to back up your data. - /// How the nodes in the cluster react to scheduled events. /// How to connect to the azure services needed for running the cluster. - /// If the Connection Method is Vpn, this is the Id of the private link resource that the datacenters need to connect to. + /// If the Connection Method is VPN, this is the Id of the private link resource that the datacenters need to connect to. /// A new instance for mocking. - public static CassandraClusterProperties CassandraClusterProperties(CassandraProvisioningState? provisioningState = null, string restoreFromBackupId = null, ResourceIdentifier delegatedManagementSubnetId = null, string cassandraVersion = null, string clusterNameOverride = null, CassandraAuthenticationMethod? authenticationMethod = null, string initialCassandraAdminPassword = null, string prometheusEndpointIPAddress = null, bool? isRepairEnabled = null, CassandraAutoReplicateForm? autoReplicate = null, IEnumerable clientCertificates = null, IEnumerable externalGossipCertificates = null, IEnumerable gossipCertificates = null, IEnumerable externalSeedNodes = null, IEnumerable seedNodes = null, IEnumerable externalDataCenters = null, int? hoursBetweenBackups = null, bool? isDeallocated = null, bool? isCassandraAuditLoggingEnabled = null, CassandraClusterType? clusterType = null, CassandraError provisionError = null, IEnumerable extensions = null, IEnumerable backupSchedules = null, ScheduledEventStrategy? scheduledEventStrategy = null, ServiceConnectionType? azureConnectionMethod = null, ResourceIdentifier privateLinkResourceId = null) + public static CassandraClusterProperties CassandraClusterProperties(CassandraProvisioningState? provisioningState = null, string restoreFromBackupId = null, ResourceIdentifier delegatedManagementSubnetId = null, string cassandraVersion = null, string clusterNameOverride = null, CassandraAuthenticationMethod? authenticationMethod = null, string initialCassandraAdminPassword = null, string prometheusEndpointIPAddress = null, bool? isRepairEnabled = null, IEnumerable clientCertificates = null, IEnumerable externalGossipCertificates = null, IEnumerable gossipCertificates = null, IEnumerable externalSeedNodes = null, IEnumerable seedNodes = null, int? hoursBetweenBackups = null, bool? isDeallocated = null, bool? isCassandraAuditLoggingEnabled = null, CassandraError provisionError = null, ServiceConnectionType? azureConnectionMethod = null, ResourceIdentifier privateLinkResourceId = null) { clientCertificates ??= new List(); externalGossipCertificates ??= new List(); gossipCertificates ??= new List(); externalSeedNodes ??= new List(); seedNodes ??= new List(); - externalDataCenters ??= new List(); - extensions ??= new List(); - backupSchedules ??= new List(); return new CassandraClusterProperties( provisioningState, @@ -2324,21 +1784,15 @@ public static CassandraClusterProperties CassandraClusterProperties(CassandraPro initialCassandraAdminPassword, prometheusEndpointIPAddress != null ? new CassandraDataCenterSeedNode(prometheusEndpointIPAddress, serializedAdditionalRawData: null) : null, isRepairEnabled, - autoReplicate, clientCertificates?.ToList(), externalGossipCertificates?.ToList(), gossipCertificates?.ToList(), externalSeedNodes?.ToList(), seedNodes?.ToList(), - externalDataCenters?.ToList(), hoursBetweenBackups, isDeallocated, isCassandraAuditLoggingEnabled, - clusterType, provisionError, - extensions?.ToList(), - backupSchedules?.ToList(), - scheduledEventStrategy, azureConnectionMethod, privateLinkResourceId, serializedAdditionalRawData: null); @@ -2349,9 +1803,9 @@ public static CassandraClusterProperties CassandraClusterProperties(CassandraPro /// The arguments for the command to be run. /// IP address of the cassandra host to run the command on. /// If true, stops cassandra before executing the command and then start it again. - /// If true, allows the command to *write* to the cassandra directory, otherwise read-only. + /// If true, allows the command to *write* to the cassandra directory, otherwise read-only. /// A new instance for mocking. - public static CassandraCommandPostBody CassandraCommandPostBody(string command = null, IDictionary arguments = null, string host = null, bool? cassandraStopStart = null, bool? allowWrite = null) + public static CassandraCommandPostBody CassandraCommandPostBody(string command = null, IDictionary arguments = null, string host = null, bool? cassandraStopStart = null, bool? readwrite = null) { arguments ??= new Dictionary(); @@ -2360,7 +1814,7 @@ public static CassandraCommandPostBody CassandraCommandPostBody(string command = arguments, host, cassandraStopStart, - allowWrite, + readwrite, serializedAdditionalRawData: null); } @@ -2372,52 +1826,6 @@ public static CassandraCommandOutput CassandraCommandOutput(string commandOutput return new CassandraCommandOutput(commandOutput, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The command which should be run. - /// The unique id of command. - /// The arguments for the command to be run. - /// IP address of the cassandra host to run the command on. - /// Whether command has admin privileges. - /// If true, stops cassandra before executing the command and then start it again. - /// If true, allows the command to *write* to the cassandra directory, otherwise read-only. - /// Result output of the command. - /// Status of the command. - /// The name of the file where the result is written. - /// A new instance for mocking. - public static CassandraClusterCommand CassandraClusterCommand(string command = null, string commandId = null, BinaryData arguments = null, string host = null, bool? isAdmin = null, bool? shouldStopCassandraBeforeStart = null, bool? isReadWrite = null, string result = null, CassandraClusterCommandStatus? status = null, string outputFile = null) - { - return new CassandraClusterCommand( - command, - commandId, - arguments, - host, - isAdmin, - shouldStopCassandraBeforeStart, - isReadWrite, - result, - status, - outputFile, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The unique identifier of backup. - /// The current state of the backup. - /// The time at which the backup process begins. - /// The time at which the backup process ends. - /// The time at which the backup will expire. - /// A new instance for mocking. - public static CassandraClusterBackupResourceInfo CassandraClusterBackupResourceInfo(string backupId = null, CassandraClusterBackupState? backupState = null, DateTimeOffset? backupStartTimestamp = null, DateTimeOffset? backupStopTimestamp = null, DateTimeOffset? backupExpiryTimestamp = null) - { - return new CassandraClusterBackupResourceInfo( - backupId, - backupState, - backupStartTimestamp, - backupStopTimestamp, - backupExpiryTimestamp, - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The id. /// The name. @@ -2562,9 +1970,8 @@ public static CassandraClusterPublicStatusDataCentersItem CassandraClusterPublic /// Unused memory (MemFree and SwapFree in /proc/meminfo), in kB. /// Total installed memory (MemTotal and SwapTotal in /proc/meminfo), in kB. /// A float representing the current system-wide CPU utilization as a percentage. - /// If node has been updated to latest model. /// A new instance for mocking. - public static CassandraClusterDataCenterNodeItem CassandraClusterDataCenterNodeItem(string address = null, CassandraNodeState? state = null, string status = null, string cassandraProcessStatus = null, string load = null, IEnumerable tokens = null, int? size = null, Guid? hostId = null, string rack = null, string timestamp = null, long? diskUsedKB = null, long? diskFreeKB = null, long? memoryUsedKB = null, long? memoryBuffersAndCachedKB = null, long? memoryFreeKB = null, long? memoryTotalKB = null, double? cpuUsage = null, bool? isLatestModel = null) + public static CassandraClusterDataCenterNodeItem CassandraClusterDataCenterNodeItem(string address = null, CassandraNodeState? state = null, string status = null, string cassandraProcessStatus = null, string load = null, IEnumerable tokens = null, int? size = null, Guid? hostId = null, string rack = null, string timestamp = null, long? diskUsedKB = null, long? diskFreeKB = null, long? memoryUsedKB = null, long? memoryBuffersAndCachedKB = null, long? memoryFreeKB = null, long? memoryTotalKB = null, double? cpuUsage = null) { tokens ??= new List(); @@ -2586,7 +1993,6 @@ public static CassandraClusterDataCenterNodeItem CassandraClusterDataCenterNodeI memoryFreeKB, memoryTotalKB, cpuUsage, - isLatestModel, serializedAdditionalRawData: null); } @@ -2731,12 +2137,12 @@ public static CosmosDBSqlRoleAssignmentData CosmosDBSqlRoleAssignmentData(Resour /// The location of the resource group to which the resource belongs. /// The name of the global database account. /// The creation time of the restorable database account (ISO-8601 format). - /// The least recent time at which the database account can be restored to (ISO-8601 format). /// The time at which the restorable database account has been deleted (ISO-8601 format). + /// The least recent time at which the database account can be restored to (ISO-8601 format). /// The API type of the restorable database account. /// List of regions where the of the database account can be restored from. /// A new instance for mocking. - public static RestorableCosmosDBAccountData RestorableCosmosDBAccountData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AzureLocation? location = null, string accountName = null, DateTimeOffset? createdOn = null, DateTimeOffset? oldestRestorableOn = null, DateTimeOffset? deletedOn = null, CosmosDBApiType? apiType = null, IEnumerable restorableLocations = null) + public static RestorableCosmosDBAccountData RestorableCosmosDBAccountData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AzureLocation? location = null, string accountName = null, DateTimeOffset? createdOn = null, DateTimeOffset? deletedOn = null, DateTimeOffset? oldestRestorableOn = null, CosmosDBApiType? apiType = null, IEnumerable restorableLocations = null) { restorableLocations ??= new List(); @@ -2748,8 +2154,8 @@ public static RestorableCosmosDBAccountData RestorableCosmosDBAccountData(Resour location, accountName, createdOn, - oldestRestorableOn, deletedOn, + oldestRestorableOn, apiType, restorableLocations?.ToList(), serializedAdditionalRawData: null); @@ -2895,14 +2301,13 @@ public static ExtendedRestorableSqlContainerResourceInfo ExtendedRestorableSqlCo /// Analytical TTL. /// Parameters to indicate the information about the restore. /// Enum to indicate the mode of resource creation. - /// The configuration for defining Materialized Views. This must be specified only for creating a Materialized View container. /// List of computed properties. /// A system generated property that specifies the addressable path of the container resource. /// A system generated property. A unique identifier. /// A system generated property that denotes the last updated timestamp of the resource. /// A system generated property representing the resource etag required for optimistic concurrency control. /// A new instance for mocking. - public static RestorableSqlContainerPropertiesResourceContainer RestorableSqlContainerPropertiesResourceContainer(string containerName = null, CosmosDBIndexingPolicy indexingPolicy = null, CosmosDBContainerPartitionKey partitionKey = null, int? defaultTtl = null, IEnumerable uniqueKeys = null, ConflictResolutionPolicy conflictResolutionPolicy = null, CosmosDBClientEncryptionPolicy clientEncryptionPolicy = null, long? analyticalStorageTtl = null, ResourceRestoreParameters restoreParameters = null, CosmosDBAccountCreateMode? createMode = null, MaterializedViewDefinition materializedViewDefinition = null, IEnumerable computedProperties = null, string self = null, string rid = null, float? timestamp = null, ETag? etag = null) + public static RestorableSqlContainerPropertiesResourceContainer RestorableSqlContainerPropertiesResourceContainer(string containerName = null, CosmosDBIndexingPolicy indexingPolicy = null, CosmosDBContainerPartitionKey partitionKey = null, int? defaultTtl = null, IEnumerable uniqueKeys = null, ConflictResolutionPolicy conflictResolutionPolicy = null, CosmosDBClientEncryptionPolicy clientEncryptionPolicy = null, long? analyticalStorageTtl = null, ResourceRestoreParameters restoreParameters = null, CosmosDBAccountCreateMode? createMode = null, IEnumerable computedProperties = null, string self = null, string rid = null, float? timestamp = null, ETag? etag = null) { uniqueKeys ??= new List(); computedProperties ??= new List(); @@ -2918,7 +2323,6 @@ public static RestorableSqlContainerPropertiesResourceContainer RestorableSqlCon analyticalStorageTtl, restoreParameters, createMode, - materializedViewDefinition, computedProperties?.ToList(), serializedAdditionalRawData: null, self, @@ -3246,56 +2650,6 @@ public static CosmosDBServiceProperties CosmosDBServiceProperties(DateTimeOffset additionalProperties); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// A provisioning state of the ThroughputPool. - /// Value for throughput to be shared among CosmosDB resources in the pool. - /// A new instance for mocking. - public static CosmosDBThroughputPoolData CosmosDBThroughputPoolData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBStatus? provisioningState = null, int? maxThroughput = null) - { - tags ??= new Dictionary(); - - return new CosmosDBThroughputPoolData( - id, - name, - resourceType, - systemData, - tags, - location, - provisioningState, - maxThroughput, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// A provisioning state of the ThroughputPool Account. - /// The resource identifier of global database account in the throughputPool. - /// The location of global database account in the throughputPool. - /// The instance id of global database account in the throughputPool. - /// A new instance for mocking. - public static CosmosDBThroughputPoolAccountData CosmosDBThroughputPoolAccountData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, CosmosDBStatus? provisioningState = null, ResourceIdentifier accountResourceIdentifier = null, AzureLocation? accountLocation = null, string accountInstanceId = null) - { - return new CosmosDBThroughputPoolAccountData( - id, - name, - resourceType, - systemData, - provisioningState, - accountResourceIdentifier, - accountLocation, - accountInstanceId, - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// Time of the last state change (ISO-8601 format). /// Instance type for the service. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClusterCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClusterCollection.cs index 1dc439410cac..1be8f9950be6 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClusterCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClusterCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdate /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil w /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string cl /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string clusterName, Cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(CancellationT /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken cance /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string clusterName, Cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string clusterName, CancellationToken cance /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExist /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClusterResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClusterResource.cs index 6e46d7671878..a11d36f8f632 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClusterResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClusterResource.cs @@ -10,7 +10,6 @@ using System.Globalization; using System.Threading; using System.Threading.Tasks; -using Autorest.CSharp.Core; using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager.CosmosDB.Models; @@ -111,7 +110,7 @@ public virtual CassandraDataCenterCollection GetCassandraDataCenters() /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -142,7 +141,7 @@ public virtual async Task> GetCassandraDat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -173,7 +172,7 @@ public virtual Response GetCassandraDataCenter(stri /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -213,7 +212,7 @@ public virtual async Task> GetAsync(Cancellat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -253,7 +252,7 @@ public virtual Response Get(CancellationToken cancella /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -295,7 +294,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -337,7 +336,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -383,7 +382,7 @@ public virtual async Task> UpdateAsync(Wa /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -429,7 +428,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -475,7 +474,7 @@ public virtual async Task> InvokeCommandAsy /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -508,362 +507,6 @@ public virtual ArmOperation InvokeCommand(WaitUntil wait } } - /// - /// List all commands currently running on ring info - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/commands - /// - /// - /// Operation Id - /// CassandraClusters_ListCommand - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetCommandAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cassandraClusterRestClient.CreateListCommandRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => CassandraClusterCommand.DeserializeCassandraClusterCommand(e), _cassandraClusterClientDiagnostics, Pipeline, "CassandraClusterResource.GetCommand", "value", null, cancellationToken); - } - - /// - /// List all commands currently running on ring info - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/commands - /// - /// - /// Operation Id - /// CassandraClusters_ListCommand - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetCommand(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cassandraClusterRestClient.CreateListCommandRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => CassandraClusterCommand.DeserializeCassandraClusterCommand(e), _cassandraClusterClientDiagnostics, Pipeline, "CassandraClusterResource.GetCommand", "value", null, cancellationToken); - } - - /// - /// Get details about a specified command that was run asynchronously. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/commands/{commandId} - /// - /// - /// Operation Id - /// CassandraClusters_GetCommandAsync - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Managed Cassandra cluster command id. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetCommandAsyncAsync(string commandId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(commandId, nameof(commandId)); - - HttpMessage FirstPageRequest(int? pageSizeHint) => _cassandraClusterRestClient.CreateGetCommandAsyncRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, commandId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => CassandraClusterCommand.DeserializeCassandraClusterCommand(e), _cassandraClusterClientDiagnostics, Pipeline, "CassandraClusterResource.GetCommandAsync", "value", null, cancellationToken); - } - - /// - /// Get details about a specified command that was run asynchronously. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/commands/{commandId} - /// - /// - /// Operation Id - /// CassandraClusters_GetCommandAsync - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Managed Cassandra cluster command id. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetCommandAsync(string commandId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(commandId, nameof(commandId)); - - HttpMessage FirstPageRequest(int? pageSizeHint) => _cassandraClusterRestClient.CreateGetCommandAsyncRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, commandId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => CassandraClusterCommand.DeserializeCassandraClusterCommand(e), _cassandraClusterClientDiagnostics, Pipeline, "CassandraClusterResource.GetCommandAsync", "value", null, cancellationToken); - } - - /// - /// List the backups of this cluster that are available to restore. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/backups - /// - /// - /// Operation Id - /// CassandraClusters_ListBackups - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetBackupsAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cassandraClusterRestClient.CreateListBackupsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => CassandraClusterBackupResourceInfo.DeserializeCassandraClusterBackupResourceInfo(e), _cassandraClusterClientDiagnostics, Pipeline, "CassandraClusterResource.GetBackups", "value", null, cancellationToken); - } - - /// - /// List the backups of this cluster that are available to restore. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/backups - /// - /// - /// Operation Id - /// CassandraClusters_ListBackups - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetBackups(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cassandraClusterRestClient.CreateListBackupsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => CassandraClusterBackupResourceInfo.DeserializeCassandraClusterBackupResourceInfo(e), _cassandraClusterClientDiagnostics, Pipeline, "CassandraClusterResource.GetBackups", "value", null, cancellationToken); - } - - /// - /// Get the properties of an individual backup of this cluster that is available to restore. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/backups/{backupId} - /// - /// - /// Operation Id - /// CassandraClusters_GetBackup - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Id of a restorable backup of a Cassandra cluster. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetBackupAsync(string backupId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(backupId, nameof(backupId)); - - using var scope = _cassandraClusterClientDiagnostics.CreateScope("CassandraClusterResource.GetBackup"); - scope.Start(); - try - { - var response = await _cassandraClusterRestClient.GetBackupAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, backupId, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get the properties of an individual backup of this cluster that is available to restore. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/backups/{backupId} - /// - /// - /// Operation Id - /// CassandraClusters_GetBackup - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Id of a restorable backup of a Cassandra cluster. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response GetBackup(string backupId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(backupId, nameof(backupId)); - - using var scope = _cassandraClusterClientDiagnostics.CreateScope("CassandraClusterResource.GetBackup"); - scope.Start(); - try - { - var response = _cassandraClusterRestClient.GetBackup(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, backupId, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated cluster. Use Start to restart the cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/deallocate - /// - /// - /// Operation Id - /// CassandraClusters_Deallocate - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of Cluster Type Production might cause data loss. - /// The cancellation token to use. - public virtual async Task DeallocateAsync(WaitUntil waitUntil, string xMsForceDeallocate = null, CancellationToken cancellationToken = default) - { - using var scope = _cassandraClusterClientDiagnostics.CreateScope("CassandraClusterResource.Deallocate"); - scope.Start(); - try - { - var response = await _cassandraClusterRestClient.DeallocateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, xMsForceDeallocate, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(_cassandraClusterClientDiagnostics, Pipeline, _cassandraClusterRestClient.CreateDeallocateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, xMsForceDeallocate).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated cluster. Use Start to restart the cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/deallocate - /// - /// - /// Operation Id - /// CassandraClusters_Deallocate - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of Cluster Type Production might cause data loss. - /// The cancellation token to use. - public virtual ArmOperation Deallocate(WaitUntil waitUntil, string xMsForceDeallocate = null, CancellationToken cancellationToken = default) - { - using var scope = _cassandraClusterClientDiagnostics.CreateScope("CassandraClusterResource.Deallocate"); - scope.Start(); - try - { - var response = _cassandraClusterRestClient.Deallocate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, xMsForceDeallocate, cancellationToken); - var operation = new CosmosDBArmOperation(_cassandraClusterClientDiagnostics, Pipeline, _cassandraClusterRestClient.CreateDeallocateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, xMsForceDeallocate).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - /// /// Start the Managed Cassandra Cluster and Associated Data Centers. Start will start the host virtual machine of this cluster with reserved data disk. This won't do anything on an already running cluster. Use Deallocate to deallocate the cluster. /// @@ -877,7 +520,7 @@ public virtual ArmOperation Deallocate(WaitUntil waitUntil, string xMsForceDeall /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -919,7 +562,7 @@ public virtual async Task StartAsync(WaitUntil waitUntil, Cancella /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -961,7 +604,7 @@ public virtual ArmOperation Start(WaitUntil waitUntil, CancellationToken cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -999,7 +642,7 @@ public virtual async Task> StatusAsync(Ca /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1037,7 +680,7 @@ public virtual Response Status(CancellationToken c /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1099,7 +742,7 @@ public virtual async Task> AddTagAsync(string /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1161,7 +804,7 @@ public virtual Response AddTag(string key, string valu /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1218,7 +861,7 @@ public virtual async Task> SetTagsAsync(IDict /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1275,7 +918,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1335,7 +978,7 @@ public virtual async Task> RemoveTagAsync(str /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCenterCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCenterCollection.cs index b34f9319bcb5..83976d39be58 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCenterCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCenterCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> CreateOrUpd /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUnti /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string dataCenterName, /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -281,7 +281,7 @@ public virtual AsyncPageable GetAllAsync(Cancellati /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -310,7 +310,7 @@ public virtual Pageable GetAll(CancellationToken ca /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -353,7 +353,7 @@ public virtual async Task> ExistsAsync(string dataCenterName, Can /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -396,7 +396,7 @@ public virtual Response Exists(string dataCenterName, CancellationToken ca /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -441,7 +441,7 @@ public virtual async Task> GetIfEx /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCenterResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCenterResource.cs index c9fb24fa3904..b0891a1215de 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCenterResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCenterResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(Cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(CancellationToken cance /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual async Task> UpdateAsync /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceCollection.cs index e8cbf8281f80..e5c011f1e286 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string k /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string keyspaceName, Canc /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancellation /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken canc /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string keyspaceName, Cance /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string keyspaceName, CancellationToken canc /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExis /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceData.Serialization.cs index 074a6a239663..7be636935e2f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceData.Serialization.cs @@ -30,12 +30,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -120,7 +114,6 @@ internal static CassandraKeyspaceData DeserializeCassandraKeyspaceData(JsonEleme { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -133,16 +126,6 @@ internal static CassandraKeyspaceData DeserializeCassandraKeyspaceData(JsonEleme Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -231,7 +214,6 @@ internal static CassandraKeyspaceData DeserializeCassandraKeyspaceData(JsonEleme location, resource, options0, - identity, serializedAdditionalRawData); } @@ -318,21 +300,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceData.cs index 4645ff58529a..6a387d2c9ab5 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceData.cs @@ -66,13 +66,11 @@ public CassandraKeyspaceData(AzureLocation location) : base(location) /// The location. /// /// - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CassandraKeyspaceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCassandraKeyspaceResourceInfo resource, CassandraKeyspacePropertiesConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CassandraKeyspaceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCassandraKeyspaceResourceInfo resource, CassandraKeyspacePropertiesConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -87,8 +85,5 @@ internal CassandraKeyspaceData() /// Gets or sets the options. [WirePath("properties.options")] public CassandraKeyspacePropertiesConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceResource.cs index 89980d5d5e36..1972af20cb6f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceResource.cs @@ -117,7 +117,7 @@ public virtual CassandraTableCollection GetCassandraTables() /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -148,7 +148,7 @@ public virtual async Task> GetCassandraTableAsy /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -166,75 +166,6 @@ public virtual Response GetCassandraTable(string tableNa return GetCassandraTables().Get(tableName, cancellationToken); } - /// Gets a collection of CassandraViewGetResultResources in the CassandraKeyspace. - /// An object representing collection of CassandraViewGetResultResources and their operations over a CassandraViewGetResultResource. - public virtual CassandraViewGetResultCollection GetCassandraViewGetResults() - { - return GetCachedClient(client => new CassandraViewGetResultCollection(client, Id)); - } - - /// - /// Gets the Cassandra view under an existing Azure Cosmos DB database account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB view name. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetCassandraViewGetResultAsync(string viewName, CancellationToken cancellationToken = default) - { - return await GetCassandraViewGetResults().GetAsync(viewName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets the Cassandra view under an existing Azure Cosmos DB database account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB view name. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetCassandraViewGetResult(string viewName, CancellationToken cancellationToken = default) - { - return GetCassandraViewGetResults().Get(viewName, cancellationToken); - } - /// /// Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. /// @@ -248,7 +179,7 @@ public virtual Response GetCassandraViewGetResul /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -288,7 +219,7 @@ public virtual async Task> GetAsync(Cancella /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -328,7 +259,7 @@ public virtual Response Get(CancellationToken cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -370,7 +301,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -412,7 +343,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -458,7 +389,7 @@ public virtual async Task> UpdateAsync(W /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -504,7 +435,7 @@ public virtual ArmOperation Update(WaitUntil waitUnti /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -566,7 +497,7 @@ public virtual async Task> AddTagAsync(strin /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -628,7 +559,7 @@ public virtual Response AddTag(string key, string val /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -685,7 +616,7 @@ public virtual async Task> SetTagsAsync(IDic /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -742,7 +673,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -802,7 +733,7 @@ public virtual async Task> RemoveTagAsync(st /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceThroughputSettingResource.cs index 3e0bf3005851..bde5fe666468 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceThroughputSettingResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(Cancella /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -229,7 +229,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation CreateOr /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -317,7 +317,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation MigrateC /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -401,7 +401,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual ArmOperation MigrateC /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -505,7 +505,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -567,7 +567,7 @@ public virtual Response AddTag(strin /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -624,7 +624,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -681,7 +681,7 @@ public virtual Response SetTags(IDic /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -741,7 +741,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableCollection.cs index 139bd0f41ee0..b70b96fb2452 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateAs /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wai /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string tabl /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string tableName, Cancellati /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(CancellationTok /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string tableName, Cancella /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string tableName, CancellationToken cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExistsA /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableData.Serialization.cs index 98274578431d..378928df2292 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableData.Serialization.cs @@ -30,12 +30,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -120,7 +114,6 @@ internal static CassandraTableData DeserializeCassandraTableData(JsonElement ele { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -133,16 +126,6 @@ internal static CassandraTableData DeserializeCassandraTableData(JsonElement ele Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -231,7 +214,6 @@ internal static CassandraTableData DeserializeCassandraTableData(JsonElement ele location, resource, options0, - identity, serializedAdditionalRawData); } @@ -318,21 +300,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableData.cs index 1dc8fd135507..efa48515ddcf 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableData.cs @@ -66,13 +66,11 @@ public CassandraTableData(AzureLocation location) : base(location) /// The location. /// /// - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CassandraTableData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCassandraTableResourceInfo resource, CassandraTablePropertiesConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CassandraTableData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCassandraTableResourceInfo resource, CassandraTablePropertiesConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -87,8 +85,5 @@ internal CassandraTableData() /// Gets or sets the options. [WirePath("properties.options")] public CassandraTablePropertiesConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableResource.cs index 73dfd2052086..dbc0ab2e7fe9 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableResource.cs @@ -111,7 +111,7 @@ public virtual CassandraTableThroughputSettingResource GetCassandraTableThroughp /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -151,7 +151,7 @@ public virtual async Task> GetAsync(Cancellatio /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -191,7 +191,7 @@ public virtual Response Get(CancellationToken cancellati /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -233,7 +233,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -321,7 +321,7 @@ public virtual async Task> UpdateAsync(Wait /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -367,7 +367,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -429,7 +429,7 @@ public virtual async Task> AddTagAsync(string k /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -491,7 +491,7 @@ public virtual Response AddTag(string key, string value, /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -548,7 +548,7 @@ public virtual async Task> SetTagsAsync(IDictio /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -605,7 +605,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -665,7 +665,7 @@ public virtual async Task> RemoveTagAsync(strin /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableThroughputSettingResource.cs index 91c9aec778be..e4bec3d77ee9 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableThroughputSettingResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(Cancellatio /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -230,7 +230,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -276,7 +276,7 @@ public virtual ArmOperation CreateOrUpd /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -318,7 +318,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -360,7 +360,7 @@ public virtual ArmOperation MigrateCass /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -402,7 +402,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -444,7 +444,7 @@ public virtual ArmOperation MigrateCass /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -506,7 +506,7 @@ public virtual async Task> Add /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -568,7 +568,7 @@ public virtual Response AddTag(string k /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -625,7 +625,7 @@ public virtual async Task> Set /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -682,7 +682,7 @@ public virtual Response SetTags(IDictio /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -742,7 +742,7 @@ public virtual async Task> Rem /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultCollection.cs deleted file mode 100644 index 2e74d51cfc8c..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultCollection.cs +++ /dev/null @@ -1,492 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetCassandraViewGetResults method from an instance of . - /// - public partial class CassandraViewGetResultCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _cassandraViewGetResultCassandraResourcesClientDiagnostics; - private readonly CassandraResourcesRestOperations _cassandraViewGetResultCassandraResourcesRestClient; - - /// Initializes a new instance of the class for mocking. - protected CassandraViewGetResultCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal CassandraViewGetResultCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _cassandraViewGetResultCassandraResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", CassandraViewGetResultResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(CassandraViewGetResultResource.ResourceType, out string cassandraViewGetResultCassandraResourcesApiVersion); - _cassandraViewGetResultCassandraResourcesRestClient = new CassandraResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cassandraViewGetResultCassandraResourcesApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != CassandraKeyspaceResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, CassandraKeyspaceResource.ResourceType), nameof(id)); - } - - /// - /// Create or update an Azure Cosmos DB Cassandra View - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_CreateUpdateCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Cosmos DB view name. - /// The parameters to provide for the current Cassandra View. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string viewName, CassandraViewGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _cassandraViewGetResultCassandraResourcesRestClient.CreateUpdateCassandraViewAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, viewName, content, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new CassandraViewGetResultOperationSource(Client), _cassandraViewGetResultCassandraResourcesClientDiagnostics, Pipeline, _cassandraViewGetResultCassandraResourcesRestClient.CreateCreateUpdateCassandraViewRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, viewName, content).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create or update an Azure Cosmos DB Cassandra View - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_CreateUpdateCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Cosmos DB view name. - /// The parameters to provide for the current Cassandra View. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string viewName, CassandraViewGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _cassandraViewGetResultCassandraResourcesRestClient.CreateUpdateCassandraView(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, viewName, content, cancellationToken); - var operation = new CosmosDBArmOperation(new CassandraViewGetResultOperationSource(Client), _cassandraViewGetResultCassandraResourcesClientDiagnostics, Pipeline, _cassandraViewGetResultCassandraResourcesRestClient.CreateCreateUpdateCassandraViewRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, viewName, content).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the Cassandra view under an existing Azure Cosmos DB database account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB view name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultCollection.Get"); - scope.Start(); - try - { - var response = await _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraViewAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, viewName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CassandraViewGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the Cassandra view under an existing Azure Cosmos DB database account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB view name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultCollection.Get"); - scope.Start(); - try - { - var response = _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraView(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, viewName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CassandraViewGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists the Cassandra materialized views under an existing Azure Cosmos DB database account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views - /// - /// - /// Operation Id - /// CassandraResources_ListCassandraViews - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cassandraViewGetResultCassandraResourcesRestClient.CreateListCassandraViewsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new CassandraViewGetResultResource(Client, CassandraViewGetResultData.DeserializeCassandraViewGetResultData(e)), _cassandraViewGetResultCassandraResourcesClientDiagnostics, Pipeline, "CassandraViewGetResultCollection.GetAll", "value", null, cancellationToken); - } - - /// - /// Lists the Cassandra materialized views under an existing Azure Cosmos DB database account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views - /// - /// - /// Operation Id - /// CassandraResources_ListCassandraViews - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cassandraViewGetResultCassandraResourcesRestClient.CreateListCassandraViewsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new CassandraViewGetResultResource(Client, CassandraViewGetResultData.DeserializeCassandraViewGetResultData(e)), _cassandraViewGetResultCassandraResourcesClientDiagnostics, Pipeline, "CassandraViewGetResultCollection.GetAll", "value", null, cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB view name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultCollection.Exists"); - scope.Start(); - try - { - var response = await _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraViewAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, viewName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB view name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultCollection.Exists"); - scope.Start(); - try - { - var response = _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraView(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, viewName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB view name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraViewAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, viewName, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new CassandraViewGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB view name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultCollection.GetIfExists"); - scope.Start(); - try - { - var response = _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraView(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, viewName, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new CassandraViewGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultData.Serialization.cs deleted file mode 100644 index dda3d0de1eb7..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultData.Serialization.cs +++ /dev/null @@ -1,436 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class CassandraViewGetResultData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraViewGetResultData)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Resource)) - { - writer.WritePropertyName("resource"u8); - writer.WriteObjectValue(Resource, options); - } - if (Optional.IsDefined(Options)) - { - writer.WritePropertyName("options"u8); - writer.WriteObjectValue(Options, options); - } - writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - CassandraViewGetResultData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraViewGetResultData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCassandraViewGetResultData(document.RootElement, options); - } - - internal static CassandraViewGetResultData DeserializeCassandraViewGetResultData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ManagedServiceIdentity identity = default; - IDictionary tags = default; - AzureLocation location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - CassandraViewGetPropertiesResource resource = default; - CassandraViewGetPropertiesOptions options0 = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("location"u8)) - { - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("resource"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resource = CassandraViewGetPropertiesResource.DeserializeCassandraViewGetPropertiesResource(property0.Value, options); - continue; - } - if (property0.NameEquals("options"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - options0 = CassandraViewGetPropertiesOptions.DeserializeCassandraViewGetPropertiesOptions(property0.Value, options); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CassandraViewGetResultData( - id, - name, - type, - systemData, - tags ?? new ChangeTrackingDictionary(), - location, - resource, - options0, - identity, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" location: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" location: "); - builder.AppendLine($"'{Location.ToString()}'"); - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" tags: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Tags)) - { - if (Tags.Any()) - { - builder.Append(" tags: "); - builder.AppendLine("{"); - foreach (var item in Tags) - { - builder.Append($" '{item.Key}': "); - if (item.Value == null) - { - builder.Append("null"); - continue; - } - if (item.Value.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{item.Value}'''"); - } - else - { - builder.AppendLine($"'{item.Value}'"); - } - } - builder.AppendLine(" }"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.Append(" properties:"); - builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Resource), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" resource: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Resource)) - { - builder.Append(" resource: "); - BicepSerializationHelpers.AppendChildObject(builder, Resource, options, 4, false, " resource: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Options), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" options: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Options)) - { - builder.Append(" options: "); - BicepSerializationHelpers.AppendChildObject(builder, Options, options, 4, false, " options: "); - } - } - - builder.AppendLine(" }"); - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CassandraViewGetResultData)} does not support writing '{options.Format}' format."); - } - } - - CassandraViewGetResultData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCassandraViewGetResultData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CassandraViewGetResultData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultData.cs deleted file mode 100644 index 2539d5967ab1..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultData.cs +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A class representing the CassandraViewGetResult data model. - /// An Azure Cosmos DB Cassandra view. - /// - public partial class CassandraViewGetResultData : TrackedResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The location. - public CassandraViewGetResultData(AzureLocation location) : base(location) - { - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// - /// - /// Identity for the resource. - /// Keeps track of any properties unknown to the library. - internal CassandraViewGetResultData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CassandraViewGetPropertiesResource resource, CassandraViewGetPropertiesOptions options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) - { - Resource = resource; - Options = options; - Identity = identity; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal CassandraViewGetResultData() - { - } - - /// Gets or sets the resource. - [WirePath("properties.resource")] - public CassandraViewGetPropertiesResource Resource { get; set; } - /// Gets or sets the options. - [WirePath("properties.options")] - public CassandraViewGetPropertiesOptions Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultResource.Serialization.cs deleted file mode 100644 index e59269939c0f..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class CassandraViewGetResultResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - CassandraViewGetResultData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - CassandraViewGetResultData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultResource.cs deleted file mode 100644 index 0927acabac60..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultResource.cs +++ /dev/null @@ -1,715 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A Class representing a CassandraViewGetResult along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetCassandraViewGetResultResource method. - /// Otherwise you can get one from its parent resource using the GetCassandraViewGetResult method. - /// - public partial class CassandraViewGetResultResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The accountName. - /// The keyspaceName. - /// The viewName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _cassandraViewGetResultCassandraResourcesClientDiagnostics; - private readonly CassandraResourcesRestOperations _cassandraViewGetResultCassandraResourcesRestClient; - private readonly CassandraViewGetResultData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/views"; - - /// Initializes a new instance of the class for mocking. - protected CassandraViewGetResultResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal CassandraViewGetResultResource(ArmClient client, CassandraViewGetResultData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal CassandraViewGetResultResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _cassandraViewGetResultCassandraResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string cassandraViewGetResultCassandraResourcesApiVersion); - _cassandraViewGetResultCassandraResourcesRestClient = new CassandraResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cassandraViewGetResultCassandraResourcesApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual CassandraViewGetResultData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// Gets an object representing a CassandraViewThroughputSettingResource along with the instance operations that can be performed on it in the CassandraViewGetResult. - /// Returns a object. - public virtual CassandraViewThroughputSettingResource GetCassandraViewThroughputSetting() - { - return new CassandraViewThroughputSettingResource(Client, Id.AppendChildResource("throughputSettings", "default")); - } - - /// - /// Gets the Cassandra view under an existing Azure Cosmos DB database account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultResource.Get"); - scope.Start(); - try - { - var response = await _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraViewAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CassandraViewGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the Cassandra view under an existing Azure Cosmos DB database account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultResource.Get"); - scope.Start(); - try - { - var response = _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraView(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CassandraViewGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes an existing Azure Cosmos DB Cassandra view. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_DeleteCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultResource.Delete"); - scope.Start(); - try - { - var response = await _cassandraViewGetResultCassandraResourcesRestClient.DeleteCassandraViewAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(_cassandraViewGetResultCassandraResourcesClientDiagnostics, Pipeline, _cassandraViewGetResultCassandraResourcesRestClient.CreateDeleteCassandraViewRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes an existing Azure Cosmos DB Cassandra view. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_DeleteCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultResource.Delete"); - scope.Start(); - try - { - var response = _cassandraViewGetResultCassandraResourcesRestClient.DeleteCassandraView(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new CosmosDBArmOperation(_cassandraViewGetResultCassandraResourcesClientDiagnostics, Pipeline, _cassandraViewGetResultCassandraResourcesRestClient.CreateDeleteCassandraViewRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create or update an Azure Cosmos DB Cassandra View - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_CreateUpdateCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for the current Cassandra View. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, CassandraViewGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultResource.Update"); - scope.Start(); - try - { - var response = await _cassandraViewGetResultCassandraResourcesRestClient.CreateUpdateCassandraViewAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new CassandraViewGetResultOperationSource(Client), _cassandraViewGetResultCassandraResourcesClientDiagnostics, Pipeline, _cassandraViewGetResultCassandraResourcesRestClient.CreateCreateUpdateCassandraViewRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create or update an Azure Cosmos DB Cassandra View - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_CreateUpdateCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for the current Cassandra View. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, CassandraViewGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultResource.Update"); - scope.Start(); - try - { - var response = _cassandraViewGetResultCassandraResourcesRestClient.CreateUpdateCassandraView(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken); - var operation = new CosmosDBArmOperation(new CassandraViewGetResultOperationSource(Client), _cassandraViewGetResultCassandraResourcesClientDiagnostics, Pipeline, _cassandraViewGetResultCassandraResourcesRestClient.CreateCreateUpdateCassandraViewRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The value for the tag. - /// The cancellation token to use. - /// or is null. - public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - Argument.AssertNotNull(value, nameof(value)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultResource.AddTag"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues[key] = value; - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraViewAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new CassandraViewGetResultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new CassandraViewGetResultCreateOrUpdateContent(current.Location, current.Resource); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags[key] = value; - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The value for the tag. - /// The cancellation token to use. - /// or is null. - public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - Argument.AssertNotNull(value, nameof(value)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultResource.AddTag"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues[key] = value; - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraView(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new CassandraViewGetResultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new CassandraViewGetResultCreateOrUpdateContent(current.Location, current.Resource); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags[key] = value; - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The set of tags to use as replacement. - /// The cancellation token to use. - /// is null. - public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(tags, nameof(tags)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultResource.SetTags"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues.ReplaceWith(tags); - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraViewAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new CassandraViewGetResultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new CassandraViewGetResultCreateOrUpdateContent(current.Location, current.Resource); - patch.Tags.ReplaceWith(tags); - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The set of tags to use as replacement. - /// The cancellation token to use. - /// is null. - public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(tags, nameof(tags)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultResource.SetTags"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues.ReplaceWith(tags); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraView(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new CassandraViewGetResultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new CassandraViewGetResultCreateOrUpdateContent(current.Location, current.Resource); - patch.Tags.ReplaceWith(tags); - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The cancellation token to use. - /// is null. - public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultResource.RemoveTag"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues.Remove(key); - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraViewAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new CassandraViewGetResultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new CassandraViewGetResultCreateOrUpdateContent(current.Location, current.Resource); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags.Remove(key); - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The cancellation token to use. - /// is null. - public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultResource.RemoveTag"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues.Remove(key); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraView(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new CassandraViewGetResultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new CassandraViewGetResultCreateOrUpdateContent(current.Location, current.Resource); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags.Remove(key); - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewThroughputSettingResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewThroughputSettingResource.Serialization.cs deleted file mode 100644 index 2475f83486ec..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewThroughputSettingResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class CassandraViewThroughputSettingResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - ThroughputSettingData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - ThroughputSettingData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewThroughputSettingResource.cs deleted file mode 100644 index 70d024fa4e59..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewThroughputSettingResource.cs +++ /dev/null @@ -1,792 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A Class representing a CassandraViewThroughputSetting along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetCassandraViewThroughputSettingResource method. - /// Otherwise you can get one from its parent resource using the GetCassandraViewThroughputSetting method. - /// - public partial class CassandraViewThroughputSettingResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The accountName. - /// The keyspaceName. - /// The viewName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics; - private readonly CassandraResourcesRestOperations _cassandraViewThroughputSettingCassandraResourcesRestClient; - private readonly ThroughputSettingData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/views/throughputSettings"; - - /// Initializes a new instance of the class for mocking. - protected CassandraViewThroughputSettingResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal CassandraViewThroughputSettingResource(ArmClient client, ThroughputSettingData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal CassandraViewThroughputSettingResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string cassandraViewThroughputSettingCassandraResourcesApiVersion); - _cassandraViewThroughputSettingCassandraResourcesRestClient = new CassandraResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cassandraViewThroughputSettingCassandraResourcesApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual ThroughputSettingData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the provided name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraViewThroughput - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.Get"); - scope.Start(); - try - { - var response = await _cassandraViewThroughputSettingCassandraResourcesRestClient.GetCassandraViewThroughputAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CassandraViewThroughputSettingResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the provided name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraViewThroughput - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.Get"); - scope.Start(); - try - { - var response = _cassandraViewThroughputSettingCassandraResourcesRestClient.GetCassandraViewThroughput(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CassandraViewThroughputSettingResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Update RUs per second of an Azure Cosmos DB Cassandra view - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default - /// - /// - /// Operation Id - /// CassandraResources_UpdateCassandraViewThroughput - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The RUs per second of the parameters to provide for the current Cassandra view. - /// The cancellation token to use. - /// is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, ThroughputSettingsUpdateData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _cassandraViewThroughputSettingCassandraResourcesRestClient.UpdateCassandraViewThroughputAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new CassandraViewThroughputSettingOperationSource(Client), _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics, Pipeline, _cassandraViewThroughputSettingCassandraResourcesRestClient.CreateUpdateCassandraViewThroughputRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, data).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Update RUs per second of an Azure Cosmos DB Cassandra view - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default - /// - /// - /// Operation Id - /// CassandraResources_UpdateCassandraViewThroughput - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The RUs per second of the parameters to provide for the current Cassandra view. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, ThroughputSettingsUpdateData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.CreateOrUpdate"); - scope.Start(); - try - { - var response = _cassandraViewThroughputSettingCassandraResourcesRestClient.UpdateCassandraViewThroughput(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, data, cancellationToken); - var operation = new CosmosDBArmOperation(new CassandraViewThroughputSettingOperationSource(Client), _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics, Pipeline, _cassandraViewThroughputSettingCassandraResourcesRestClient.CreateUpdateCassandraViewThroughputRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, data).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToAutoscale - /// - /// - /// Operation Id - /// CassandraResources_MigrateCassandraViewToAutoscale - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task> MigrateCassandraViewToAutoscaleAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.MigrateCassandraViewToAutoscale"); - scope.Start(); - try - { - var response = await _cassandraViewThroughputSettingCassandraResourcesRestClient.MigrateCassandraViewToAutoscaleAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new CassandraViewThroughputSettingOperationSource(Client), _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics, Pipeline, _cassandraViewThroughputSettingCassandraResourcesRestClient.CreateMigrateCassandraViewToAutoscaleRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToAutoscale - /// - /// - /// Operation Id - /// CassandraResources_MigrateCassandraViewToAutoscale - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation MigrateCassandraViewToAutoscale(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.MigrateCassandraViewToAutoscale"); - scope.Start(); - try - { - var response = _cassandraViewThroughputSettingCassandraResourcesRestClient.MigrateCassandraViewToAutoscale(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken); - var operation = new CosmosDBArmOperation(new CassandraViewThroughputSettingOperationSource(Client), _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics, Pipeline, _cassandraViewThroughputSettingCassandraResourcesRestClient.CreateMigrateCassandraViewToAutoscaleRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToManualThroughput - /// - /// - /// Operation Id - /// CassandraResources_MigrateCassandraViewToManualThroughput - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task> MigrateCassandraViewToManualThroughputAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.MigrateCassandraViewToManualThroughput"); - scope.Start(); - try - { - var response = await _cassandraViewThroughputSettingCassandraResourcesRestClient.MigrateCassandraViewToManualThroughputAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new CassandraViewThroughputSettingOperationSource(Client), _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics, Pipeline, _cassandraViewThroughputSettingCassandraResourcesRestClient.CreateMigrateCassandraViewToManualThroughputRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToManualThroughput - /// - /// - /// Operation Id - /// CassandraResources_MigrateCassandraViewToManualThroughput - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation MigrateCassandraViewToManualThroughput(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.MigrateCassandraViewToManualThroughput"); - scope.Start(); - try - { - var response = _cassandraViewThroughputSettingCassandraResourcesRestClient.MigrateCassandraViewToManualThroughput(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken); - var operation = new CosmosDBArmOperation(new CassandraViewThroughputSettingOperationSource(Client), _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics, Pipeline, _cassandraViewThroughputSettingCassandraResourcesRestClient.CreateMigrateCassandraViewToManualThroughputRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraViewThroughput - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The value for the tag. - /// The cancellation token to use. - /// or is null. - public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - Argument.AssertNotNull(value, nameof(value)); - - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.AddTag"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues[key] = value; - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _cassandraViewThroughputSettingCassandraResourcesRestClient.GetCassandraViewThroughputAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new CassandraViewThroughputSettingResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new ThroughputSettingsUpdateData(current.Location, current.Resource); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags[key] = value; - var result = await CreateOrUpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraViewThroughput - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The value for the tag. - /// The cancellation token to use. - /// or is null. - public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - Argument.AssertNotNull(value, nameof(value)); - - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.AddTag"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues[key] = value; - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _cassandraViewThroughputSettingCassandraResourcesRestClient.GetCassandraViewThroughput(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken); - return Response.FromValue(new CassandraViewThroughputSettingResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new ThroughputSettingsUpdateData(current.Location, current.Resource); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags[key] = value; - var result = CreateOrUpdate(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraViewThroughput - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The set of tags to use as replacement. - /// The cancellation token to use. - /// is null. - public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(tags, nameof(tags)); - - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.SetTags"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues.ReplaceWith(tags); - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _cassandraViewThroughputSettingCassandraResourcesRestClient.GetCassandraViewThroughputAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new CassandraViewThroughputSettingResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new ThroughputSettingsUpdateData(current.Location, current.Resource); - patch.Tags.ReplaceWith(tags); - var result = await CreateOrUpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraViewThroughput - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The set of tags to use as replacement. - /// The cancellation token to use. - /// is null. - public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(tags, nameof(tags)); - - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.SetTags"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues.ReplaceWith(tags); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _cassandraViewThroughputSettingCassandraResourcesRestClient.GetCassandraViewThroughput(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken); - return Response.FromValue(new CassandraViewThroughputSettingResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new ThroughputSettingsUpdateData(current.Location, current.Resource); - patch.Tags.ReplaceWith(tags); - var result = CreateOrUpdate(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraViewThroughput - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The cancellation token to use. - /// is null. - public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.RemoveTag"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues.Remove(key); - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _cassandraViewThroughputSettingCassandraResourcesRestClient.GetCassandraViewThroughputAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new CassandraViewThroughputSettingResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new ThroughputSettingsUpdateData(current.Location, current.Resource); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags.Remove(key); - var result = await CreateOrUpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraViewThroughput - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The cancellation token to use. - /// is null. - public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.RemoveTag"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues.Remove(key); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _cassandraViewThroughputSettingCassandraResourcesRestClient.GetCassandraViewThroughput(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken); - return Response.FromValue(new CassandraViewThroughputSettingResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new ThroughputSettingsUpdateData(current.Location, current.Resource); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags.Remove(key); - var result = CreateOrUpdate(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountCollection.cs index 7b91d45efe57..90f4ba018c99 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountCollection.cs @@ -66,7 +66,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -115,7 +115,7 @@ public virtual async Task> CreateOrUpdateA /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -164,7 +164,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wa /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -209,7 +209,7 @@ public virtual async Task> GetAsync(string acc /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -254,7 +254,7 @@ public virtual Response Get(string accountName, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(CancellationTo /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string accountName, Cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string accountName, CancellationToken cance /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task> GetIfExists /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountData.Serialization.cs index 0a489937adec..cdcba5e4903d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountData.Serialization.cs @@ -291,11 +291,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri } writer.WriteEndArray(); } - if (Optional.IsDefined(DiagnosticLogSettings)) - { - writer.WritePropertyName("diagnosticLogSettings"u8); - writer.WriteObjectValue(DiagnosticLogSettings, options); - } if (Optional.IsDefined(DisableLocalAuth)) { writer.WritePropertyName("disableLocalAuth"u8); @@ -306,21 +301,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("capacity"u8); writer.WriteObjectValue(Capacity, options); } - if (Optional.IsDefined(CapacityMode)) - { - writer.WritePropertyName("capacityMode"u8); - writer.WriteStringValue(CapacityMode.Value.ToString()); - } - if (Optional.IsDefined(CapacityModeChangeTransitionState)) - { - writer.WritePropertyName("capacityModeChangeTransitionState"u8); - writer.WriteObjectValue(CapacityModeChangeTransitionState, options); - } - if (Optional.IsDefined(EnableMaterializedViews)) - { - writer.WritePropertyName("enableMaterializedViews"u8); - writer.WriteBooleanValue(EnableMaterializedViews.Value); - } if (options.Format != "W" && Optional.IsDefined(KeysMetadata)) { writer.WritePropertyName("keysMetadata"u8); @@ -331,36 +311,21 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("enablePartitionMerge"u8); writer.WriteBooleanValue(EnablePartitionMerge.Value); } - if (Optional.IsDefined(EnableBurstCapacity)) - { - writer.WritePropertyName("enableBurstCapacity"u8); - writer.WriteBooleanValue(EnableBurstCapacity.Value); - } if (Optional.IsDefined(MinimalTlsVersion)) { writer.WritePropertyName("minimalTlsVersion"u8); writer.WriteStringValue(MinimalTlsVersion.Value.ToString()); } + if (Optional.IsDefined(EnableBurstCapacity)) + { + writer.WritePropertyName("enableBurstCapacity"u8); + writer.WriteBooleanValue(EnableBurstCapacity.Value); + } if (Optional.IsDefined(CustomerManagedKeyStatus)) { writer.WritePropertyName("customerManagedKeyStatus"u8); writer.WriteStringValue(CustomerManagedKeyStatus); } - if (Optional.IsDefined(EnablePriorityBasedExecution)) - { - writer.WritePropertyName("enablePriorityBasedExecution"u8); - writer.WriteBooleanValue(EnablePriorityBasedExecution.Value); - } - if (Optional.IsDefined(DefaultPriorityLevel)) - { - writer.WritePropertyName("defaultPriorityLevel"u8); - writer.WriteStringValue(DefaultPriorityLevel.Value.ToString()); - } - if (Optional.IsDefined(EnablePerRegionPerPartitionAutoscale)) - { - writer.WritePropertyName("enablePerRegionPerPartitionAutoscale"u8); - writer.WriteBooleanValue(EnablePerRegionPerPartitionAutoscale.Value); - } writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -440,20 +405,13 @@ internal static CosmosDBAccountData DeserializeCosmosDBAccountData(JsonElement e IList cors = default; NetworkAclBypass? networkAclBypass = default; IList networkAclBypassResourceIds = default; - DiagnosticLogSettings diagnosticLogSettings = default; bool? disableLocalAuth = default; CosmosDBAccountCapacity capacity = default; - CapacityMode? capacityMode = default; - CapacityModeChangeTransitionState capacityModeChangeTransitionState = default; - bool? enableMaterializedViews = default; DatabaseAccountKeysMetadata keysMetadata = default; bool? enablePartitionMerge = default; - bool? enableBurstCapacity = default; CosmosDBMinimalTlsVersion? minimalTlsVersion = default; + bool? enableBurstCapacity = default; string customerManagedKeyStatus = default; - bool? enablePriorityBasedExecution = default; - DefaultPriorityLevel? defaultPriorityLevel = default; - bool? enablePerRegionPerPartitionAutoscale = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -862,15 +820,6 @@ internal static CosmosDBAccountData DeserializeCosmosDBAccountData(JsonElement e networkAclBypassResourceIds = array; continue; } - if (property0.NameEquals("diagnosticLogSettings"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - diagnosticLogSettings = DiagnosticLogSettings.DeserializeDiagnosticLogSettings(property0.Value, options); - continue; - } if (property0.NameEquals("disableLocalAuth"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -889,33 +838,6 @@ internal static CosmosDBAccountData DeserializeCosmosDBAccountData(JsonElement e capacity = CosmosDBAccountCapacity.DeserializeCosmosDBAccountCapacity(property0.Value, options); continue; } - if (property0.NameEquals("capacityMode"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - capacityMode = new CapacityMode(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("capacityModeChangeTransitionState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - capacityModeChangeTransitionState = CapacityModeChangeTransitionState.DeserializeCapacityModeChangeTransitionState(property0.Value, options); - continue; - } - if (property0.NameEquals("enableMaterializedViews"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableMaterializedViews = property0.Value.GetBoolean(); - continue; - } if (property0.NameEquals("keysMetadata"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -934,15 +856,6 @@ internal static CosmosDBAccountData DeserializeCosmosDBAccountData(JsonElement e enablePartitionMerge = property0.Value.GetBoolean(); continue; } - if (property0.NameEquals("enableBurstCapacity"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableBurstCapacity = property0.Value.GetBoolean(); - continue; - } if (property0.NameEquals("minimalTlsVersion"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -952,36 +865,18 @@ internal static CosmosDBAccountData DeserializeCosmosDBAccountData(JsonElement e minimalTlsVersion = new CosmosDBMinimalTlsVersion(property0.Value.GetString()); continue; } - if (property0.NameEquals("customerManagedKeyStatus"u8)) - { - customerManagedKeyStatus = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("enablePriorityBasedExecution"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enablePriorityBasedExecution = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("defaultPriorityLevel"u8)) + if (property0.NameEquals("enableBurstCapacity"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - defaultPriorityLevel = new DefaultPriorityLevel(property0.Value.GetString()); + enableBurstCapacity = property0.Value.GetBoolean(); continue; } - if (property0.NameEquals("enablePerRegionPerPartitionAutoscale"u8)) + if (property0.NameEquals("customerManagedKeyStatus"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enablePerRegionPerPartitionAutoscale = property0.Value.GetBoolean(); + customerManagedKeyStatus = property0.Value.GetString(); continue; } } @@ -1001,6 +896,7 @@ internal static CosmosDBAccountData DeserializeCosmosDBAccountData(JsonElement e tags ?? new ChangeTrackingDictionary(), location, kind, + identity, provisioningState, documentEndpoint, databaseAccountOfferType, @@ -1033,21 +929,13 @@ internal static CosmosDBAccountData DeserializeCosmosDBAccountData(JsonElement e cors ?? new ChangeTrackingList(), networkAclBypass, networkAclBypassResourceIds ?? new ChangeTrackingList(), - diagnosticLogSettings, disableLocalAuth, capacity, - capacityMode, - capacityModeChangeTransitionState, - enableMaterializedViews, keysMetadata, enablePartitionMerge, - enableBurstCapacity, minimalTlsVersion, + enableBurstCapacity, customerManagedKeyStatus, - enablePriorityBasedExecution, - defaultPriorityLevel, - enablePerRegionPerPartitionAutoscale, - identity, serializedAdditionalRawData); } @@ -1802,26 +1690,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("DiagnosticLogEnableFullTextQuery", out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" diagnosticLogSettings: "); - builder.AppendLine("{"); - builder.AppendLine(" diagnosticLogSettings: {"); - builder.Append(" enableFullTextQuery: "); - builder.AppendLine(propertyOverride); - builder.AppendLine(" }"); - builder.AppendLine(" }"); - } - else - { - if (Optional.IsDefined(DiagnosticLogSettings)) - { - builder.Append(" diagnosticLogSettings: "); - BicepSerializationHelpers.AppendChildObject(builder, DiagnosticLogSettings, options, 4, false, " diagnosticLogSettings: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DisableLocalAuth), out propertyOverride); if (hasPropertyOverride) { @@ -1858,52 +1726,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CapacityMode), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" capacityMode: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(CapacityMode)) - { - builder.Append(" capacityMode: "); - builder.AppendLine($"'{CapacityMode.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CapacityModeChangeTransitionState), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" capacityModeChangeTransitionState: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(CapacityModeChangeTransitionState)) - { - builder.Append(" capacityModeChangeTransitionState: "); - BicepSerializationHelpers.AppendChildObject(builder, CapacityModeChangeTransitionState, options, 4, false, " capacityModeChangeTransitionState: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnableMaterializedViews), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" enableMaterializedViews: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(EnableMaterializedViews)) - { - builder.Append(" enableMaterializedViews: "); - var boolValue = EnableMaterializedViews.Value == true ? "true" : "false"; - builder.AppendLine($"{boolValue}"); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(KeysMetadata), out propertyOverride); if (hasPropertyOverride) { @@ -1935,34 +1757,34 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnableBurstCapacity), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MinimalTlsVersion), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" enableBurstCapacity: "); + builder.Append(" minimalTlsVersion: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(EnableBurstCapacity)) + if (Optional.IsDefined(MinimalTlsVersion)) { - builder.Append(" enableBurstCapacity: "); - var boolValue = EnableBurstCapacity.Value == true ? "true" : "false"; - builder.AppendLine($"{boolValue}"); + builder.Append(" minimalTlsVersion: "); + builder.AppendLine($"'{MinimalTlsVersion.Value.ToString()}'"); } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MinimalTlsVersion), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnableBurstCapacity), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" minimalTlsVersion: "); + builder.Append(" enableBurstCapacity: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(MinimalTlsVersion)) + if (Optional.IsDefined(EnableBurstCapacity)) { - builder.Append(" minimalTlsVersion: "); - builder.AppendLine($"'{MinimalTlsVersion.Value.ToString()}'"); + builder.Append(" enableBurstCapacity: "); + var boolValue = EnableBurstCapacity.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); } } @@ -1989,53 +1811,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnablePriorityBasedExecution), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" enablePriorityBasedExecution: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(EnablePriorityBasedExecution)) - { - builder.Append(" enablePriorityBasedExecution: "); - var boolValue = EnablePriorityBasedExecution.Value == true ? "true" : "false"; - builder.AppendLine($"{boolValue}"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DefaultPriorityLevel), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" defaultPriorityLevel: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(DefaultPriorityLevel)) - { - builder.Append(" defaultPriorityLevel: "); - builder.AppendLine($"'{DefaultPriorityLevel.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnablePerRegionPerPartitionAutoscale), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" enablePerRegionPerPartitionAutoscale: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(EnablePerRegionPerPartitionAutoscale)) - { - builder.Append(" enablePerRegionPerPartitionAutoscale: "); - var boolValue = EnablePerRegionPerPartitionAutoscale.Value == true ? "true" : "false"; - builder.AppendLine($"{boolValue}"); - } - } - builder.AppendLine(" }"); builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountData.cs index 32202f3b3d50..20323b8b4154 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountData.cs @@ -75,6 +75,7 @@ public CosmosDBAccountData(AzureLocation location) : base(location) /// The tags. /// The location. /// Indicates the type of database account. This can only be set at database account creation. + /// Identity for the resource. /// The status of the Cosmos DB account at the time the operation was called. The status can be one of following. 'Creating' – the Cosmos DB account is being created. When an account is in Creating state, only properties that are specified as input for the Create Cosmos DB account operation are returned. 'Succeeded' – the Cosmos DB account is active for use. 'Updating' – the Cosmos DB account is being updated. 'Deleting' – the Cosmos DB account is being deleted. 'Failed' – the Cosmos DB account failed creation. 'DeletionFailed' – the Cosmos DB account deletion failed. /// The connection endpoint for the Cosmos DB database account. /// The offer type for the Cosmos DB database account. Default value: Standard. @@ -111,25 +112,18 @@ public CosmosDBAccountData(AzureLocation location) : base(location) /// The CORS policy for the Cosmos DB database account. /// Indicates what services are allowed to bypass firewall checks. /// An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. - /// The Object representing the different Diagnostic log settings for the Cosmos DB Account. /// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. /// The object that represents all properties related to capacity enforcement on an account. - /// Indicates the capacityMode of the Cosmos DB account. - /// The object that represents the migration state for the CapacityMode of the Cosmos DB account. - /// Flag to indicate whether to enable MaterializedViews on the Cosmos DB account. /// The object that represents the metadata for the Account Keys of the Cosmos DB account. /// Flag to indicate enabling/disabling of Partition Merge feature on the account. - /// Flag to indicate enabling/disabling of Burst Capacity Preview feature on the account. - /// Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. + /// Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. + /// Flag to indicate enabling/disabling of Burst Capacity feature on the account. /// Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides troubleshooting guidance. - /// Flag to indicate enabling/disabling of Priority Based Execution Preview feature on the account. - /// Enum to indicate default Priority Level of request for Priority Based Execution. - /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account. - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CosmosDBAccountData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBAccountKind? kind, string provisioningState, string documentEndpoint, CosmosDBAccountOfferType? databaseAccountOfferType, IList ipRules, bool? isVirtualNetworkFilterEnabled, bool? enableAutomaticFailover, ConsistencyPolicy consistencyPolicy, IList capabilities, IReadOnlyList writeLocations, IReadOnlyList readLocations, IReadOnlyList locations, IReadOnlyList failoverPolicies, IList virtualNetworkRules, IReadOnlyList privateEndpointConnections, bool? enableMultipleWriteLocations, bool? enableCassandraConnector, ConnectorOffer? connectorOffer, bool? disableKeyBasedMetadataWriteAccess, Uri keyVaultKeyUri, string defaultIdentity, CosmosDBPublicNetworkAccess? publicNetworkAccess, bool? isFreeTierEnabled, ApiProperties apiProperties, bool? isAnalyticalStorageEnabled, AnalyticalStorageConfiguration analyticalStorageConfiguration, Guid? instanceId, CosmosDBAccountCreateMode? createMode, CosmosDBAccountRestoreParameters restoreParameters, CosmosDBAccountBackupPolicy backupPolicy, IList cors, NetworkAclBypass? networkAclBypass, IList networkAclBypassResourceIds, DiagnosticLogSettings diagnosticLogSettings, bool? disableLocalAuth, CosmosDBAccountCapacity capacity, CapacityMode? capacityMode, CapacityModeChangeTransitionState capacityModeChangeTransitionState, bool? enableMaterializedViews, DatabaseAccountKeysMetadata keysMetadata, bool? enablePartitionMerge, bool? enableBurstCapacity, CosmosDBMinimalTlsVersion? minimalTlsVersion, string customerManagedKeyStatus, bool? enablePriorityBasedExecution, DefaultPriorityLevel? defaultPriorityLevel, bool? enablePerRegionPerPartitionAutoscale, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBAccountData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBAccountKind? kind, ManagedServiceIdentity identity, string provisioningState, string documentEndpoint, CosmosDBAccountOfferType? databaseAccountOfferType, IList ipRules, bool? isVirtualNetworkFilterEnabled, bool? enableAutomaticFailover, ConsistencyPolicy consistencyPolicy, IList capabilities, IReadOnlyList writeLocations, IReadOnlyList readLocations, IReadOnlyList locations, IReadOnlyList failoverPolicies, IList virtualNetworkRules, IReadOnlyList privateEndpointConnections, bool? enableMultipleWriteLocations, bool? enableCassandraConnector, ConnectorOffer? connectorOffer, bool? disableKeyBasedMetadataWriteAccess, Uri keyVaultKeyUri, string defaultIdentity, CosmosDBPublicNetworkAccess? publicNetworkAccess, bool? isFreeTierEnabled, ApiProperties apiProperties, bool? isAnalyticalStorageEnabled, AnalyticalStorageConfiguration analyticalStorageConfiguration, Guid? instanceId, CosmosDBAccountCreateMode? createMode, CosmosDBAccountRestoreParameters restoreParameters, CosmosDBAccountBackupPolicy backupPolicy, IList cors, NetworkAclBypass? networkAclBypass, IList networkAclBypassResourceIds, bool? disableLocalAuth, CosmosDBAccountCapacity capacity, DatabaseAccountKeysMetadata keysMetadata, bool? enablePartitionMerge, CosmosDBMinimalTlsVersion? minimalTlsVersion, bool? enableBurstCapacity, string customerManagedKeyStatus, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Kind = kind; + Identity = identity; ProvisioningState = provisioningState; DocumentEndpoint = documentEndpoint; DatabaseAccountOfferType = databaseAccountOfferType; @@ -162,21 +156,13 @@ internal CosmosDBAccountData(ResourceIdentifier id, string name, ResourceType re Cors = cors; NetworkAclBypass = networkAclBypass; NetworkAclBypassResourceIds = networkAclBypassResourceIds; - DiagnosticLogSettings = diagnosticLogSettings; DisableLocalAuth = disableLocalAuth; Capacity = capacity; - CapacityMode = capacityMode; - CapacityModeChangeTransitionState = capacityModeChangeTransitionState; - EnableMaterializedViews = enableMaterializedViews; KeysMetadata = keysMetadata; EnablePartitionMerge = enablePartitionMerge; - EnableBurstCapacity = enableBurstCapacity; MinimalTlsVersion = minimalTlsVersion; + EnableBurstCapacity = enableBurstCapacity; CustomerManagedKeyStatus = customerManagedKeyStatus; - EnablePriorityBasedExecution = enablePriorityBasedExecution; - DefaultPriorityLevel = defaultPriorityLevel; - EnablePerRegionPerPartitionAutoscale = enablePerRegionPerPartitionAutoscale; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -188,6 +174,9 @@ internal CosmosDBAccountData() /// Indicates the type of database account. This can only be set at database account creation. [WirePath("kind")] public CosmosDBAccountKind? Kind { get; set; } + /// Identity for the resource. + [WirePath("identity")] + public ManagedServiceIdentity Identity { get; set; } /// The status of the Cosmos DB account at the time the operation was called. The status can be one of following. 'Creating' – the Cosmos DB account is being created. When an account is in Creating state, only properties that are specified as input for the Create Cosmos DB account operation are returned. 'Succeeded' – the Cosmos DB account is active for use. 'Updating' – the Cosmos DB account is being updated. 'Deleting' – the Cosmos DB account is being deleted. 'Failed' – the Cosmos DB account failed creation. 'DeletionFailed' – the Cosmos DB account deletion failed. [WirePath("properties.provisioningState")] public string ProvisioningState { get; } @@ -256,7 +245,7 @@ internal CosmosDBAccountData() public bool? IsFreeTierEnabled { get; set; } /// API specific properties. internal ApiProperties ApiProperties { get; set; } - /// Describes the ServerVersion of an a MongoDB account. + /// Describes the version of the MongoDB account. [WirePath("properties.apiProperties.serverVersion")] public CosmosDBServerVersion? ApiServerVersion { @@ -312,21 +301,6 @@ public AnalyticalStorageSchemaType? AnalyticalStorageSchemaType /// An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. [WirePath("properties.networkAclBypassResourceIds")] public IList NetworkAclBypassResourceIds { get; } - /// The Object representing the different Diagnostic log settings for the Cosmos DB Account. - internal DiagnosticLogSettings DiagnosticLogSettings { get; set; } - /// Describe the level of detail with which queries are to be logged. - [WirePath("properties.diagnosticLogSettings.enableFullTextQuery")] - public EnableFullTextQuery? DiagnosticLogEnableFullTextQuery - { - get => DiagnosticLogSettings is null ? default : DiagnosticLogSettings.EnableFullTextQuery; - set - { - if (DiagnosticLogSettings is null) - DiagnosticLogSettings = new DiagnosticLogSettings(); - DiagnosticLogSettings.EnableFullTextQuery = value; - } - } - /// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. [WirePath("properties.disableLocalAuth")] public bool? DisableLocalAuth { get; set; } @@ -345,41 +319,20 @@ public int? CapacityTotalThroughputLimit } } - /// Indicates the capacityMode of the Cosmos DB account. - [WirePath("properties.capacityMode")] - public CapacityMode? CapacityMode { get; set; } - /// The object that represents the migration state for the CapacityMode of the Cosmos DB account. - [WirePath("properties.capacityModeChangeTransitionState")] - public CapacityModeChangeTransitionState CapacityModeChangeTransitionState { get; set; } - /// Flag to indicate whether to enable MaterializedViews on the Cosmos DB account. - [WirePath("properties.enableMaterializedViews")] - public bool? EnableMaterializedViews { get; set; } /// The object that represents the metadata for the Account Keys of the Cosmos DB account. [WirePath("properties.keysMetadata")] public DatabaseAccountKeysMetadata KeysMetadata { get; } /// Flag to indicate enabling/disabling of Partition Merge feature on the account. [WirePath("properties.enablePartitionMerge")] public bool? EnablePartitionMerge { get; set; } - /// Flag to indicate enabling/disabling of Burst Capacity Preview feature on the account. - [WirePath("properties.enableBurstCapacity")] - public bool? EnableBurstCapacity { get; set; } - /// Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. + /// Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. [WirePath("properties.minimalTlsVersion")] public CosmosDBMinimalTlsVersion? MinimalTlsVersion { get; set; } + /// Flag to indicate enabling/disabling of Burst Capacity feature on the account. + [WirePath("properties.enableBurstCapacity")] + public bool? EnableBurstCapacity { get; set; } /// Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides troubleshooting guidance. [WirePath("properties.customerManagedKeyStatus")] public string CustomerManagedKeyStatus { get; set; } - /// Flag to indicate enabling/disabling of Priority Based Execution Preview feature on the account. - [WirePath("properties.enablePriorityBasedExecution")] - public bool? EnablePriorityBasedExecution { get; set; } - /// Enum to indicate default Priority Level of request for Priority Based Execution. - [WirePath("properties.defaultPriorityLevel")] - public DefaultPriorityLevel? DefaultPriorityLevel { get; set; } - /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account. - [WirePath("properties.enablePerRegionPerPartitionAutoscale")] - public bool? EnablePerRegionPerPartitionAutoscale { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountResource.cs index 0eeb0ea12624..1af896cc6424 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountResource.cs @@ -135,144 +135,6 @@ internal static void ValidateResourceId(ResourceIdentifier id) throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); } - /// Gets a collection of NetworkSecurityPerimeterConfigurationResources in the CosmosDBAccount. - /// An object representing collection of NetworkSecurityPerimeterConfigurationResources and their operations over a NetworkSecurityPerimeterConfigurationResource. - public virtual NetworkSecurityPerimeterConfigurationCollection GetNetworkSecurityPerimeterConfigurations() - { - return GetCachedClient(client => new NetworkSecurityPerimeterConfigurationCollection(client, Id)); - } - - /// - /// Gets effective Network Security Perimeter Configuration for association - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name for Network Security Perimeter configuration. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetNetworkSecurityPerimeterConfigurationAsync(string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) - { - return await GetNetworkSecurityPerimeterConfigurations().GetAsync(networkSecurityPerimeterConfigurationName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets effective Network Security Perimeter Configuration for association - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name for Network Security Perimeter configuration. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetNetworkSecurityPerimeterConfiguration(string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) - { - return GetNetworkSecurityPerimeterConfigurations().Get(networkSecurityPerimeterConfigurationName, cancellationToken); - } - - /// Gets a collection of GraphResourceGetResultResources in the CosmosDBAccount. - /// An object representing collection of GraphResourceGetResultResources and their operations over a GraphResourceGetResultResource. - public virtual GraphResourceGetResultCollection GetGraphResourceGetResults() - { - return GetCachedClient(client => new GraphResourceGetResultCollection(client, Id)); - } - - /// - /// Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB graph resource name. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetGraphResourceGetResultAsync(string graphName, CancellationToken cancellationToken = default) - { - return await GetGraphResourceGetResults().GetAsync(graphName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB graph resource name. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetGraphResourceGetResult(string graphName, CancellationToken cancellationToken = default) - { - return GetGraphResourceGetResults().Get(graphName, cancellationToken); - } - /// Gets a collection of CosmosDBSqlDatabaseResources in the CosmosDBAccount. /// An object representing collection of CosmosDBSqlDatabaseResources and their operations over a CosmosDBSqlDatabaseResource. public virtual CosmosDBSqlDatabaseCollection GetCosmosDBSqlDatabases() @@ -293,7 +155,7 @@ public virtual CosmosDBSqlDatabaseCollection GetCosmosDBSqlDatabases() /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -324,7 +186,7 @@ public virtual async Task> GetCosmosDBSqlD /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -362,7 +224,7 @@ public virtual CosmosDBSqlRoleDefinitionCollection GetCosmosDBSqlRoleDefinitions /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -393,7 +255,7 @@ public virtual async Task> GetCosmos /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -431,7 +293,7 @@ public virtual CosmosDBSqlRoleAssignmentCollection GetCosmosDBSqlRoleAssignments /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -462,7 +324,7 @@ public virtual async Task> GetCosmos /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -500,7 +362,7 @@ public virtual MongoDBDatabaseCollection GetMongoDBDatabases() /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -531,7 +393,7 @@ public virtual async Task> GetMongoDBDatabaseA /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -569,7 +431,7 @@ public virtual MongoDBRoleDefinitionCollection GetMongoDBRoleDefinitions() /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -600,7 +462,7 @@ public virtual async Task> GetMongoDBRol /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -638,7 +500,7 @@ public virtual MongoDBUserDefinitionCollection GetMongoDBUserDefinitions() /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -669,7 +531,7 @@ public virtual async Task> GetMongoDBUse /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -707,7 +569,7 @@ public virtual CosmosDBTableCollection GetCosmosDBTables() /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -738,7 +600,7 @@ public virtual async Task> GetCosmosDBTableAsync /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -776,7 +638,7 @@ public virtual CassandraKeyspaceCollection GetCassandraKeyspaces() /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -807,7 +669,7 @@ public virtual async Task> GetCassandraKeysp /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -845,7 +707,7 @@ public virtual GremlinDatabaseCollection GetGremlinDatabases() /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -876,7 +738,7 @@ public virtual async Task> GetGremlinDatabaseA /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -894,75 +756,6 @@ public virtual Response GetGremlinDatabase(string datab return GetGremlinDatabases().Get(databaseName, cancellationToken); } - /// Gets a collection of DataTransferJobGetResultResources in the CosmosDBAccount. - /// An object representing collection of DataTransferJobGetResultResources and their operations over a DataTransferJobGetResultResource. - public virtual DataTransferJobGetResultCollection GetDataTransferJobGetResults() - { - return GetCachedClient(client => new DataTransferJobGetResultCollection(client, Id)); - } - - /// - /// Get a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetDataTransferJobGetResultAsync(string jobName, CancellationToken cancellationToken = default) - { - return await GetDataTransferJobGetResults().GetAsync(jobName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetDataTransferJobGetResult(string jobName, CancellationToken cancellationToken = default) - { - return GetDataTransferJobGetResults().Get(jobName, cancellationToken); - } - /// Gets a collection of CosmosDBPrivateEndpointConnectionResources in the CosmosDBAccount. /// An object representing collection of CosmosDBPrivateEndpointConnectionResources and their operations over a CosmosDBPrivateEndpointConnectionResource. public virtual CosmosDBPrivateEndpointConnectionCollection GetCosmosDBPrivateEndpointConnections() @@ -983,7 +776,7 @@ public virtual CosmosDBPrivateEndpointConnectionCollection GetCosmosDBPrivateEnd /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1014,7 +807,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1052,7 +845,7 @@ public virtual CosmosDBPrivateLinkResourceCollection GetCosmosDBPrivateLinkResou /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1083,7 +876,7 @@ public virtual async Task> GetCosmosDBPriv /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1121,7 +914,7 @@ public virtual CosmosDBServiceCollection GetCosmosDBServices() /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1152,7 +945,7 @@ public virtual async Task> GetCosmosDBServiceA /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1183,7 +976,7 @@ public virtual Response GetCosmosDBService(string servi /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1223,7 +1016,7 @@ public virtual async Task> GetAsync(Cancellati /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1263,7 +1056,7 @@ public virtual Response Get(CancellationToken cancellat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1305,7 +1098,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1347,7 +1140,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1393,7 +1186,7 @@ public virtual async Task> UpdateAsync(Wai /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1439,7 +1232,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1485,7 +1278,7 @@ public virtual async Task FailoverPriorityChangeAsync(WaitUntil wa /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1531,7 +1324,7 @@ public virtual ArmOperation FailoverPriorityChange(WaitUntil waitUntil, CosmosDB /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1569,7 +1362,7 @@ public virtual async Task> GetKeysAsync(Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1607,7 +1400,7 @@ public virtual Response GetKeys(CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1636,7 +1429,7 @@ public virtual AsyncPageable GetConnectionStrin /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1665,7 +1458,7 @@ public virtual Pageable GetConnectionStrings(Ca /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1711,7 +1504,7 @@ public virtual async Task OfflineRegionAsync(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1757,7 +1550,7 @@ public virtual ArmOperation OfflineRegion(WaitUntil waitUntil, RegionForOnlineOf /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1803,7 +1596,7 @@ public virtual async Task OnlineRegionAsync(WaitUntil waitUntil, R /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1849,7 +1642,7 @@ public virtual ArmOperation OnlineRegion(WaitUntil waitUntil, RegionForOnlineOff /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1887,7 +1680,7 @@ public virtual async Task> GetReadOnlyK /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1925,7 +1718,7 @@ public virtual Response GetReadOnlyKeys(Cancella /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1971,7 +1764,7 @@ public virtual async Task RegenerateKeyAsync(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -2017,7 +1810,7 @@ public virtual ArmOperation RegenerateKey(WaitUntil waitUntil, CosmosDBAccountRe /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -2050,7 +1843,7 @@ public virtual AsyncPageable GetMetricsAsync(string filter, /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -2083,7 +1876,7 @@ public virtual Pageable GetMetrics(string filter, Cancellati /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -2113,7 +1906,7 @@ public virtual AsyncPageable GetUsagesAsync(string filter = n /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -2143,7 +1936,7 @@ public virtual Pageable GetUsages(string filter = null, Cance /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -2172,7 +1965,7 @@ public virtual AsyncPageable GetMetricDefinitionsAsync /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -2201,7 +1994,7 @@ public virtual Pageable GetMetricDefinitions(Cancellat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -2233,7 +2026,7 @@ public virtual AsyncPageable GetMetricsDatabasesAsync(string /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -2265,7 +2058,7 @@ public virtual Pageable GetMetricsDatabases(string databaseR /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -2296,7 +2089,7 @@ public virtual AsyncPageable GetUsagesDatabasesAsync(string d /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -2327,7 +2120,7 @@ public virtual Pageable GetUsagesDatabases(string databaseRid /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -2357,7 +2150,7 @@ public virtual AsyncPageable GetMetricDefinitionsDatab /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -2387,7 +2180,7 @@ public virtual Pageable GetMetricDefinitionsDatabases( /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -2421,7 +2214,7 @@ public virtual AsyncPageable GetMetricsCollectionsAsync(stri /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -2455,7 +2248,7 @@ public virtual Pageable GetMetricsCollections(string databas /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -2488,7 +2281,7 @@ public virtual AsyncPageable GetUsagesCollectionsAsync(string /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -2521,7 +2314,7 @@ public virtual Pageable GetUsagesCollections(string databaseR /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -2553,7 +2346,7 @@ public virtual AsyncPageable GetMetricDefinitionsColle /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -2585,7 +2378,7 @@ public virtual Pageable GetMetricDefinitionsCollection /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -2621,7 +2414,7 @@ public virtual AsyncPageable GetMetricsCollectionRegionsAsyn /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -2657,7 +2450,7 @@ public virtual Pageable GetMetricsCollectionRegions(string r /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -2689,7 +2482,7 @@ public virtual AsyncPageable GetMetricsDatabaseAccountRegion /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -2721,7 +2514,7 @@ public virtual Pageable GetMetricsDatabaseAccountRegions(str /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -2755,7 +2548,7 @@ public virtual AsyncPageable GetMetricsPercentileSourc /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -2789,7 +2582,7 @@ public virtual Pageable GetMetricsPercentileSourceTarg /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -2821,7 +2614,7 @@ public virtual AsyncPageable GetMetricsPercentileTarge /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -2853,7 +2646,7 @@ public virtual Pageable GetMetricsPercentileTargets(st /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -2882,7 +2675,7 @@ public virtual AsyncPageable GetMetricsPercentilesAsyn /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -2911,7 +2704,7 @@ public virtual Pageable GetMetricsPercentiles(string f /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -2947,7 +2740,7 @@ public virtual AsyncPageable GetMetricsCollectionPartitionRegio /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -2983,7 +2776,7 @@ public virtual Pageable GetMetricsCollectionPartitionRegions(st /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -3017,7 +2810,7 @@ public virtual AsyncPageable GetMetricsCollectionPartitionsAsyn /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -3051,7 +2844,7 @@ public virtual Pageable GetMetricsCollectionPartitions(string d /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -3084,7 +2877,7 @@ public virtual AsyncPageable GetUsagesCollectionPartitionsAsync( /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -3117,7 +2910,7 @@ public virtual Pageable GetUsagesCollectionPartitions(string dat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -3153,7 +2946,7 @@ public virtual AsyncPageable GetMetricsPartitionKeyRangeIdsAsyn /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -3189,7 +2982,7 @@ public virtual Pageable GetMetricsPartitionKeyRangeIds(string d /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -3227,7 +3020,7 @@ public virtual AsyncPageable GetMetricsPartitionKeyRangeIdRegio /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -3265,7 +3058,7 @@ public virtual Pageable GetMetricsPartitionKeyRangeIdRegions(st /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -3327,7 +3120,7 @@ public virtual async Task> AddTagAsync(string /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -3389,7 +3182,7 @@ public virtual Response AddTag(string key, string value /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -3446,7 +3239,7 @@ public virtual async Task> SetTagsAsync(IDicti /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -3503,7 +3296,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -3563,7 +3356,7 @@ public virtual async Task> RemoveTagAsync(stri /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationCollection.cs index 5134e20a5f3e..7b2ac74879b9 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -106,7 +106,7 @@ public virtual async Task> GetAsync(AzureLoca /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -147,7 +147,7 @@ public virtual Response Get(AzureLocation location, Ca /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -176,7 +176,7 @@ public virtual AsyncPageable GetAllAsync(CancellationT /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -205,7 +205,7 @@ public virtual Pageable GetAll(CancellationToken cance /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -244,7 +244,7 @@ public virtual async Task> ExistsAsync(AzureLocation location, Ca /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual Response Exists(AzureLocation location, CancellationToken c /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -324,7 +324,7 @@ public virtual async Task> GetIfExist /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationResource.cs index d20b05df8091..bdc28c0c74e9 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationResource.cs @@ -107,7 +107,7 @@ public virtual RestorableCosmosDBAccountCollection GetRestorableCosmosDBAccounts /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -136,7 +136,7 @@ public virtual async Task> GetRestor /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -165,7 +165,7 @@ public virtual Response GetRestorableCosmosDB /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -205,7 +205,7 @@ public virtual async Task> GetAsync(Cancellat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateEndpointConnectionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateEndpointConnectionCollection.cs index 0148e3a30cf3..4c60237c7549 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateEndpointConnectionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateEndpointConnectionCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrU /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string pr /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -281,7 +281,7 @@ public virtual AsyncPageable GetAllAs /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -310,7 +310,7 @@ public virtual Pageable GetAll(Cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -353,7 +353,7 @@ public virtual async Task> ExistsAsync(string privateEndpointConn /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -396,7 +396,7 @@ public virtual Response Exists(string privateEndpointConnectionName, Cance /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -441,7 +441,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateEndpointConnectionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateEndpointConnectionResource.cs index c73ca2061079..cbe0e3934a96 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateEndpointConnectionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateEndpointConnectionResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(Cancellat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateLinkResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateLinkResource.cs index 596b9dc3254d..e5b17d09c694 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateLinkResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateLinkResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(Cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateLinkResourceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateLinkResourceCollection.cs index b35a0e50ba24..8bd27a6dc7b4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateLinkResourceCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateLinkResourceCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -154,7 +154,7 @@ public virtual Response Get(string groupName, Cance /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual AsyncPageable GetAllAsync(Cancellati /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -212,7 +212,7 @@ public virtual Pageable GetAll(CancellationToken ca /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -255,7 +255,7 @@ public virtual async Task> ExistsAsync(string groupName, Cancella /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -298,7 +298,7 @@ public virtual Response Exists(string groupName, CancellationToken cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -343,7 +343,7 @@ public virtual async Task> GetIfEx /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBServiceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBServiceCollection.cs index 580eb002ea08..b5a4221d3f67 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBServiceCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBServiceCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateA /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wa /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string ser /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string serviceName, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(CancellationTo /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string serviceName, Cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string serviceName, CancellationToken cance /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExists /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBServiceResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBServiceResource.cs index 8fd6f16cc5bf..73f5be22c349 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBServiceResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBServiceResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(Cancellati /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken cancellat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> UpdateAsync(Wai /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlClientEncryptionKeyCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlClientEncryptionKeyCollection.cs index 552987336f4c..7d2c3348c4b5 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlClientEncryptionKeyCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlClientEncryptionKeyCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpda /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string clien /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(Cancellat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string clientEncryptionKey /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string clientEncryptionKeyName, Cancellatio /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlClientEncryptionKeyResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlClientEncryptionKeyResource.cs index 5844786a90ed..63760146c5ca 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlClientEncryptionKeyResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlClientEncryptionKeyResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(Cancellation /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -229,7 +229,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerCollection.cs index 2e3a36e86027..259071b30fed 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUp /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUnt /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(strin /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string containerName, /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancellat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken c /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string containerName, Canc /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string containerName, CancellationToken can /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfE /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerData.Serialization.cs index 9b42f5b0caed..b1ad773ef7bb 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerData.Serialization.cs @@ -30,12 +30,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -120,7 +114,6 @@ internal static CosmosDBSqlContainerData DeserializeCosmosDBSqlContainerData(Jso { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -133,16 +126,6 @@ internal static CosmosDBSqlContainerData DeserializeCosmosDBSqlContainerData(Jso Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -231,7 +214,6 @@ internal static CosmosDBSqlContainerData DeserializeCosmosDBSqlContainerData(Jso location, resource, options0, - identity, serializedAdditionalRawData); } @@ -318,21 +300,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerData.cs index 25491f81dcb4..e10bf6bc3d9f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerData.cs @@ -66,13 +66,11 @@ public CosmosDBSqlContainerData(AzureLocation location) : base(location) /// The location. /// /// - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CosmosDBSqlContainerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCosmosDBSqlContainerResourceInfo resource, CosmosDBSqlContainerPropertiesConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBSqlContainerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCosmosDBSqlContainerResourceInfo resource, CosmosDBSqlContainerPropertiesConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -87,8 +85,5 @@ internal CosmosDBSqlContainerData() /// Gets or sets the options. [WirePath("properties.options")] public CosmosDBSqlContainerPropertiesConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerResource.cs index 8d29594a34f1..426fca4e40ba 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerResource.cs @@ -118,7 +118,7 @@ public virtual CosmosDBSqlStoredProcedureCollection GetCosmosDBSqlStoredProcedur /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -149,7 +149,7 @@ public virtual async Task> GetCosmo /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -187,7 +187,7 @@ public virtual CosmosDBSqlUserDefinedFunctionCollection GetCosmosDBSqlUserDefine /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -218,7 +218,7 @@ public virtual async Task> GetC /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -256,7 +256,7 @@ public virtual CosmosDBSqlTriggerCollection GetCosmosDBSqlTriggers() /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -287,7 +287,7 @@ public virtual async Task> GetCosmosDBSqlTr /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -318,7 +318,7 @@ public virtual Response GetCosmosDBSqlTrigger(string /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -358,7 +358,7 @@ public virtual async Task> GetAsync(Cance /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Get(CancellationToken canc /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -440,7 +440,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -482,7 +482,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -528,7 +528,7 @@ public virtual async Task> UpdateAsyn /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -561,98 +561,6 @@ public virtual ArmOperation Update(WaitUntil waitU } } - /// - /// Merges the partitions of a SQL Container - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/partitionMerge - /// - /// - /// Operation Id - /// SqlResources_ListSqlContainerPartitionMerge - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters for the merge operation. - /// The cancellation token to use. - /// is null. - public virtual async Task> GetSqlContainerPartitionMergeAsync(WaitUntil waitUntil, MergeParameters mergeParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - - using var scope = _cosmosDBSqlContainerSqlResourcesClientDiagnostics.CreateScope("CosmosDBSqlContainerResource.GetSqlContainerPartitionMerge"); - scope.Start(); - try - { - var response = await _cosmosDBSqlContainerSqlResourcesRestClient.ListSqlContainerPartitionMergeAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, mergeParameters, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new PhysicalPartitionStorageInfoCollectionOperationSource(), _cosmosDBSqlContainerSqlResourcesClientDiagnostics, Pipeline, _cosmosDBSqlContainerSqlResourcesRestClient.CreateListSqlContainerPartitionMergeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, mergeParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Merges the partitions of a SQL Container - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/partitionMerge - /// - /// - /// Operation Id - /// SqlResources_ListSqlContainerPartitionMerge - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters for the merge operation. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation GetSqlContainerPartitionMerge(WaitUntil waitUntil, MergeParameters mergeParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - - using var scope = _cosmosDBSqlContainerSqlResourcesClientDiagnostics.CreateScope("CosmosDBSqlContainerResource.GetSqlContainerPartitionMerge"); - scope.Start(); - try - { - var response = _cosmosDBSqlContainerSqlResourcesRestClient.ListSqlContainerPartitionMerge(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, mergeParameters, cancellationToken); - var operation = new CosmosDBArmOperation(new PhysicalPartitionStorageInfoCollectionOperationSource(), _cosmosDBSqlContainerSqlResourcesClientDiagnostics, Pipeline, _cosmosDBSqlContainerSqlResourcesRestClient.CreateListSqlContainerPartitionMergeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, mergeParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - /// /// Retrieves continuous backup information for a container resource. /// @@ -666,7 +574,7 @@ public virtual ArmOperation GetSqlContai /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -712,7 +620,7 @@ public virtual async Task> RetrieveConti /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -758,7 +666,7 @@ public virtual ArmOperation RetrieveContinuousBackupI /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -820,7 +728,7 @@ public virtual async Task> AddTagAsync(st /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -882,7 +790,7 @@ public virtual Response AddTag(string key, string /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -939,7 +847,7 @@ public virtual async Task> SetTagsAsync(I /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -996,7 +904,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1056,7 +964,7 @@ public virtual async Task> RemoveTagAsync /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerThroughputSettingResource.cs index 5ef1c88920b9..ba0fde00c4e7 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerThroughputSettingResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(Cance /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -230,7 +230,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -276,7 +276,7 @@ public virtual ArmOperation Creat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -318,7 +318,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -360,7 +360,7 @@ public virtual ArmOperation Migra /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -402,7 +402,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -431,190 +431,6 @@ public virtual ArmOperation Migra } } - /// - /// Retrieve throughput distribution for an Azure Cosmos DB SQL container - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/retrieveThroughputDistribution - /// - /// - /// Operation Id - /// SqlResources_SqlContainerRetrieveThroughputDistribution - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for retrieving throughput distribution for the current SQL container. - /// The cancellation token to use. - /// is null. - public virtual async Task> SqlContainerRetrieveThroughputDistributionAsync(WaitUntil waitUntil, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var scope = _cosmosDBSqlContainerThroughputSettingSqlResourcesClientDiagnostics.CreateScope("CosmosDBSqlContainerThroughputSettingResource.SqlContainerRetrieveThroughputDistribution"); - scope.Start(); - try - { - var response = await _cosmosDBSqlContainerThroughputSettingSqlResourcesRestClient.SqlContainerRetrieveThroughputDistributionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _cosmosDBSqlContainerThroughputSettingSqlResourcesClientDiagnostics, Pipeline, _cosmosDBSqlContainerThroughputSettingSqlResourcesRestClient.CreateSqlContainerRetrieveThroughputDistributionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieve throughput distribution for an Azure Cosmos DB SQL container - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/retrieveThroughputDistribution - /// - /// - /// Operation Id - /// SqlResources_SqlContainerRetrieveThroughputDistribution - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for retrieving throughput distribution for the current SQL container. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation SqlContainerRetrieveThroughputDistribution(WaitUntil waitUntil, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var scope = _cosmosDBSqlContainerThroughputSettingSqlResourcesClientDiagnostics.CreateScope("CosmosDBSqlContainerThroughputSettingResource.SqlContainerRetrieveThroughputDistribution"); - scope.Start(); - try - { - var response = _cosmosDBSqlContainerThroughputSettingSqlResourcesRestClient.SqlContainerRetrieveThroughputDistribution(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters, cancellationToken); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _cosmosDBSqlContainerThroughputSettingSqlResourcesClientDiagnostics, Pipeline, _cosmosDBSqlContainerThroughputSettingSqlResourcesRestClient.CreateSqlContainerRetrieveThroughputDistributionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Redistribute throughput for an Azure Cosmos DB SQL container - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/redistributeThroughput - /// - /// - /// Operation Id - /// SqlResources_SqlContainerRedistributeThroughput - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for redistributing throughput for the current SQL container. - /// The cancellation token to use. - /// is null. - public virtual async Task> SqlContainerRedistributeThroughputAsync(WaitUntil waitUntil, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - - using var scope = _cosmosDBSqlContainerThroughputSettingSqlResourcesClientDiagnostics.CreateScope("CosmosDBSqlContainerThroughputSettingResource.SqlContainerRedistributeThroughput"); - scope.Start(); - try - { - var response = await _cosmosDBSqlContainerThroughputSettingSqlResourcesRestClient.SqlContainerRedistributeThroughputAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _cosmosDBSqlContainerThroughputSettingSqlResourcesClientDiagnostics, Pipeline, _cosmosDBSqlContainerThroughputSettingSqlResourcesRestClient.CreateSqlContainerRedistributeThroughputRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Redistribute throughput for an Azure Cosmos DB SQL container - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/redistributeThroughput - /// - /// - /// Operation Id - /// SqlResources_SqlContainerRedistributeThroughput - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for redistributing throughput for the current SQL container. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation SqlContainerRedistributeThroughput(WaitUntil waitUntil, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - - using var scope = _cosmosDBSqlContainerThroughputSettingSqlResourcesClientDiagnostics.CreateScope("CosmosDBSqlContainerThroughputSettingResource.SqlContainerRedistributeThroughput"); - scope.Start(); - try - { - var response = _cosmosDBSqlContainerThroughputSettingSqlResourcesRestClient.SqlContainerRedistributeThroughput(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters, cancellationToken); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _cosmosDBSqlContainerThroughputSettingSqlResourcesClientDiagnostics, Pipeline, _cosmosDBSqlContainerThroughputSettingSqlResourcesRestClient.CreateSqlContainerRedistributeThroughputRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - /// /// Add a tag to the current resource. /// @@ -628,7 +444,7 @@ public virtual ArmOperation SqlContainerR /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -690,7 +506,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -752,7 +568,7 @@ public virtual Response AddTag(st /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -809,7 +625,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -866,7 +682,7 @@ public virtual Response SetTags(I /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -926,7 +742,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseCollection.cs index b7e8897cade6..e05b84037b77 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpd /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUnti /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string databaseName, Ca /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancellati /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken ca /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string databaseName, Cance /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string databaseName, CancellationToken canc /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfEx /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseData.Serialization.cs index db802a7149d8..eb81ad5793b0 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseData.Serialization.cs @@ -30,12 +30,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -120,7 +114,6 @@ internal static CosmosDBSqlDatabaseData DeserializeCosmosDBSqlDatabaseData(JsonE { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -133,16 +126,6 @@ internal static CosmosDBSqlDatabaseData DeserializeCosmosDBSqlDatabaseData(JsonE Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -231,7 +214,6 @@ internal static CosmosDBSqlDatabaseData DeserializeCosmosDBSqlDatabaseData(JsonE location, resource, options0, - identity, serializedAdditionalRawData); } @@ -318,21 +300,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseData.cs index b4475cc9243d..ba0ffb8b0c4c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseData.cs @@ -66,13 +66,11 @@ public CosmosDBSqlDatabaseData(AzureLocation location) : base(location) /// The location. /// /// - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CosmosDBSqlDatabaseData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCosmosDBSqlDatabaseResourceInfo resource, CosmosDBSqlDatabasePropertiesConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBSqlDatabaseData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCosmosDBSqlDatabaseResourceInfo resource, CosmosDBSqlDatabasePropertiesConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -87,8 +85,5 @@ internal CosmosDBSqlDatabaseData() /// Gets or sets the options. [WirePath("properties.options")] public CosmosDBSqlDatabasePropertiesConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseResource.cs index ca801f3677f3..5eedd9524f9e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseResource.cs @@ -97,142 +97,142 @@ public virtual CosmosDBSqlDatabaseThroughputSettingResource GetCosmosDBSqlDataba return new CosmosDBSqlDatabaseThroughputSettingResource(Client, Id.AppendChildResource("throughputSettings", "default")); } - /// Gets a collection of CosmosDBSqlClientEncryptionKeyResources in the CosmosDBSqlDatabase. - /// An object representing collection of CosmosDBSqlClientEncryptionKeyResources and their operations over a CosmosDBSqlClientEncryptionKeyResource. - public virtual CosmosDBSqlClientEncryptionKeyCollection GetCosmosDBSqlClientEncryptionKeys() + /// Gets a collection of CosmosDBSqlContainerResources in the CosmosDBSqlDatabase. + /// An object representing collection of CosmosDBSqlContainerResources and their operations over a CosmosDBSqlContainerResource. + public virtual CosmosDBSqlContainerCollection GetCosmosDBSqlContainers() { - return GetCachedClient(client => new CosmosDBSqlClientEncryptionKeyCollection(client, Id)); + return GetCachedClient(client => new CosmosDBSqlContainerCollection(client, Id)); } /// - /// Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. + /// Gets the SQL container under an existing Azure Cosmos DB database account. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName} /// /// /// Operation Id - /// SqlResources_GetClientEncryptionKey + /// SqlResources_GetSqlContainer /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource - /// + /// /// /// /// - /// Cosmos DB ClientEncryptionKey name. + /// Cosmos DB container name. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetCosmosDBSqlClientEncryptionKeyAsync(string clientEncryptionKeyName, CancellationToken cancellationToken = default) + public virtual async Task> GetCosmosDBSqlContainerAsync(string containerName, CancellationToken cancellationToken = default) { - return await GetCosmosDBSqlClientEncryptionKeys().GetAsync(clientEncryptionKeyName, cancellationToken).ConfigureAwait(false); + return await GetCosmosDBSqlContainers().GetAsync(containerName, cancellationToken).ConfigureAwait(false); } /// - /// Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. + /// Gets the SQL container under an existing Azure Cosmos DB database account. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName} /// /// /// Operation Id - /// SqlResources_GetClientEncryptionKey + /// SqlResources_GetSqlContainer /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource - /// + /// /// /// /// - /// Cosmos DB ClientEncryptionKey name. + /// Cosmos DB container name. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetCosmosDBSqlClientEncryptionKey(string clientEncryptionKeyName, CancellationToken cancellationToken = default) + public virtual Response GetCosmosDBSqlContainer(string containerName, CancellationToken cancellationToken = default) { - return GetCosmosDBSqlClientEncryptionKeys().Get(clientEncryptionKeyName, cancellationToken); + return GetCosmosDBSqlContainers().Get(containerName, cancellationToken); } - /// Gets a collection of CosmosDBSqlContainerResources in the CosmosDBSqlDatabase. - /// An object representing collection of CosmosDBSqlContainerResources and their operations over a CosmosDBSqlContainerResource. - public virtual CosmosDBSqlContainerCollection GetCosmosDBSqlContainers() + /// Gets a collection of CosmosDBSqlClientEncryptionKeyResources in the CosmosDBSqlDatabase. + /// An object representing collection of CosmosDBSqlClientEncryptionKeyResources and their operations over a CosmosDBSqlClientEncryptionKeyResource. + public virtual CosmosDBSqlClientEncryptionKeyCollection GetCosmosDBSqlClientEncryptionKeys() { - return GetCachedClient(client => new CosmosDBSqlContainerCollection(client, Id)); + return GetCachedClient(client => new CosmosDBSqlClientEncryptionKeyCollection(client, Id)); } /// - /// Gets the SQL container under an existing Azure Cosmos DB database account. + /// Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName} /// /// /// Operation Id - /// SqlResources_GetSqlContainer + /// SqlResources_GetClientEncryptionKey /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource - /// + /// /// /// /// - /// Cosmos DB container name. + /// Cosmos DB ClientEncryptionKey name. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetCosmosDBSqlContainerAsync(string containerName, CancellationToken cancellationToken = default) + public virtual async Task> GetCosmosDBSqlClientEncryptionKeyAsync(string clientEncryptionKeyName, CancellationToken cancellationToken = default) { - return await GetCosmosDBSqlContainers().GetAsync(containerName, cancellationToken).ConfigureAwait(false); + return await GetCosmosDBSqlClientEncryptionKeys().GetAsync(clientEncryptionKeyName, cancellationToken).ConfigureAwait(false); } /// - /// Gets the SQL container under an existing Azure Cosmos DB database account. + /// Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName} /// /// /// Operation Id - /// SqlResources_GetSqlContainer + /// SqlResources_GetClientEncryptionKey /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource - /// + /// /// /// /// - /// Cosmos DB container name. + /// Cosmos DB ClientEncryptionKey name. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetCosmosDBSqlContainer(string containerName, CancellationToken cancellationToken = default) + public virtual Response GetCosmosDBSqlClientEncryptionKey(string clientEncryptionKeyName, CancellationToken cancellationToken = default) { - return GetCosmosDBSqlContainers().Get(containerName, cancellationToken); + return GetCosmosDBSqlClientEncryptionKeys().Get(clientEncryptionKeyName, cancellationToken); } /// @@ -248,7 +248,7 @@ public virtual Response GetCosmosDBSqlContainer(st /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -288,7 +288,7 @@ public virtual async Task> GetAsync(Cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -328,7 +328,7 @@ public virtual Response Get(CancellationToken cance /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -370,7 +370,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -412,7 +412,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -458,7 +458,7 @@ public virtual async Task> UpdateAsync /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -491,98 +491,6 @@ public virtual ArmOperation Update(WaitUntil waitUn } } - /// - /// Merges the partitions of a SQL database - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/partitionMerge - /// - /// - /// Operation Id - /// SqlResources_SqlDatabasePartitionMerge - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters for the merge operation. - /// The cancellation token to use. - /// is null. - public virtual async Task> SqlDatabasePartitionMergeAsync(WaitUntil waitUntil, MergeParameters mergeParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - - using var scope = _cosmosDBSqlDatabaseSqlResourcesClientDiagnostics.CreateScope("CosmosDBSqlDatabaseResource.SqlDatabasePartitionMerge"); - scope.Start(); - try - { - var response = await _cosmosDBSqlDatabaseSqlResourcesRestClient.SqlDatabasePartitionMergeAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, mergeParameters, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new PhysicalPartitionStorageInfoCollectionOperationSource(), _cosmosDBSqlDatabaseSqlResourcesClientDiagnostics, Pipeline, _cosmosDBSqlDatabaseSqlResourcesRestClient.CreateSqlDatabasePartitionMergeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, mergeParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Merges the partitions of a SQL database - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/partitionMerge - /// - /// - /// Operation Id - /// SqlResources_SqlDatabasePartitionMerge - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters for the merge operation. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation SqlDatabasePartitionMerge(WaitUntil waitUntil, MergeParameters mergeParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - - using var scope = _cosmosDBSqlDatabaseSqlResourcesClientDiagnostics.CreateScope("CosmosDBSqlDatabaseResource.SqlDatabasePartitionMerge"); - scope.Start(); - try - { - var response = _cosmosDBSqlDatabaseSqlResourcesRestClient.SqlDatabasePartitionMerge(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, mergeParameters, cancellationToken); - var operation = new CosmosDBArmOperation(new PhysicalPartitionStorageInfoCollectionOperationSource(), _cosmosDBSqlDatabaseSqlResourcesClientDiagnostics, Pipeline, _cosmosDBSqlDatabaseSqlResourcesRestClient.CreateSqlDatabasePartitionMergeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, mergeParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - /// /// Add a tag to the current resource. /// @@ -596,7 +504,7 @@ public virtual ArmOperation SqlDatabaseP /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -658,7 +566,7 @@ public virtual async Task> AddTagAsync(str /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -720,7 +628,7 @@ public virtual Response AddTag(string key, string v /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -777,7 +685,7 @@ public virtual async Task> SetTagsAsync(ID /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -834,7 +742,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -894,7 +802,7 @@ public virtual async Task> RemoveTagAsync( /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseThroughputSettingResource.cs index ae5409899328..d3df1ae6d7fb 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseThroughputSettingResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(Cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -229,7 +229,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation Create /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -317,7 +317,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation Migrat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -401,7 +401,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -430,190 +430,6 @@ public virtual ArmOperation Migrat } } - /// - /// Retrieve throughput distribution for an Azure Cosmos DB SQL database - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution - /// - /// - /// Operation Id - /// SqlResources_SqlDatabaseRetrieveThroughputDistribution - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for retrieving throughput distribution for the current SQL database. - /// The cancellation token to use. - /// is null. - public virtual async Task> SqlDatabaseRetrieveThroughputDistributionAsync(WaitUntil waitUntil, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var scope = _cosmosDBSqlDatabaseThroughputSettingSqlResourcesClientDiagnostics.CreateScope("CosmosDBSqlDatabaseThroughputSettingResource.SqlDatabaseRetrieveThroughputDistribution"); - scope.Start(); - try - { - var response = await _cosmosDBSqlDatabaseThroughputSettingSqlResourcesRestClient.SqlDatabaseRetrieveThroughputDistributionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _cosmosDBSqlDatabaseThroughputSettingSqlResourcesClientDiagnostics, Pipeline, _cosmosDBSqlDatabaseThroughputSettingSqlResourcesRestClient.CreateSqlDatabaseRetrieveThroughputDistributionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieve throughput distribution for an Azure Cosmos DB SQL database - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution - /// - /// - /// Operation Id - /// SqlResources_SqlDatabaseRetrieveThroughputDistribution - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for retrieving throughput distribution for the current SQL database. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation SqlDatabaseRetrieveThroughputDistribution(WaitUntil waitUntil, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var scope = _cosmosDBSqlDatabaseThroughputSettingSqlResourcesClientDiagnostics.CreateScope("CosmosDBSqlDatabaseThroughputSettingResource.SqlDatabaseRetrieveThroughputDistribution"); - scope.Start(); - try - { - var response = _cosmosDBSqlDatabaseThroughputSettingSqlResourcesRestClient.SqlDatabaseRetrieveThroughputDistribution(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters, cancellationToken); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _cosmosDBSqlDatabaseThroughputSettingSqlResourcesClientDiagnostics, Pipeline, _cosmosDBSqlDatabaseThroughputSettingSqlResourcesRestClient.CreateSqlDatabaseRetrieveThroughputDistributionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Redistribute throughput for an Azure Cosmos DB SQL database - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/redistributeThroughput - /// - /// - /// Operation Id - /// SqlResources_SqlDatabaseRedistributeThroughput - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for redistributing throughput for the current SQL database. - /// The cancellation token to use. - /// is null. - public virtual async Task> SqlDatabaseRedistributeThroughputAsync(WaitUntil waitUntil, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - - using var scope = _cosmosDBSqlDatabaseThroughputSettingSqlResourcesClientDiagnostics.CreateScope("CosmosDBSqlDatabaseThroughputSettingResource.SqlDatabaseRedistributeThroughput"); - scope.Start(); - try - { - var response = await _cosmosDBSqlDatabaseThroughputSettingSqlResourcesRestClient.SqlDatabaseRedistributeThroughputAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _cosmosDBSqlDatabaseThroughputSettingSqlResourcesClientDiagnostics, Pipeline, _cosmosDBSqlDatabaseThroughputSettingSqlResourcesRestClient.CreateSqlDatabaseRedistributeThroughputRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Redistribute throughput for an Azure Cosmos DB SQL database - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/redistributeThroughput - /// - /// - /// Operation Id - /// SqlResources_SqlDatabaseRedistributeThroughput - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for redistributing throughput for the current SQL database. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation SqlDatabaseRedistributeThroughput(WaitUntil waitUntil, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - - using var scope = _cosmosDBSqlDatabaseThroughputSettingSqlResourcesClientDiagnostics.CreateScope("CosmosDBSqlDatabaseThroughputSettingResource.SqlDatabaseRedistributeThroughput"); - scope.Start(); - try - { - var response = _cosmosDBSqlDatabaseThroughputSettingSqlResourcesRestClient.SqlDatabaseRedistributeThroughput(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters, cancellationToken); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _cosmosDBSqlDatabaseThroughputSettingSqlResourcesClientDiagnostics, Pipeline, _cosmosDBSqlDatabaseThroughputSettingSqlResourcesRestClient.CreateSqlDatabaseRedistributeThroughputRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - /// /// Add a tag to the current resource. /// @@ -627,7 +443,7 @@ public virtual ArmOperation SqlDatabaseRe /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -689,7 +505,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -751,7 +567,7 @@ public virtual Response AddTag(str /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -808,7 +624,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -865,7 +681,7 @@ public virtual Response SetTags(ID /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -925,7 +741,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleAssignmentCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleAssignmentCollection.cs index ad0e86af8f30..f7d7d60cbbda 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleAssignmentCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleAssignmentCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> Creat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(Wa /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string roleAssign /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Canc /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationTo /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string roleAssignmentId, C /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string roleAssignmentId, CancellationToken /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleAssignmentResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleAssignmentResource.cs index d16819b9ec2b..5572512c83fc 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleAssignmentResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleAssignmentResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> Updat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleDefinitionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleDefinitionCollection.cs index 301b1b97e0ef..c15320192414 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleDefinitionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleDefinitionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> Creat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(Wa /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string roleDefini /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Canc /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationTo /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string roleDefinitionId, C /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string roleDefinitionId, CancellationToken /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleDefinitionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleDefinitionResource.cs index f51ce39a3bc4..8edbe07919a8 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleDefinitionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleDefinitionResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> Updat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureCollection.cs index 7b053b8c7003..34eb0e23c50b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> Crea /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(W /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string storedPro /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Can /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationT /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string storedProcedureName /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string storedProcedureName, CancellationTok /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureData.Serialization.cs index d7b1c42b674b..1ba39c7b87b9 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureData.Serialization.cs @@ -30,12 +30,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -115,7 +109,6 @@ internal static CosmosDBSqlStoredProcedureData DeserializeCosmosDBSqlStoredProce { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -127,16 +120,6 @@ internal static CosmosDBSqlStoredProcedureData DeserializeCosmosDBSqlStoredProce Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -215,7 +198,6 @@ internal static CosmosDBSqlStoredProcedureData DeserializeCosmosDBSqlStoredProce tags ?? new ChangeTrackingDictionary(), location, resource, - identity, serializedAdditionalRawData); } @@ -302,21 +284,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureData.cs index c9914ab0c153..d62143b2a1ea 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureData.cs @@ -65,12 +65,10 @@ public CosmosDBSqlStoredProcedureData(AzureLocation location) : base(location) /// The tags. /// The location. /// - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CosmosDBSqlStoredProcedureData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCosmosDBSqlStoredProcedureResourceInfo resource, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBSqlStoredProcedureData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCosmosDBSqlStoredProcedureResourceInfo resource, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -82,8 +80,5 @@ internal CosmosDBSqlStoredProcedureData() /// Gets or sets the resource. [WirePath("properties.resource")] public ExtendedCosmosDBSqlStoredProcedureResourceInfo Resource { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureResource.cs index 04ecb94cfc7a..f9e4e998010d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureResource.cs @@ -105,7 +105,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -145,7 +145,7 @@ public virtual async Task> GetAsync /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -185,7 +185,7 @@ public virtual Response Get(CancellationToke /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -269,7 +269,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -315,7 +315,7 @@ public virtual async Task> Upda /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -361,7 +361,7 @@ public virtual ArmOperation Update(WaitUntil /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -423,7 +423,7 @@ public virtual async Task> AddTagAs /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -485,7 +485,7 @@ public virtual Response AddTag(string key, s /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -542,7 +542,7 @@ public virtual async Task> SetTagsA /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -599,7 +599,7 @@ public virtual Response SetTags(IDictionary< /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -659,7 +659,7 @@ public virtual async Task> RemoveTa /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerCollection.cs index 8d90ed9e961f..98d81093bbeb 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpda /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string triggerName, Canc /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancellatio /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken can /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string triggerName, Cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string triggerName, CancellationToken cance /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExi /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerData.Serialization.cs index f7ac7a840113..0d46534a75bb 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerData.Serialization.cs @@ -30,12 +30,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -115,7 +109,6 @@ internal static CosmosDBSqlTriggerData DeserializeCosmosDBSqlTriggerData(JsonEle { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -127,16 +120,6 @@ internal static CosmosDBSqlTriggerData DeserializeCosmosDBSqlTriggerData(JsonEle Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -215,7 +198,6 @@ internal static CosmosDBSqlTriggerData DeserializeCosmosDBSqlTriggerData(JsonEle tags ?? new ChangeTrackingDictionary(), location, resource, - identity, serializedAdditionalRawData); } @@ -302,21 +284,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerData.cs index 8b79d3227fcd..79829f99bd3d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerData.cs @@ -65,12 +65,10 @@ public CosmosDBSqlTriggerData(AzureLocation location) : base(location) /// The tags. /// The location. /// - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CosmosDBSqlTriggerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCosmosDBSqlTriggerResourceInfo resource, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBSqlTriggerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCosmosDBSqlTriggerResourceInfo resource, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -82,8 +80,5 @@ internal CosmosDBSqlTriggerData() /// Gets or sets the resource. [WirePath("properties.resource")] public ExtendedCosmosDBSqlTriggerResourceInfo Resource { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerResource.cs index 68be44dae995..3a1e0890cf03 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerResource.cs @@ -105,7 +105,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -145,7 +145,7 @@ public virtual async Task> GetAsync(Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -185,7 +185,7 @@ public virtual Response Get(CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -269,7 +269,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -315,7 +315,7 @@ public virtual async Task> UpdateAsync( /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -361,7 +361,7 @@ public virtual ArmOperation Update(WaitUntil waitUnt /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -423,7 +423,7 @@ public virtual async Task> AddTagAsync(stri /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -485,7 +485,7 @@ public virtual Response AddTag(string key, string va /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -542,7 +542,7 @@ public virtual async Task> SetTagsAsync(IDi /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -599,7 +599,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -659,7 +659,7 @@ public virtual async Task> RemoveTagAsync(s /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionCollection.cs index 4b5f305b4ab9..28ab9e03993a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpda /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string userD /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(Cancellat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string userDefinedFunction /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string userDefinedFunctionName, Cancellatio /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionData.Serialization.cs index 089a5bc8ef35..6901bf22a8be 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionData.Serialization.cs @@ -30,12 +30,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -115,7 +109,6 @@ internal static CosmosDBSqlUserDefinedFunctionData DeserializeCosmosDBSqlUserDef { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -127,16 +120,6 @@ internal static CosmosDBSqlUserDefinedFunctionData DeserializeCosmosDBSqlUserDef Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -215,7 +198,6 @@ internal static CosmosDBSqlUserDefinedFunctionData DeserializeCosmosDBSqlUserDef tags ?? new ChangeTrackingDictionary(), location, resource, - identity, serializedAdditionalRawData); } @@ -302,21 +284,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionData.cs index 91c5bba499a2..4f863d7e6e67 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionData.cs @@ -65,12 +65,10 @@ public CosmosDBSqlUserDefinedFunctionData(AzureLocation location) : base(locatio /// The tags. /// The location. /// - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CosmosDBSqlUserDefinedFunctionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCosmosDBSqlUserDefinedFunctionResourceInfo resource, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBSqlUserDefinedFunctionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCosmosDBSqlUserDefinedFunctionResourceInfo resource, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -82,8 +80,5 @@ internal CosmosDBSqlUserDefinedFunctionData() /// Gets or sets the resource. [WirePath("properties.resource")] public ExtendedCosmosDBSqlUserDefinedFunctionResourceInfo Resource { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionResource.cs index 41780b76d6c1..70e3d0952734 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionResource.cs @@ -105,7 +105,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -145,7 +145,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -185,7 +185,7 @@ public virtual Response Get(Cancellation /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -269,7 +269,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -315,7 +315,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -361,7 +361,7 @@ public virtual ArmOperation Update(WaitU /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -423,7 +423,7 @@ public virtual async Task> AddT /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -485,7 +485,7 @@ public virtual Response AddTag(string ke /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -542,7 +542,7 @@ public virtual async Task> SetT /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -599,7 +599,7 @@ public virtual Response SetTags(IDiction /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -659,7 +659,7 @@ public virtual async Task> Remo /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableCollection.cs index b27f7a0c37c9..2e6505af2063 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateAsy /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wait /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string table /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string tableName, Cancellatio /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToke /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken cancella /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string tableName, Cancella /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string tableName, CancellationToken cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExistsAs /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableData.Serialization.cs index b4b14ebd0d88..9322d066e670 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableData.Serialization.cs @@ -30,12 +30,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -120,7 +114,6 @@ internal static CosmosDBTableData DeserializeCosmosDBTableData(JsonElement eleme { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -133,16 +126,6 @@ internal static CosmosDBTableData DeserializeCosmosDBTableData(JsonElement eleme Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -231,7 +214,6 @@ internal static CosmosDBTableData DeserializeCosmosDBTableData(JsonElement eleme location, resource, options0, - identity, serializedAdditionalRawData); } @@ -318,21 +300,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableData.cs index baf0259d5f46..4f7efaaf2389 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableData.cs @@ -66,13 +66,11 @@ public CosmosDBTableData(AzureLocation location) : base(location) /// The location. /// /// - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CosmosDBTableData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBTablePropertiesResource resource, CosmosDBTablePropertiesOptions options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBTableData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBTablePropertiesResource resource, CosmosDBTablePropertiesOptions options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -87,8 +85,5 @@ internal CosmosDBTableData() /// Gets or sets the options. [WirePath("properties.options")] public CosmosDBTablePropertiesOptions Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableResource.cs index a3b288dcdb9c..b6c7e220bd0a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableResource.cs @@ -110,7 +110,7 @@ public virtual CosmosTableThroughputSettingResource GetCosmosTableThroughputSett /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -150,7 +150,7 @@ public virtual async Task> GetAsync(Cancellation /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -190,7 +190,7 @@ public virtual Response Get(CancellationToken cancellatio /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -232,7 +232,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -274,7 +274,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -320,7 +320,7 @@ public virtual async Task> UpdateAsync(WaitU /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -366,7 +366,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, C /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -412,7 +412,7 @@ public virtual async Task> RetrieveConti /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -458,7 +458,7 @@ public virtual ArmOperation RetrieveContinuousBackupI /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -520,7 +520,7 @@ public virtual async Task> AddTagAsync(string ke /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -582,7 +582,7 @@ public virtual Response AddTag(string key, string value, /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -639,7 +639,7 @@ public virtual async Task> SetTagsAsync(IDiction /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -696,7 +696,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -756,7 +756,7 @@ public virtual async Task> RemoveTagAsync(string /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountCollection.cs deleted file mode 100644 index ed059b52bf66..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountCollection.cs +++ /dev/null @@ -1,498 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetCosmosDBThroughputPoolAccounts method from an instance of . - /// - public partial class CosmosDBThroughputPoolAccountCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics; - private readonly ThroughputPoolAccountRestOperations _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient; - private readonly ClientDiagnostics _cosmosDBThroughputPoolAccountThroughputPoolAccountsClientDiagnostics; - private readonly ThroughputPoolAccountsRestOperations _cosmosDBThroughputPoolAccountThroughputPoolAccountsRestClient; - - /// Initializes a new instance of the class for mocking. - protected CosmosDBThroughputPoolAccountCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal CosmosDBThroughputPoolAccountCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", CosmosDBThroughputPoolAccountResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(CosmosDBThroughputPoolAccountResource.ResourceType, out string cosmosDBThroughputPoolAccountThroughputPoolAccountApiVersion); - _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient = new ThroughputPoolAccountRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cosmosDBThroughputPoolAccountThroughputPoolAccountApiVersion); - _cosmosDBThroughputPoolAccountThroughputPoolAccountsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", CosmosDBThroughputPoolAccountResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(CosmosDBThroughputPoolAccountResource.ResourceType, out string cosmosDBThroughputPoolAccountThroughputPoolAccountsApiVersion); - _cosmosDBThroughputPoolAccountThroughputPoolAccountsRestClient = new ThroughputPoolAccountsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cosmosDBThroughputPoolAccountThroughputPoolAccountsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != CosmosDBThroughputPoolResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, CosmosDBThroughputPoolResource.ResourceType), nameof(id)); - } - - /// - /// Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Create - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Cosmos DB global database account in a Throughput Pool. - /// The parameters to provide for the current ThroughputPoolAccount. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string throughputPoolAccountName, CosmosDBThroughputPoolAccountData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, throughputPoolAccountName, data, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new CosmosDBThroughputPoolAccountOperationSource(Client), _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics, Pipeline, _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, throughputPoolAccountName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Create - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Cosmos DB global database account in a Throughput Pool. - /// The parameters to provide for the current ThroughputPoolAccount. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string throughputPoolAccountName, CosmosDBThroughputPoolAccountData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, throughputPoolAccountName, data, cancellationToken); - var operation = new CosmosDBArmOperation(new CosmosDBThroughputPoolAccountOperationSource(Client), _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics, Pipeline, _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, throughputPoolAccountName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB global database account in a Throughput Pool. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string throughputPoolAccountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountCollection.Get"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, throughputPoolAccountName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CosmosDBThroughputPoolAccountResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB global database account in a Throughput Pool. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string throughputPoolAccountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountCollection.Get"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, throughputPoolAccountName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CosmosDBThroughputPoolAccountResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists all the Azure Cosmos DB accounts available under the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts - /// - /// - /// Operation Id - /// ThroughputPoolAccounts_List - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cosmosDBThroughputPoolAccountThroughputPoolAccountsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _cosmosDBThroughputPoolAccountThroughputPoolAccountsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CosmosDBThroughputPoolAccountResource(Client, CosmosDBThroughputPoolAccountData.DeserializeCosmosDBThroughputPoolAccountData(e)), _cosmosDBThroughputPoolAccountThroughputPoolAccountsClientDiagnostics, Pipeline, "CosmosDBThroughputPoolAccountCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Lists all the Azure Cosmos DB accounts available under the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts - /// - /// - /// Operation Id - /// ThroughputPoolAccounts_List - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cosmosDBThroughputPoolAccountThroughputPoolAccountsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _cosmosDBThroughputPoolAccountThroughputPoolAccountsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CosmosDBThroughputPoolAccountResource(Client, CosmosDBThroughputPoolAccountData.DeserializeCosmosDBThroughputPoolAccountData(e)), _cosmosDBThroughputPoolAccountThroughputPoolAccountsClientDiagnostics, Pipeline, "CosmosDBThroughputPoolAccountCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB global database account in a Throughput Pool. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string throughputPoolAccountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountCollection.Exists"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, throughputPoolAccountName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB global database account in a Throughput Pool. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string throughputPoolAccountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountCollection.Exists"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, throughputPoolAccountName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB global database account in a Throughput Pool. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string throughputPoolAccountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, throughputPoolAccountName, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new CosmosDBThroughputPoolAccountResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB global database account in a Throughput Pool. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string throughputPoolAccountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountCollection.GetIfExists"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, throughputPoolAccountName, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new CosmosDBThroughputPoolAccountResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountData.Serialization.cs deleted file mode 100644 index 52478831ea40..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountData.Serialization.cs +++ /dev/null @@ -1,383 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class CosmosDBThroughputPoolAccountData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosDBThroughputPoolAccountData)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - if (Optional.IsDefined(AccountResourceIdentifier)) - { - writer.WritePropertyName("accountResourceIdentifier"u8); - writer.WriteStringValue(AccountResourceIdentifier); - } - if (Optional.IsDefined(AccountLocation)) - { - writer.WritePropertyName("accountLocation"u8); - writer.WriteStringValue(AccountLocation.Value); - } - if (options.Format != "W" && Optional.IsDefined(AccountInstanceId)) - { - writer.WritePropertyName("accountInstanceId"u8); - writer.WriteStringValue(AccountInstanceId); - } - writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - CosmosDBThroughputPoolAccountData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosDBThroughputPoolAccountData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCosmosDBThroughputPoolAccountData(document.RootElement, options); - } - - internal static CosmosDBThroughputPoolAccountData DeserializeCosmosDBThroughputPoolAccountData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - CosmosDBStatus? provisioningState = default; - ResourceIdentifier accountResourceIdentifier = default; - AzureLocation? accountLocation = default; - string accountInstanceId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("provisioningState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new CosmosDBStatus(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("accountResourceIdentifier"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - accountResourceIdentifier = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("accountLocation"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - accountLocation = new AzureLocation(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("accountInstanceId"u8)) - { - accountInstanceId = property0.Value.GetString(); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CosmosDBThroughputPoolAccountData( - id, - name, - type, - systemData, - provisioningState, - accountResourceIdentifier, - accountLocation, - accountInstanceId, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.Append(" properties:"); - builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" provisioningState: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ProvisioningState)) - { - builder.Append(" provisioningState: "); - builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AccountResourceIdentifier), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" accountResourceIdentifier: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(AccountResourceIdentifier)) - { - builder.Append(" accountResourceIdentifier: "); - builder.AppendLine($"'{AccountResourceIdentifier.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AccountLocation), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" accountLocation: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(AccountLocation)) - { - builder.Append(" accountLocation: "); - builder.AppendLine($"'{AccountLocation.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AccountInstanceId), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" accountInstanceId: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(AccountInstanceId)) - { - builder.Append(" accountInstanceId: "); - if (AccountInstanceId.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{AccountInstanceId}'''"); - } - else - { - builder.AppendLine($"'{AccountInstanceId}'"); - } - } - } - - builder.AppendLine(" }"); - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CosmosDBThroughputPoolAccountData)} does not support writing '{options.Format}' format."); - } - } - - CosmosDBThroughputPoolAccountData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCosmosDBThroughputPoolAccountData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CosmosDBThroughputPoolAccountData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountData.cs deleted file mode 100644 index 717c462d1b87..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountData.cs +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A class representing the CosmosDBThroughputPoolAccount data model. - /// An Azure Cosmos DB Throughputpool Account - /// - public partial class CosmosDBThroughputPoolAccountData : ResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public CosmosDBThroughputPoolAccountData() - { - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// A provisioning state of the ThroughputPool Account. - /// The resource identifier of global database account in the throughputPool. - /// The location of global database account in the throughputPool. - /// The instance id of global database account in the throughputPool. - /// Keeps track of any properties unknown to the library. - internal CosmosDBThroughputPoolAccountData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, CosmosDBStatus? provisioningState, ResourceIdentifier accountResourceIdentifier, AzureLocation? accountLocation, string accountInstanceId, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) - { - ProvisioningState = provisioningState; - AccountResourceIdentifier = accountResourceIdentifier; - AccountLocation = accountLocation; - AccountInstanceId = accountInstanceId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// A provisioning state of the ThroughputPool Account. - [WirePath("properties.provisioningState")] - public CosmosDBStatus? ProvisioningState { get; set; } - /// The resource identifier of global database account in the throughputPool. - [WirePath("properties.accountResourceIdentifier")] - public ResourceIdentifier AccountResourceIdentifier { get; set; } - /// The location of global database account in the throughputPool. - [WirePath("properties.accountLocation")] - public AzureLocation? AccountLocation { get; set; } - /// The instance id of global database account in the throughputPool. - [WirePath("properties.accountInstanceId")] - public string AccountInstanceId { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountResource.Serialization.cs deleted file mode 100644 index 3a9f4402b8f6..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class CosmosDBThroughputPoolAccountResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - CosmosDBThroughputPoolAccountData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - CosmosDBThroughputPoolAccountData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountResource.cs deleted file mode 100644 index 42a2f447cdea..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountResource.cs +++ /dev/null @@ -1,347 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A Class representing a CosmosDBThroughputPoolAccount along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetCosmosDBThroughputPoolAccountResource method. - /// Otherwise you can get one from its parent resource using the GetCosmosDBThroughputPoolAccount method. - /// - public partial class CosmosDBThroughputPoolAccountResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The throughputPoolName. - /// The throughputPoolAccountName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string throughputPoolName, string throughputPoolAccountName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics; - private readonly ThroughputPoolAccountRestOperations _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient; - private readonly CosmosDBThroughputPoolAccountData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.DocumentDB/throughputPools/throughputPoolAccounts"; - - /// Initializes a new instance of the class for mocking. - protected CosmosDBThroughputPoolAccountResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal CosmosDBThroughputPoolAccountResource(ArmClient client, CosmosDBThroughputPoolAccountData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal CosmosDBThroughputPoolAccountResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string cosmosDBThroughputPoolAccountThroughputPoolAccountApiVersion); - _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient = new ThroughputPoolAccountRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cosmosDBThroughputPoolAccountThroughputPoolAccountApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual CosmosDBThroughputPoolAccountData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountResource.Get"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CosmosDBThroughputPoolAccountResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountResource.Get"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CosmosDBThroughputPoolAccountResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes an existing Azure Cosmos DB database account from a throughput pool. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Delete - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountResource.Delete"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(_cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics, Pipeline, _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes an existing Azure Cosmos DB database account from a throughput pool. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Delete - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountResource.Delete"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new CosmosDBArmOperation(_cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics, Pipeline, _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Create - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for the current ThroughputPoolAccount. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, CosmosDBThroughputPoolAccountData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountResource.Update"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new CosmosDBThroughputPoolAccountOperationSource(Client), _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics, Pipeline, _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Create - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for the current ThroughputPoolAccount. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, CosmosDBThroughputPoolAccountData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountResource.Update"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); - var operation = new CosmosDBArmOperation(new CosmosDBThroughputPoolAccountOperationSource(Client), _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics, Pipeline, _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolCollection.cs deleted file mode 100644 index d40a06a0e8fb..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolCollection.cs +++ /dev/null @@ -1,499 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetCosmosDBThroughputPools method from an instance of . - /// - public partial class CosmosDBThroughputPoolCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _cosmosDBThroughputPoolThroughputPoolClientDiagnostics; - private readonly ThroughputPoolRestOperations _cosmosDBThroughputPoolThroughputPoolRestClient; - private readonly ClientDiagnostics _cosmosDBThroughputPoolThroughputPoolsClientDiagnostics; - private readonly ThroughputPoolsRestOperations _cosmosDBThroughputPoolThroughputPoolsRestClient; - - /// Initializes a new instance of the class for mocking. - protected CosmosDBThroughputPoolCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal CosmosDBThroughputPoolCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _cosmosDBThroughputPoolThroughputPoolClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", CosmosDBThroughputPoolResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(CosmosDBThroughputPoolResource.ResourceType, out string cosmosDBThroughputPoolThroughputPoolApiVersion); - _cosmosDBThroughputPoolThroughputPoolRestClient = new ThroughputPoolRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cosmosDBThroughputPoolThroughputPoolApiVersion); - _cosmosDBThroughputPoolThroughputPoolsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", CosmosDBThroughputPoolResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(CosmosDBThroughputPoolResource.ResourceType, out string cosmosDBThroughputPoolThroughputPoolsApiVersion); - _cosmosDBThroughputPoolThroughputPoolsRestClient = new ThroughputPoolsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cosmosDBThroughputPoolThroughputPoolsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceGroupResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); - } - - /// - /// Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Cosmos DB Throughput Pool name. - /// The parameters to provide for the current ThroughputPool. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string throughputPoolName, CosmosDBThroughputPoolData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolThroughputPoolRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, throughputPoolName, data, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new CosmosDBThroughputPoolOperationSource(Client), _cosmosDBThroughputPoolThroughputPoolClientDiagnostics, Pipeline, _cosmosDBThroughputPoolThroughputPoolRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, throughputPoolName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Cosmos DB Throughput Pool name. - /// The parameters to provide for the current ThroughputPool. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string throughputPoolName, CosmosDBThroughputPoolData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolThroughputPoolRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, throughputPoolName, data, cancellationToken); - var operation = new CosmosDBArmOperation(new CosmosDBThroughputPoolOperationSource(Client), _cosmosDBThroughputPoolThroughputPoolClientDiagnostics, Pipeline, _cosmosDBThroughputPoolThroughputPoolRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, throughputPoolName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolCollection.Get"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolThroughputPoolRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, throughputPoolName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CosmosDBThroughputPoolResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolCollection.Get"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolThroughputPoolRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, throughputPoolName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CosmosDBThroughputPoolResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// List all the ThroughputPools in a given resource group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools - /// - /// - /// Operation Id - /// ThroughputPools_ListByResourceGroup - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cosmosDBThroughputPoolThroughputPoolsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _cosmosDBThroughputPoolThroughputPoolsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CosmosDBThroughputPoolResource(Client, CosmosDBThroughputPoolData.DeserializeCosmosDBThroughputPoolData(e)), _cosmosDBThroughputPoolThroughputPoolsClientDiagnostics, Pipeline, "CosmosDBThroughputPoolCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// List all the ThroughputPools in a given resource group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools - /// - /// - /// Operation Id - /// ThroughputPools_ListByResourceGroup - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cosmosDBThroughputPoolThroughputPoolsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _cosmosDBThroughputPoolThroughputPoolsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CosmosDBThroughputPoolResource(Client, CosmosDBThroughputPoolData.DeserializeCosmosDBThroughputPoolData(e)), _cosmosDBThroughputPoolThroughputPoolsClientDiagnostics, Pipeline, "CosmosDBThroughputPoolCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolCollection.Exists"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolThroughputPoolRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, throughputPoolName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolCollection.Exists"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolThroughputPoolRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, throughputPoolName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolThroughputPoolRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, throughputPoolName, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new CosmosDBThroughputPoolResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolCollection.GetIfExists"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolThroughputPoolRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, throughputPoolName, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new CosmosDBThroughputPoolResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolData.Serialization.cs deleted file mode 100644 index 25017af2cfb9..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolData.Serialization.cs +++ /dev/null @@ -1,403 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class CosmosDBThroughputPoolData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosDBThroughputPoolData)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - if (Optional.IsDefined(MaxThroughput)) - { - writer.WritePropertyName("maxThroughput"u8); - writer.WriteNumberValue(MaxThroughput.Value); - } - writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - CosmosDBThroughputPoolData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosDBThroughputPoolData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCosmosDBThroughputPoolData(document.RootElement, options); - } - - internal static CosmosDBThroughputPoolData DeserializeCosmosDBThroughputPoolData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IDictionary tags = default; - AzureLocation location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - CosmosDBStatus? provisioningState = default; - int? maxThroughput = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("location"u8)) - { - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("provisioningState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new CosmosDBStatus(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("maxThroughput"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - maxThroughput = property0.Value.GetInt32(); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CosmosDBThroughputPoolData( - id, - name, - type, - systemData, - tags ?? new ChangeTrackingDictionary(), - location, - provisioningState, - maxThroughput, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" location: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" location: "); - builder.AppendLine($"'{Location.ToString()}'"); - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" tags: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Tags)) - { - if (Tags.Any()) - { - builder.Append(" tags: "); - builder.AppendLine("{"); - foreach (var item in Tags) - { - builder.Append($" '{item.Key}': "); - if (item.Value == null) - { - builder.Append("null"); - continue; - } - if (item.Value.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{item.Value}'''"); - } - else - { - builder.AppendLine($"'{item.Value}'"); - } - } - builder.AppendLine(" }"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.Append(" properties:"); - builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" provisioningState: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ProvisioningState)) - { - builder.Append(" provisioningState: "); - builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MaxThroughput), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" maxThroughput: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(MaxThroughput)) - { - builder.Append(" maxThroughput: "); - builder.AppendLine($"{MaxThroughput.Value}"); - } - } - - builder.AppendLine(" }"); - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CosmosDBThroughputPoolData)} does not support writing '{options.Format}' format."); - } - } - - CosmosDBThroughputPoolData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCosmosDBThroughputPoolData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CosmosDBThroughputPoolData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolData.cs deleted file mode 100644 index c288a9624cc5..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolData.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A class representing the CosmosDBThroughputPool data model. - /// An Azure Cosmos DB Throughputpool. - /// - public partial class CosmosDBThroughputPoolData : TrackedResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The location. - public CosmosDBThroughputPoolData(AzureLocation location) : base(location) - { - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// A provisioning state of the ThroughputPool. - /// Value for throughput to be shared among CosmosDB resources in the pool. - /// Keeps track of any properties unknown to the library. - internal CosmosDBThroughputPoolData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBStatus? provisioningState, int? maxThroughput, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) - { - ProvisioningState = provisioningState; - MaxThroughput = maxThroughput; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal CosmosDBThroughputPoolData() - { - } - - /// A provisioning state of the ThroughputPool. - [WirePath("properties.provisioningState")] - public CosmosDBStatus? ProvisioningState { get; set; } - /// Value for throughput to be shared among CosmosDB resources in the pool. - [WirePath("properties.maxThroughput")] - public int? MaxThroughput { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolResource.Serialization.cs deleted file mode 100644 index e537ce88ec65..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class CosmosDBThroughputPoolResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - CosmosDBThroughputPoolData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - CosmosDBThroughputPoolData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolResource.cs deleted file mode 100644 index 00e114667922..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolResource.cs +++ /dev/null @@ -1,417 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A Class representing a CosmosDBThroughputPool along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetCosmosDBThroughputPoolResource method. - /// Otherwise you can get one from its parent resource using the GetCosmosDBThroughputPool method. - /// - public partial class CosmosDBThroughputPoolResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The throughputPoolName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string throughputPoolName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _cosmosDBThroughputPoolThroughputPoolClientDiagnostics; - private readonly ThroughputPoolRestOperations _cosmosDBThroughputPoolThroughputPoolRestClient; - private readonly CosmosDBThroughputPoolData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.DocumentDB/throughputPools"; - - /// Initializes a new instance of the class for mocking. - protected CosmosDBThroughputPoolResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal CosmosDBThroughputPoolResource(ArmClient client, CosmosDBThroughputPoolData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal CosmosDBThroughputPoolResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _cosmosDBThroughputPoolThroughputPoolClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string cosmosDBThroughputPoolThroughputPoolApiVersion); - _cosmosDBThroughputPoolThroughputPoolRestClient = new ThroughputPoolRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cosmosDBThroughputPoolThroughputPoolApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual CosmosDBThroughputPoolData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// Gets a collection of CosmosDBThroughputPoolAccountResources in the CosmosDBThroughputPool. - /// An object representing collection of CosmosDBThroughputPoolAccountResources and their operations over a CosmosDBThroughputPoolAccountResource. - public virtual CosmosDBThroughputPoolAccountCollection GetCosmosDBThroughputPoolAccounts() - { - return GetCachedClient(client => new CosmosDBThroughputPoolAccountCollection(client, Id)); - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB global database account in a Throughput Pool. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetCosmosDBThroughputPoolAccountAsync(string throughputPoolAccountName, CancellationToken cancellationToken = default) - { - return await GetCosmosDBThroughputPoolAccounts().GetAsync(throughputPoolAccountName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB global database account in a Throughput Pool. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetCosmosDBThroughputPoolAccount(string throughputPoolAccountName, CancellationToken cancellationToken = default) - { - return GetCosmosDBThroughputPoolAccounts().Get(throughputPoolAccountName, cancellationToken); - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolResource.Get"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolThroughputPoolRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CosmosDBThroughputPoolResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolResource.Get"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolThroughputPoolRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CosmosDBThroughputPoolResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes an existing Azure Cosmos DB Throughput Pool. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Delete - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolResource.Delete"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolThroughputPoolRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(_cosmosDBThroughputPoolThroughputPoolClientDiagnostics, Pipeline, _cosmosDBThroughputPoolThroughputPoolRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes an existing Azure Cosmos DB Throughput Pool. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Delete - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolResource.Delete"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolThroughputPoolRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new CosmosDBArmOperation(_cosmosDBThroughputPoolThroughputPoolClientDiagnostics, Pipeline, _cosmosDBThroughputPoolThroughputPoolRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Updates the properties of an existing Azure Cosmos DB Throughput Pool. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Update - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for the current Throughput Pool. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, CosmosDBThroughputPoolPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolResource.Update"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolThroughputPoolRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new CosmosDBThroughputPoolOperationSource(Client), _cosmosDBThroughputPoolThroughputPoolClientDiagnostics, Pipeline, _cosmosDBThroughputPoolThroughputPoolRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Updates the properties of an existing Azure Cosmos DB Throughput Pool. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Update - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for the current Throughput Pool. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, CosmosDBThroughputPoolPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolResource.Update"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolThroughputPoolRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); - var operation = new CosmosDBArmOperation(new CosmosDBThroughputPoolOperationSource(Client), _cosmosDBThroughputPoolThroughputPoolClientDiagnostics, Pipeline, _cosmosDBThroughputPoolThroughputPoolRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosTableThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosTableThroughputSettingResource.cs index d478055e8356..f9e874640152 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosTableThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosTableThroughputSettingResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationTo /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -229,7 +229,7 @@ public virtual async Task> Cr /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation CreateOrUpdate /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -317,7 +317,7 @@ public virtual async Task> Mi /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation MigrateTableTo /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -401,7 +401,7 @@ public virtual async Task> Mi /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual ArmOperation MigrateTableTo /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -505,7 +505,7 @@ public virtual async Task> AddTag /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -567,7 +567,7 @@ public virtual Response AddTag(string key, /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -624,7 +624,7 @@ public virtual async Task> SetTag /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -681,7 +681,7 @@ public virtual Response SetTags(IDictionar /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -741,7 +741,7 @@ public virtual async Task> Remove /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultCollection.cs deleted file mode 100644 index 0d1fc81aff04..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultCollection.cs +++ /dev/null @@ -1,498 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetDataTransferJobGetResults method from an instance of . - /// - public partial class DataTransferJobGetResultCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _dataTransferJobGetResultDataTransferJobsClientDiagnostics; - private readonly DataTransferJobsRestOperations _dataTransferJobGetResultDataTransferJobsRestClient; - - /// Initializes a new instance of the class for mocking. - protected DataTransferJobGetResultCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal DataTransferJobGetResultCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _dataTransferJobGetResultDataTransferJobsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", DataTransferJobGetResultResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(DataTransferJobGetResultResource.ResourceType, out string dataTransferJobGetResultDataTransferJobsApiVersion); - _dataTransferJobGetResultDataTransferJobsRestClient = new DataTransferJobsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataTransferJobGetResultDataTransferJobsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != CosmosDBAccountResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, CosmosDBAccountResource.ResourceType), nameof(id)); - } - - /// - /// Creates a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Create - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Name of the Data Transfer Job. - /// The to use. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string jobName, DataTransferJobGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _dataTransferJobGetResultDataTransferJobsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, content, cancellationToken).ConfigureAwait(false); - var uri = _dataTransferJobGetResultDataTransferJobsRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, content); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new CosmosDBArmOperation(Response.FromValue(new DataTransferJobGetResultResource(Client, response), response.GetRawResponse()), rehydrationToken); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Create - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Name of the Data Transfer Job. - /// The to use. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string jobName, DataTransferJobGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _dataTransferJobGetResultDataTransferJobsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, content, cancellationToken); - var uri = _dataTransferJobGetResultDataTransferJobsRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, content); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new CosmosDBArmOperation(Response.FromValue(new DataTransferJobGetResultResource(Client, response), response.GetRawResponse()), rehydrationToken); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultCollection.Get"); - scope.Start(); - try - { - var response = await _dataTransferJobGetResultDataTransferJobsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultCollection.Get"); - scope.Start(); - try - { - var response = _dataTransferJobGetResultDataTransferJobsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a list of Data Transfer jobs. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs - /// - /// - /// Operation Id - /// DataTransferJobs_ListByDatabaseAccount - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _dataTransferJobGetResultDataTransferJobsRestClient.CreateListByDatabaseAccountRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataTransferJobGetResultDataTransferJobsRestClient.CreateListByDatabaseAccountNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataTransferJobGetResultResource(Client, DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(e)), _dataTransferJobGetResultDataTransferJobsClientDiagnostics, Pipeline, "DataTransferJobGetResultCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Get a list of Data Transfer jobs. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs - /// - /// - /// Operation Id - /// DataTransferJobs_ListByDatabaseAccount - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _dataTransferJobGetResultDataTransferJobsRestClient.CreateListByDatabaseAccountRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataTransferJobGetResultDataTransferJobsRestClient.CreateListByDatabaseAccountNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataTransferJobGetResultResource(Client, DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(e)), _dataTransferJobGetResultDataTransferJobsClientDiagnostics, Pipeline, "DataTransferJobGetResultCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultCollection.Exists"); - scope.Start(); - try - { - var response = await _dataTransferJobGetResultDataTransferJobsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultCollection.Exists"); - scope.Start(); - try - { - var response = _dataTransferJobGetResultDataTransferJobsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _dataTransferJobGetResultDataTransferJobsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultCollection.GetIfExists"); - scope.Start(); - try - { - var response = _dataTransferJobGetResultDataTransferJobsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultData.Serialization.cs deleted file mode 100644 index 1cfeffb56917..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultData.Serialization.cs +++ /dev/null @@ -1,606 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class DataTransferJobGetResultData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataTransferJobGetResultData)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(JobName)) - { - writer.WritePropertyName("jobName"u8); - writer.WriteStringValue(JobName); - } - if (Optional.IsDefined(Source)) - { - writer.WritePropertyName("source"u8); - writer.WriteObjectValue(Source, options); - } - if (Optional.IsDefined(Destination)) - { - writer.WritePropertyName("destination"u8); - writer.WriteObjectValue(Destination, options); - } - if (options.Format != "W" && Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status); - } - if (options.Format != "W" && Optional.IsDefined(ProcessedCount)) - { - writer.WritePropertyName("processedCount"u8); - writer.WriteNumberValue(ProcessedCount.Value); - } - if (options.Format != "W" && Optional.IsDefined(TotalCount)) - { - writer.WritePropertyName("totalCount"u8); - writer.WriteNumberValue(TotalCount.Value); - } - if (options.Format != "W" && Optional.IsDefined(LastUpdatedUtcOn)) - { - writer.WritePropertyName("lastUpdatedUtcTime"u8); - writer.WriteStringValue(LastUpdatedUtcOn.Value, "O"); - } - if (Optional.IsDefined(WorkerCount)) - { - writer.WritePropertyName("workerCount"u8); - writer.WriteNumberValue(WorkerCount.Value); - } - if (options.Format != "W" && Optional.IsDefined(Error)) - { - writer.WritePropertyName("error"u8); - writer.WriteObjectValue(Error, options); - } - if (options.Format != "W" && Optional.IsDefined(Duration)) - { - writer.WritePropertyName("duration"u8); - writer.WriteStringValue(Duration.Value, "c"); - } - if (Optional.IsDefined(Mode)) - { - writer.WritePropertyName("mode"u8); - writer.WriteStringValue(Mode.Value.ToString()); - } - writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - DataTransferJobGetResultData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataTransferJobGetResultData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDataTransferJobGetResultData(document.RootElement, options); - } - - internal static DataTransferJobGetResultData DeserializeDataTransferJobGetResultData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - string jobName = default; - DataTransferDataSourceSink source = default; - DataTransferDataSourceSink destination = default; - string status = default; - long? processedCount = default; - long? totalCount = default; - DateTimeOffset? lastUpdatedUtcTime = default; - int? workerCount = default; - CosmosDBErrorResult error = default; - TimeSpan? duration = default; - DataTransferJobMode? mode = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("jobName"u8)) - { - jobName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("source"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - source = DataTransferDataSourceSink.DeserializeDataTransferDataSourceSink(property0.Value, options); - continue; - } - if (property0.NameEquals("destination"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - destination = DataTransferDataSourceSink.DeserializeDataTransferDataSourceSink(property0.Value, options); - continue; - } - if (property0.NameEquals("status"u8)) - { - status = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("processedCount"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - processedCount = property0.Value.GetInt64(); - continue; - } - if (property0.NameEquals("totalCount"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - totalCount = property0.Value.GetInt64(); - continue; - } - if (property0.NameEquals("lastUpdatedUtcTime"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - lastUpdatedUtcTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("workerCount"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - workerCount = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("error"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - error = CosmosDBErrorResult.DeserializeCosmosDBErrorResult(property0.Value, options); - continue; - } - if (property0.NameEquals("duration"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - duration = property0.Value.GetTimeSpan("c"); - continue; - } - if (property0.NameEquals("mode"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - mode = new DataTransferJobMode(property0.Value.GetString()); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new DataTransferJobGetResultData( - id, - name, - type, - systemData, - jobName, - source, - destination, - status, - processedCount, - totalCount, - lastUpdatedUtcTime, - workerCount, - error, - duration, - mode, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.Append(" properties:"); - builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(JobName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" jobName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(JobName)) - { - builder.Append(" jobName: "); - if (JobName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{JobName}'''"); - } - else - { - builder.AppendLine($"'{JobName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Source), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" source: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Source)) - { - builder.Append(" source: "); - BicepSerializationHelpers.AppendChildObject(builder, Source, options, 4, false, " source: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Destination), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" destination: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Destination)) - { - builder.Append(" destination: "); - BicepSerializationHelpers.AppendChildObject(builder, Destination, options, 4, false, " destination: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Status), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" status: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Status)) - { - builder.Append(" status: "); - if (Status.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Status}'''"); - } - else - { - builder.AppendLine($"'{Status}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProcessedCount), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" processedCount: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ProcessedCount)) - { - builder.Append(" processedCount: "); - builder.AppendLine($"'{ProcessedCount.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TotalCount), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" totalCount: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(TotalCount)) - { - builder.Append(" totalCount: "); - builder.AppendLine($"'{TotalCount.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LastUpdatedUtcOn), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" lastUpdatedUtcTime: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(LastUpdatedUtcOn)) - { - builder.Append(" lastUpdatedUtcTime: "); - var formattedDateTimeString = TypeFormatters.ToString(LastUpdatedUtcOn.Value, "o"); - builder.AppendLine($"'{formattedDateTimeString}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(WorkerCount), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" workerCount: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(WorkerCount)) - { - builder.Append(" workerCount: "); - builder.AppendLine($"{WorkerCount.Value}"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Error), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" error: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Error)) - { - builder.Append(" error: "); - BicepSerializationHelpers.AppendChildObject(builder, Error, options, 4, false, " error: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Duration), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" duration: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Duration)) - { - builder.Append(" duration: "); - var formattedTimeSpan = TypeFormatters.ToString(Duration.Value, "P"); - builder.AppendLine($"'{formattedTimeSpan}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Mode), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" mode: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Mode)) - { - builder.Append(" mode: "); - builder.AppendLine($"'{Mode.Value.ToString()}'"); - } - } - - builder.AppendLine(" }"); - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(DataTransferJobGetResultData)} does not support writing '{options.Format}' format."); - } - } - - DataTransferJobGetResultData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDataTransferJobGetResultData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DataTransferJobGetResultData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultData.cs deleted file mode 100644 index 570098ac55e4..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultData.cs +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A class representing the DataTransferJobGetResult data model. - /// A Cosmos DB Data Transfer Job - /// - public partial class DataTransferJobGetResultData : ResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public DataTransferJobGetResultData() - { - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Job Name. - /// - /// Source DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . - /// - /// - /// Destination DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . - /// - /// Job Status. - /// Processed Count. - /// Total Count. - /// Last Updated Time (ISO-8601 format). - /// Worker count. - /// Error response for Faulted job. - /// Total Duration of Job. - /// Mode of job execution. - /// Keeps track of any properties unknown to the library. - internal DataTransferJobGetResultData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string jobName, DataTransferDataSourceSink source, DataTransferDataSourceSink destination, string status, long? processedCount, long? totalCount, DateTimeOffset? lastUpdatedUtcOn, int? workerCount, CosmosDBErrorResult error, TimeSpan? duration, DataTransferJobMode? mode, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) - { - JobName = jobName; - Source = source; - Destination = destination; - Status = status; - ProcessedCount = processedCount; - TotalCount = totalCount; - LastUpdatedUtcOn = lastUpdatedUtcOn; - WorkerCount = workerCount; - Error = error; - Duration = duration; - Mode = mode; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Job Name. - [WirePath("properties.jobName")] - public string JobName { get; } - /// - /// Source DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . - /// - [WirePath("properties.source")] - public DataTransferDataSourceSink Source { get; set; } - /// - /// Destination DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . - /// - [WirePath("properties.destination")] - public DataTransferDataSourceSink Destination { get; set; } - /// Job Status. - [WirePath("properties.status")] - public string Status { get; } - /// Processed Count. - [WirePath("properties.processedCount")] - public long? ProcessedCount { get; } - /// Total Count. - [WirePath("properties.totalCount")] - public long? TotalCount { get; } - /// Last Updated Time (ISO-8601 format). - [WirePath("properties.lastUpdatedUtcTime")] - public DateTimeOffset? LastUpdatedUtcOn { get; } - /// Worker count. - [WirePath("properties.workerCount")] - public int? WorkerCount { get; set; } - /// Error response for Faulted job. - [WirePath("properties.error")] - public CosmosDBErrorResult Error { get; } - /// Total Duration of Job. - [WirePath("properties.duration")] - public TimeSpan? Duration { get; } - /// Mode of job execution. - [WirePath("properties.mode")] - public DataTransferJobMode? Mode { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultResource.Serialization.cs deleted file mode 100644 index bd195cdfe057..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class DataTransferJobGetResultResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - DataTransferJobGetResultData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - DataTransferJobGetResultData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultResource.cs deleted file mode 100644 index ed1b946d3f5a..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultResource.cs +++ /dev/null @@ -1,572 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A Class representing a DataTransferJobGetResult along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetDataTransferJobGetResultResource method. - /// Otherwise you can get one from its parent resource using the GetDataTransferJobGetResult method. - /// - public partial class DataTransferJobGetResultResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The accountName. - /// The jobName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string jobName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _dataTransferJobGetResultDataTransferJobsClientDiagnostics; - private readonly DataTransferJobsRestOperations _dataTransferJobGetResultDataTransferJobsRestClient; - private readonly DataTransferJobGetResultData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.DocumentDB/databaseAccounts/dataTransferJobs"; - - /// Initializes a new instance of the class for mocking. - protected DataTransferJobGetResultResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal DataTransferJobGetResultResource(ArmClient client, DataTransferJobGetResultData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal DataTransferJobGetResultResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _dataTransferJobGetResultDataTransferJobsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string dataTransferJobGetResultDataTransferJobsApiVersion); - _dataTransferJobGetResultDataTransferJobsRestClient = new DataTransferJobsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataTransferJobGetResultDataTransferJobsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual DataTransferJobGetResultData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Get a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultResource.Get"); - scope.Start(); - try - { - var response = await _dataTransferJobGetResultDataTransferJobsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultResource.Get"); - scope.Start(); - try - { - var response = _dataTransferJobGetResultDataTransferJobsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Create - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The to use. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, DataTransferJobGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultResource.Update"); - scope.Start(); - try - { - var response = await _dataTransferJobGetResultDataTransferJobsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); - var uri = _dataTransferJobGetResultDataTransferJobsRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new CosmosDBArmOperation(Response.FromValue(new DataTransferJobGetResultResource(Client, response), response.GetRawResponse()), rehydrationToken); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Create - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The to use. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, DataTransferJobGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultResource.Update"); - scope.Start(); - try - { - var response = _dataTransferJobGetResultDataTransferJobsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); - var uri = _dataTransferJobGetResultDataTransferJobsRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new CosmosDBArmOperation(Response.FromValue(new DataTransferJobGetResultResource(Client, response), response.GetRawResponse()), rehydrationToken); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Pause a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/pause - /// - /// - /// Operation Id - /// DataTransferJobs_Pause - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> PauseAsync(CancellationToken cancellationToken = default) - { - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultResource.Pause"); - scope.Start(); - try - { - var response = await _dataTransferJobGetResultDataTransferJobsRestClient.PauseAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Pause a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/pause - /// - /// - /// Operation Id - /// DataTransferJobs_Pause - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Pause(CancellationToken cancellationToken = default) - { - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultResource.Pause"); - scope.Start(); - try - { - var response = _dataTransferJobGetResultDataTransferJobsRestClient.Pause(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Resumes a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/resume - /// - /// - /// Operation Id - /// DataTransferJobs_Resume - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> ResumeAsync(CancellationToken cancellationToken = default) - { - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultResource.Resume"); - scope.Start(); - try - { - var response = await _dataTransferJobGetResultDataTransferJobsRestClient.ResumeAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Resumes a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/resume - /// - /// - /// Operation Id - /// DataTransferJobs_Resume - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Resume(CancellationToken cancellationToken = default) - { - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultResource.Resume"); - scope.Start(); - try - { - var response = _dataTransferJobGetResultDataTransferJobsRestClient.Resume(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Cancels a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/cancel - /// - /// - /// Operation Id - /// DataTransferJobs_Cancel - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> CancelAsync(CancellationToken cancellationToken = default) - { - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultResource.Cancel"); - scope.Start(); - try - { - var response = await _dataTransferJobGetResultDataTransferJobsRestClient.CancelAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Cancels a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/cancel - /// - /// - /// Operation Id - /// DataTransferJobs_Cancel - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Cancel(CancellationToken cancellationToken = default) - { - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultResource.Cancel"); - scope.Start(); - try - { - var response = _dataTransferJobGetResultDataTransferJobsRestClient.Cancel(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Completes a Data Transfer Online Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/complete - /// - /// - /// Operation Id - /// DataTransferJobs_Complete - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> CompleteAsync(CancellationToken cancellationToken = default) - { - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultResource.Complete"); - scope.Start(); - try - { - var response = await _dataTransferJobGetResultDataTransferJobsRestClient.CompleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Completes a Data Transfer Online Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/complete - /// - /// - /// Operation Id - /// DataTransferJobs_Complete - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Complete(CancellationToken cancellationToken = default) - { - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultResource.Complete"); - scope.Start(); - try - { - var response = _dataTransferJobGetResultDataTransferJobsRestClient.Complete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/CosmosDBExtensions.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/CosmosDBExtensions.cs index 372694acc197..5fbc69622366 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/CosmosDBExtensions.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/CosmosDBExtensions.cs @@ -37,25 +37,6 @@ private static MockableCosmosDBTenantResource GetMockableCosmosDBTenantResource( return resource.GetCachedClient(client => new MockableCosmosDBTenantResource(client, resource.Id)); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static NetworkSecurityPerimeterConfigurationResource GetNetworkSecurityPerimeterConfigurationResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableCosmosDBArmClient(client).GetNetworkSecurityPerimeterConfigurationResource(id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -75,25 +56,6 @@ public static CosmosDBAccountResource GetCosmosDBAccountResource(this ArmClient return GetMockableCosmosDBArmClient(client).GetCosmosDBAccountResource(id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static GraphResourceGetResultResource GetGraphResourceGetResultResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableCosmosDBArmClient(client).GetGraphResourceGetResultResource(id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -246,25 +208,6 @@ public static CassandraTableThroughputSettingResource GetCassandraTableThroughpu return GetMockableCosmosDBArmClient(client).GetCassandraTableThroughputSettingResource(id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static CassandraViewThroughputSettingResource GetCassandraViewThroughputSettingResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableCosmosDBArmClient(client).GetCassandraViewThroughputSettingResource(id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -304,41 +247,41 @@ public static GremlinGraphThroughputSettingResource GetGremlinGraphThroughputSet } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static CosmosDBSqlClientEncryptionKeyResource GetCosmosDBSqlClientEncryptionKeyResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static CosmosDBSqlContainerResource GetCosmosDBSqlContainerResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableCosmosDBArmClient(client).GetCosmosDBSqlClientEncryptionKeyResource(id); + return GetMockableCosmosDBArmClient(client).GetCosmosDBSqlContainerResource(id); } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static CosmosDBSqlContainerResource GetCosmosDBSqlContainerResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static CosmosDBSqlClientEncryptionKeyResource GetCosmosDBSqlClientEncryptionKeyResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableCosmosDBArmClient(client).GetCosmosDBSqlContainerResource(id); + return GetMockableCosmosDBArmClient(client).GetCosmosDBSqlClientEncryptionKeyResource(id); } /// @@ -569,25 +512,6 @@ public static CassandraTableResource GetCassandraTableResource(this ArmClient cl return GetMockableCosmosDBArmClient(client).GetCassandraTableResource(id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static CassandraViewGetResultResource GetCassandraViewGetResultResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableCosmosDBArmClient(client).GetCassandraViewGetResultResource(id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -645,25 +569,6 @@ public static CosmosDBLocationResource GetCosmosDBLocationResource(this ArmClien return GetMockableCosmosDBArmClient(client).GetCosmosDBLocationResource(id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static DataTransferJobGetResultResource GetDataTransferJobGetResultResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableCosmosDBArmClient(client).GetDataTransferJobGetResultResource(id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -778,44 +683,6 @@ public static CosmosDBServiceResource GetCosmosDBServiceResource(this ArmClient return GetMockableCosmosDBArmClient(client).GetCosmosDBServiceResource(id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static CosmosDBThroughputPoolResource GetCosmosDBThroughputPoolResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableCosmosDBArmClient(client).GetCosmosDBThroughputPoolResource(id); - } - - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static CosmosDBThroughputPoolAccountResource GetCosmosDBThroughputPoolAccountResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableCosmosDBArmClient(client).GetCosmosDBThroughputPoolAccountResource(id); - } - /// /// Gets a collection of CosmosDBAccountResources in the ResourceGroupResource. /// @@ -846,7 +713,7 @@ public static CosmosDBAccountCollection GetCosmosDBAccounts(this ResourceGroupRe /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -884,7 +751,7 @@ public static async Task> GetCosmosDBAccountAs /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -939,7 +806,7 @@ public static CassandraClusterCollection GetCassandraClusters(this ResourceGroup /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -977,7 +844,7 @@ public static async Task> GetCassandraCluster /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1002,99 +869,6 @@ public static Response GetCassandraCluster(this Resour return GetMockableCosmosDBResourceGroupResource(resourceGroupResource).GetCassandraCluster(clusterName, cancellationToken); } - /// - /// Gets a collection of CosmosDBThroughputPoolResources in the ResourceGroupResource. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// is null. - /// An object representing collection of CosmosDBThroughputPoolResources and their operations over a CosmosDBThroughputPoolResource. - public static CosmosDBThroughputPoolCollection GetCosmosDBThroughputPools(this ResourceGroupResource resourceGroupResource) - { - Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - - return GetMockableCosmosDBResourceGroupResource(resourceGroupResource).GetCosmosDBThroughputPools(); - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public static async Task> GetCosmosDBThroughputPoolAsync(this ResourceGroupResource resourceGroupResource, string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - - return await GetMockableCosmosDBResourceGroupResource(resourceGroupResource).GetCosmosDBThroughputPoolAsync(throughputPoolName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public static Response GetCosmosDBThroughputPool(this ResourceGroupResource resourceGroupResource, string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - - return GetMockableCosmosDBResourceGroupResource(resourceGroupResource).GetCosmosDBThroughputPool(throughputPoolName, cancellationToken); - } - /// /// Gets a collection of CosmosDBLocationResources in the SubscriptionResource. /// @@ -1125,7 +899,7 @@ public static CosmosDBLocationCollection GetCosmosDBLocations(this SubscriptionR /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1162,7 +936,7 @@ public static async Task> GetCosmosDBLocation /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1199,7 +973,7 @@ public static Response GetCosmosDBLocation(this Subscr /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1235,7 +1009,7 @@ public static AsyncPageable GetCosmosDBAccountsAsync(th /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1271,7 +1045,7 @@ public static Pageable GetCosmosDBAccounts(this Subscri /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1307,7 +1081,7 @@ public static AsyncPageable GetCassandraClustersAsync( /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1343,7 +1117,7 @@ public static Pageable GetCassandraClusters(this Subsc /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1379,7 +1153,7 @@ public static AsyncPageable GetRestorableCosm /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1402,78 +1176,6 @@ public static Pageable GetRestorableCosmosDBA return GetMockableCosmosDBSubscriptionResource(subscriptionResource).GetRestorableCosmosDBAccounts(cancellationToken); } - /// - /// Lists all the Azure Cosmos DB Throughput Pools available under the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/throughputPools - /// - /// - /// Operation Id - /// ThroughputPools_List - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// is null. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetCosmosDBThroughputPoolsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - - return GetMockableCosmosDBSubscriptionResource(subscriptionResource).GetCosmosDBThroughputPoolsAsync(cancellationToken); - } - - /// - /// Lists all the Azure Cosmos DB Throughput Pools available under the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/throughputPools - /// - /// - /// Operation Id - /// ThroughputPools_List - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// is null. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetCosmosDBThroughputPools(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - - return GetMockableCosmosDBSubscriptionResource(subscriptionResource).GetCosmosDBThroughputPools(cancellationToken); - } - /// /// Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase letters, numbers, and the '-' character, and must be between 3 and 50 characters. /// @@ -1487,7 +1189,7 @@ public static Pageable GetCosmosDBThroughputPool /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -1524,7 +1226,7 @@ public static async Task> CheckNameExistsDatabaseAccountAsync(thi /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBArmClient.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBArmClient.cs index db7a53d5ec28..46b5ff6c6c8e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBArmClient.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBArmClient.cs @@ -34,18 +34,6 @@ private string GetApiVersionOrNull(ResourceType resourceType) return apiVersion; } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual NetworkSecurityPerimeterConfigurationResource GetNetworkSecurityPerimeterConfigurationResource(ResourceIdentifier id) - { - NetworkSecurityPerimeterConfigurationResource.ValidateResourceId(id); - return new NetworkSecurityPerimeterConfigurationResource(Client, id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -58,18 +46,6 @@ public virtual CosmosDBAccountResource GetCosmosDBAccountResource(ResourceIdenti return new CosmosDBAccountResource(Client, id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual GraphResourceGetResultResource GetGraphResourceGetResultResource(ResourceIdentifier id) - { - GraphResourceGetResultResource.ValidateResourceId(id); - return new GraphResourceGetResultResource(Client, id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -166,18 +142,6 @@ public virtual CassandraTableThroughputSettingResource GetCassandraTableThroughp return new CassandraTableThroughputSettingResource(Client, id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual CassandraViewThroughputSettingResource GetCassandraViewThroughputSettingResource(ResourceIdentifier id) - { - CassandraViewThroughputSettingResource.ValidateResourceId(id); - return new CassandraViewThroughputSettingResource(Client, id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -202,18 +166,6 @@ public virtual GremlinGraphThroughputSettingResource GetGremlinGraphThroughputSe return new GremlinGraphThroughputSettingResource(Client, id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual CosmosDBSqlClientEncryptionKeyResource GetCosmosDBSqlClientEncryptionKeyResource(ResourceIdentifier id) - { - CosmosDBSqlClientEncryptionKeyResource.ValidateResourceId(id); - return new CosmosDBSqlClientEncryptionKeyResource(Client, id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -226,6 +178,18 @@ public virtual CosmosDBSqlContainerResource GetCosmosDBSqlContainerResource(Reso return new CosmosDBSqlContainerResource(Client, id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual CosmosDBSqlClientEncryptionKeyResource GetCosmosDBSqlClientEncryptionKeyResource(ResourceIdentifier id) + { + CosmosDBSqlClientEncryptionKeyResource.ValidateResourceId(id); + return new CosmosDBSqlClientEncryptionKeyResource(Client, id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -370,18 +334,6 @@ public virtual CassandraTableResource GetCassandraTableResource(ResourceIdentifi return new CassandraTableResource(Client, id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual CassandraViewGetResultResource GetCassandraViewGetResultResource(ResourceIdentifier id) - { - CassandraViewGetResultResource.ValidateResourceId(id); - return new CassandraViewGetResultResource(Client, id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -418,18 +370,6 @@ public virtual CosmosDBLocationResource GetCosmosDBLocationResource(ResourceIden return new CosmosDBLocationResource(Client, id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual DataTransferJobGetResultResource GetDataTransferJobGetResultResource(ResourceIdentifier id) - { - DataTransferJobGetResultResource.ValidateResourceId(id); - return new DataTransferJobGetResultResource(Client, id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -501,29 +441,5 @@ public virtual CosmosDBServiceResource GetCosmosDBServiceResource(ResourceIdenti CosmosDBServiceResource.ValidateResourceId(id); return new CosmosDBServiceResource(Client, id); } - - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual CosmosDBThroughputPoolResource GetCosmosDBThroughputPoolResource(ResourceIdentifier id) - { - CosmosDBThroughputPoolResource.ValidateResourceId(id); - return new CosmosDBThroughputPoolResource(Client, id); - } - - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual CosmosDBThroughputPoolAccountResource GetCosmosDBThroughputPoolAccountResource(ResourceIdentifier id) - { - CosmosDBThroughputPoolAccountResource.ValidateResourceId(id); - return new CosmosDBThroughputPoolAccountResource(Client, id); - } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBResourceGroupResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBResourceGroupResource.cs index f2f1f6c662dd..fdb9c39d32e5 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBResourceGroupResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBResourceGroupResource.cs @@ -53,7 +53,7 @@ public virtual CosmosDBAccountCollection GetCosmosDBAccounts() /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -84,7 +84,7 @@ public virtual async Task> GetCosmosDBAccountA /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -122,7 +122,7 @@ public virtual CassandraClusterCollection GetCassandraClusters() /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -153,7 +153,7 @@ public virtual async Task> GetCassandraCluste /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -170,74 +170,5 @@ public virtual Response GetCassandraCluster(string clu { return GetCassandraClusters().Get(clusterName, cancellationToken); } - - /// Gets a collection of CosmosDBThroughputPoolResources in the ResourceGroupResource. - /// An object representing collection of CosmosDBThroughputPoolResources and their operations over a CosmosDBThroughputPoolResource. - public virtual CosmosDBThroughputPoolCollection GetCosmosDBThroughputPools() - { - return GetCachedClient(client => new CosmosDBThroughputPoolCollection(client, Id)); - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetCosmosDBThroughputPoolAsync(string throughputPoolName, CancellationToken cancellationToken = default) - { - return await GetCosmosDBThroughputPools().GetAsync(throughputPoolName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetCosmosDBThroughputPool(string throughputPoolName, CancellationToken cancellationToken = default) - { - return GetCosmosDBThroughputPools().Get(throughputPoolName, cancellationToken); - } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBSubscriptionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBSubscriptionResource.cs index 24d162e81730..fe60bb18283a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBSubscriptionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBSubscriptionResource.cs @@ -22,8 +22,6 @@ public partial class MockableCosmosDBSubscriptionResource : ArmResource private CassandraClustersRestOperations _cassandraClusterRestClient; private ClientDiagnostics _restorableCosmosDBAccountRestorableDatabaseAccountsClientDiagnostics; private RestorableDatabaseAccountsRestOperations _restorableCosmosDBAccountRestorableDatabaseAccountsRestClient; - private ClientDiagnostics _cosmosDBThroughputPoolThroughputPoolsClientDiagnostics; - private ThroughputPoolsRestOperations _cosmosDBThroughputPoolThroughputPoolsRestClient; /// Initializes a new instance of the class for mocking. protected MockableCosmosDBSubscriptionResource() @@ -43,8 +41,6 @@ internal MockableCosmosDBSubscriptionResource(ArmClient client, ResourceIdentifi private CassandraClustersRestOperations CassandraClusterRestClient => _cassandraClusterRestClient ??= new CassandraClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(CassandraClusterResource.ResourceType)); private ClientDiagnostics RestorableCosmosDBAccountRestorableDatabaseAccountsClientDiagnostics => _restorableCosmosDBAccountRestorableDatabaseAccountsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.CosmosDB", RestorableCosmosDBAccountResource.ResourceType.Namespace, Diagnostics); private RestorableDatabaseAccountsRestOperations RestorableCosmosDBAccountRestorableDatabaseAccountsRestClient => _restorableCosmosDBAccountRestorableDatabaseAccountsRestClient ??= new RestorableDatabaseAccountsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(RestorableCosmosDBAccountResource.ResourceType)); - private ClientDiagnostics CosmosDBThroughputPoolThroughputPoolsClientDiagnostics => _cosmosDBThroughputPoolThroughputPoolsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.CosmosDB", CosmosDBThroughputPoolResource.ResourceType.Namespace, Diagnostics); - private ThroughputPoolsRestOperations CosmosDBThroughputPoolThroughputPoolsRestClient => _cosmosDBThroughputPoolThroughputPoolsRestClient ??= new ThroughputPoolsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(CosmosDBThroughputPoolResource.ResourceType)); private string GetApiVersionOrNull(ResourceType resourceType) { @@ -72,7 +68,7 @@ public virtual CosmosDBLocationCollection GetCosmosDBLocations() /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -101,7 +97,7 @@ public virtual async Task> GetCosmosDBLocatio /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -130,7 +126,7 @@ public virtual Response GetCosmosDBLocation(AzureLocat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -159,7 +155,7 @@ public virtual AsyncPageable GetCosmosDBAccountsAsync(C /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -188,7 +184,7 @@ public virtual Pageable GetCosmosDBAccounts(Cancellatio /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -217,7 +213,7 @@ public virtual AsyncPageable GetCassandraClustersAsync /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -246,7 +242,7 @@ public virtual Pageable GetCassandraClusters(Cancellat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -275,7 +271,7 @@ public virtual AsyncPageable GetRestorableCos /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -290,65 +286,5 @@ public virtual Pageable GetRestorableCosmosDB HttpMessage FirstPageRequest(int? pageSizeHint) => RestorableCosmosDBAccountRestorableDatabaseAccountsRestClient.CreateListRequest(Id.SubscriptionId); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new RestorableCosmosDBAccountResource(Client, RestorableCosmosDBAccountData.DeserializeRestorableCosmosDBAccountData(e)), RestorableCosmosDBAccountRestorableDatabaseAccountsClientDiagnostics, Pipeline, "MockableCosmosDBSubscriptionResource.GetRestorableCosmosDBAccounts", "value", null, cancellationToken); } - - /// - /// Lists all the Azure Cosmos DB Throughput Pools available under the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/throughputPools - /// - /// - /// Operation Id - /// ThroughputPools_List - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetCosmosDBThroughputPoolsAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => CosmosDBThroughputPoolThroughputPoolsRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CosmosDBThroughputPoolThroughputPoolsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CosmosDBThroughputPoolResource(Client, CosmosDBThroughputPoolData.DeserializeCosmosDBThroughputPoolData(e)), CosmosDBThroughputPoolThroughputPoolsClientDiagnostics, Pipeline, "MockableCosmosDBSubscriptionResource.GetCosmosDBThroughputPools", "value", "nextLink", cancellationToken); - } - - /// - /// Lists all the Azure Cosmos DB Throughput Pools available under the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/throughputPools - /// - /// - /// Operation Id - /// ThroughputPools_List - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetCosmosDBThroughputPools(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => CosmosDBThroughputPoolThroughputPoolsRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CosmosDBThroughputPoolThroughputPoolsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CosmosDBThroughputPoolResource(Client, CosmosDBThroughputPoolData.DeserializeCosmosDBThroughputPoolData(e)), CosmosDBThroughputPoolThroughputPoolsClientDiagnostics, Pipeline, "MockableCosmosDBSubscriptionResource.GetCosmosDBThroughputPools", "value", "nextLink", cancellationToken); - } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBTenantResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBTenantResource.cs index 354a9e67a9af..777393f4622d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBTenantResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBTenantResource.cs @@ -53,7 +53,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -96,7 +96,7 @@ public virtual async Task> CheckNameExistsDatabaseAccountAsync(st /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultCollection.cs deleted file mode 100644 index bcfdade2f354..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultCollection.cs +++ /dev/null @@ -1,492 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetGraphResourceGetResults method from an instance of . - /// - public partial class GraphResourceGetResultCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _graphResourceGetResultGraphResourcesClientDiagnostics; - private readonly GraphResourcesRestOperations _graphResourceGetResultGraphResourcesRestClient; - - /// Initializes a new instance of the class for mocking. - protected GraphResourceGetResultCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal GraphResourceGetResultCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _graphResourceGetResultGraphResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", GraphResourceGetResultResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(GraphResourceGetResultResource.ResourceType, out string graphResourceGetResultGraphResourcesApiVersion); - _graphResourceGetResultGraphResourcesRestClient = new GraphResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, graphResourceGetResultGraphResourcesApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != CosmosDBAccountResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, CosmosDBAccountResource.ResourceType), nameof(id)); - } - - /// - /// Create or update an Azure Cosmos DB Graph. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_CreateUpdateGraph - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Cosmos DB graph resource name. - /// The parameters to provide for the current graph. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string graphName, GraphResourceGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _graphResourceGetResultGraphResourcesRestClient.CreateUpdateGraphAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, graphName, content, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new GraphResourceGetResultOperationSource(Client), _graphResourceGetResultGraphResourcesClientDiagnostics, Pipeline, _graphResourceGetResultGraphResourcesRestClient.CreateCreateUpdateGraphRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, graphName, content).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create or update an Azure Cosmos DB Graph. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_CreateUpdateGraph - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Cosmos DB graph resource name. - /// The parameters to provide for the current graph. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string graphName, GraphResourceGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _graphResourceGetResultGraphResourcesRestClient.CreateUpdateGraph(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, graphName, content, cancellationToken); - var operation = new CosmosDBArmOperation(new GraphResourceGetResultOperationSource(Client), _graphResourceGetResultGraphResourcesClientDiagnostics, Pipeline, _graphResourceGetResultGraphResourcesRestClient.CreateCreateUpdateGraphRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, graphName, content).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB graph resource name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string graphName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultCollection.Get"); - scope.Start(); - try - { - var response = await _graphResourceGetResultGraphResourcesRestClient.GetGraphAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, graphName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new GraphResourceGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB graph resource name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string graphName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultCollection.Get"); - scope.Start(); - try - { - var response = _graphResourceGetResultGraphResourcesRestClient.GetGraph(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, graphName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new GraphResourceGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists the graphs under an existing Azure Cosmos DB database account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs - /// - /// - /// Operation Id - /// GraphResources_ListGraphs - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _graphResourceGetResultGraphResourcesRestClient.CreateListGraphsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new GraphResourceGetResultResource(Client, GraphResourceGetResultData.DeserializeGraphResourceGetResultData(e)), _graphResourceGetResultGraphResourcesClientDiagnostics, Pipeline, "GraphResourceGetResultCollection.GetAll", "value", null, cancellationToken); - } - - /// - /// Lists the graphs under an existing Azure Cosmos DB database account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs - /// - /// - /// Operation Id - /// GraphResources_ListGraphs - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _graphResourceGetResultGraphResourcesRestClient.CreateListGraphsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new GraphResourceGetResultResource(Client, GraphResourceGetResultData.DeserializeGraphResourceGetResultData(e)), _graphResourceGetResultGraphResourcesClientDiagnostics, Pipeline, "GraphResourceGetResultCollection.GetAll", "value", null, cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB graph resource name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string graphName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultCollection.Exists"); - scope.Start(); - try - { - var response = await _graphResourceGetResultGraphResourcesRestClient.GetGraphAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, graphName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB graph resource name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string graphName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultCollection.Exists"); - scope.Start(); - try - { - var response = _graphResourceGetResultGraphResourcesRestClient.GetGraph(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, graphName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB graph resource name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string graphName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _graphResourceGetResultGraphResourcesRestClient.GetGraphAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, graphName, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new GraphResourceGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB graph resource name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string graphName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultCollection.GetIfExists"); - scope.Start(); - try - { - var response = _graphResourceGetResultGraphResourcesRestClient.GetGraph(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, graphName, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new GraphResourceGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultData.Serialization.cs deleted file mode 100644 index 7a2d7010da26..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultData.Serialization.cs +++ /dev/null @@ -1,442 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class GraphResourceGetResultData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(GraphResourceGetResultData)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Resource)) - { - writer.WritePropertyName("resource"u8); - JsonSerializer.Serialize(writer, Resource); - } - if (Optional.IsDefined(Options)) - { - writer.WritePropertyName("options"u8); - writer.WriteObjectValue(Options, options); - } - writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - GraphResourceGetResultData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(GraphResourceGetResultData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeGraphResourceGetResultData(document.RootElement, options); - } - - internal static GraphResourceGetResultData DeserializeGraphResourceGetResultData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ManagedServiceIdentity identity = default; - IDictionary tags = default; - AzureLocation location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - WritableSubResource resource = default; - GraphResourceGetPropertiesOptions options0 = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("location"u8)) - { - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("resource"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resource = JsonSerializer.Deserialize(property0.Value.GetRawText()); - continue; - } - if (property0.NameEquals("options"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - options0 = GraphResourceGetPropertiesOptions.DeserializeGraphResourceGetPropertiesOptions(property0.Value, options); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new GraphResourceGetResultData( - id, - name, - type, - systemData, - tags ?? new ChangeTrackingDictionary(), - location, - resource, - options0, - identity, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" location: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" location: "); - builder.AppendLine($"'{Location.ToString()}'"); - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" tags: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Tags)) - { - if (Tags.Any()) - { - builder.Append(" tags: "); - builder.AppendLine("{"); - foreach (var item in Tags) - { - builder.Append($" '{item.Key}': "); - if (item.Value == null) - { - builder.Append("null"); - continue; - } - if (item.Value.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{item.Value}'''"); - } - else - { - builder.AppendLine($"'{item.Value}'"); - } - } - builder.AppendLine(" }"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.Append(" properties:"); - builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("ResourceId", out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" resource: "); - builder.AppendLine("{"); - builder.AppendLine(" resource: {"); - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - builder.AppendLine(" }"); - builder.AppendLine(" }"); - } - else - { - if (Optional.IsDefined(Resource)) - { - builder.Append(" resource: "); - BicepSerializationHelpers.AppendChildObject(builder, Resource, options, 4, false, " resource: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Options), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" options: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Options)) - { - builder.Append(" options: "); - BicepSerializationHelpers.AppendChildObject(builder, Options, options, 4, false, " options: "); - } - } - - builder.AppendLine(" }"); - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(GraphResourceGetResultData)} does not support writing '{options.Format}' format."); - } - } - - GraphResourceGetResultData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeGraphResourceGetResultData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(GraphResourceGetResultData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultData.cs deleted file mode 100644 index 7210bb573190..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultData.cs +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A class representing the GraphResourceGetResult data model. - /// An Azure Cosmos DB Graph resource. - /// - public partial class GraphResourceGetResultData : TrackedResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The location. - public GraphResourceGetResultData(AzureLocation location) : base(location) - { - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// Gets or sets the resource. - /// - /// Identity for the resource. - /// Keeps track of any properties unknown to the library. - internal GraphResourceGetResultData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, WritableSubResource resource, GraphResourceGetPropertiesOptions options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) - { - Resource = resource; - Options = options; - Identity = identity; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal GraphResourceGetResultData() - { - } - - /// Gets or sets the resource. - internal WritableSubResource Resource { get; set; } - /// Gets or sets Id. - [WirePath("properties.resource.id")] - public ResourceIdentifier ResourceId - { - get => Resource is null ? default : Resource.Id; - set - { - if (Resource is null) - Resource = new WritableSubResource(); - Resource.Id = value; - } - } - - /// Gets or sets the options. - [WirePath("properties.options")] - public GraphResourceGetPropertiesOptions Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultResource.Serialization.cs deleted file mode 100644 index 9cabba2759d1..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class GraphResourceGetResultResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - GraphResourceGetResultData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - GraphResourceGetResultData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultResource.cs deleted file mode 100644 index 26de982a8d08..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultResource.cs +++ /dev/null @@ -1,707 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A Class representing a GraphResourceGetResult along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetGraphResourceGetResultResource method. - /// Otherwise you can get one from its parent resource using the GetGraphResourceGetResult method. - /// - public partial class GraphResourceGetResultResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The accountName. - /// The graphName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string graphName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _graphResourceGetResultGraphResourcesClientDiagnostics; - private readonly GraphResourcesRestOperations _graphResourceGetResultGraphResourcesRestClient; - private readonly GraphResourceGetResultData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.DocumentDB/databaseAccounts/graphs"; - - /// Initializes a new instance of the class for mocking. - protected GraphResourceGetResultResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal GraphResourceGetResultResource(ArmClient client, GraphResourceGetResultData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal GraphResourceGetResultResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _graphResourceGetResultGraphResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string graphResourceGetResultGraphResourcesApiVersion); - _graphResourceGetResultGraphResourcesRestClient = new GraphResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, graphResourceGetResultGraphResourcesApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual GraphResourceGetResultData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultResource.Get"); - scope.Start(); - try - { - var response = await _graphResourceGetResultGraphResourcesRestClient.GetGraphAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new GraphResourceGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultResource.Get"); - scope.Start(); - try - { - var response = _graphResourceGetResultGraphResourcesRestClient.GetGraph(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new GraphResourceGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes an existing Azure Cosmos DB Graph Resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_DeleteGraphResource - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultResource.Delete"); - scope.Start(); - try - { - var response = await _graphResourceGetResultGraphResourcesRestClient.DeleteGraphResourceAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(_graphResourceGetResultGraphResourcesClientDiagnostics, Pipeline, _graphResourceGetResultGraphResourcesRestClient.CreateDeleteGraphResourceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes an existing Azure Cosmos DB Graph Resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_DeleteGraphResource - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultResource.Delete"); - scope.Start(); - try - { - var response = _graphResourceGetResultGraphResourcesRestClient.DeleteGraphResource(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new CosmosDBArmOperation(_graphResourceGetResultGraphResourcesClientDiagnostics, Pipeline, _graphResourceGetResultGraphResourcesRestClient.CreateDeleteGraphResourceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create or update an Azure Cosmos DB Graph. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_CreateUpdateGraph - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for the current graph. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, GraphResourceGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultResource.Update"); - scope.Start(); - try - { - var response = await _graphResourceGetResultGraphResourcesRestClient.CreateUpdateGraphAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new GraphResourceGetResultOperationSource(Client), _graphResourceGetResultGraphResourcesClientDiagnostics, Pipeline, _graphResourceGetResultGraphResourcesRestClient.CreateCreateUpdateGraphRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create or update an Azure Cosmos DB Graph. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_CreateUpdateGraph - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for the current graph. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, GraphResourceGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultResource.Update"); - scope.Start(); - try - { - var response = _graphResourceGetResultGraphResourcesRestClient.CreateUpdateGraph(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); - var operation = new CosmosDBArmOperation(new GraphResourceGetResultOperationSource(Client), _graphResourceGetResultGraphResourcesClientDiagnostics, Pipeline, _graphResourceGetResultGraphResourcesRestClient.CreateCreateUpdateGraphRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The value for the tag. - /// The cancellation token to use. - /// or is null. - public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - Argument.AssertNotNull(value, nameof(value)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultResource.AddTag"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues[key] = value; - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _graphResourceGetResultGraphResourcesRestClient.GetGraphAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new GraphResourceGetResultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new GraphResourceGetResultCreateOrUpdateContent(current.Location, current.Resource); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags[key] = value; - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The value for the tag. - /// The cancellation token to use. - /// or is null. - public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - Argument.AssertNotNull(value, nameof(value)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultResource.AddTag"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues[key] = value; - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _graphResourceGetResultGraphResourcesRestClient.GetGraph(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new GraphResourceGetResultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new GraphResourceGetResultCreateOrUpdateContent(current.Location, current.Resource); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags[key] = value; - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The set of tags to use as replacement. - /// The cancellation token to use. - /// is null. - public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(tags, nameof(tags)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultResource.SetTags"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues.ReplaceWith(tags); - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _graphResourceGetResultGraphResourcesRestClient.GetGraphAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new GraphResourceGetResultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new GraphResourceGetResultCreateOrUpdateContent(current.Location, current.Resource); - patch.Tags.ReplaceWith(tags); - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The set of tags to use as replacement. - /// The cancellation token to use. - /// is null. - public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(tags, nameof(tags)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultResource.SetTags"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues.ReplaceWith(tags); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _graphResourceGetResultGraphResourcesRestClient.GetGraph(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new GraphResourceGetResultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new GraphResourceGetResultCreateOrUpdateContent(current.Location, current.Resource); - patch.Tags.ReplaceWith(tags); - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The cancellation token to use. - /// is null. - public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultResource.RemoveTag"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues.Remove(key); - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _graphResourceGetResultGraphResourcesRestClient.GetGraphAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new GraphResourceGetResultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new GraphResourceGetResultCreateOrUpdateContent(current.Location, current.Resource); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags.Remove(key); - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The cancellation token to use. - /// is null. - public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultResource.RemoveTag"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues.Remove(key); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _graphResourceGetResultGraphResourcesRestClient.GetGraph(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new GraphResourceGetResultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new GraphResourceGetResultCreateOrUpdateContent(current.Location, current.Resource); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags.Remove(key); - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseCollection.cs index d4f289dcf02e..76350991e811 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateA /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wa /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string dat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string databaseName, Cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(CancellationTo /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string databaseName, Cance /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string databaseName, CancellationToken canc /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExists /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseData.Serialization.cs index 14949bb6f7b6..c682de422ba2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseData.Serialization.cs @@ -30,12 +30,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -120,7 +114,6 @@ internal static GremlinDatabaseData DeserializeGremlinDatabaseData(JsonElement e { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -133,16 +126,6 @@ internal static GremlinDatabaseData DeserializeGremlinDatabaseData(JsonElement e Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -231,7 +214,6 @@ internal static GremlinDatabaseData DeserializeGremlinDatabaseData(JsonElement e location, resource, options0, - identity, serializedAdditionalRawData); } @@ -318,21 +300,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseData.cs index 7c1234e5de4d..98733e89aa61 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseData.cs @@ -66,13 +66,11 @@ public GremlinDatabaseData(AzureLocation location) : base(location) /// The location. /// /// - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal GremlinDatabaseData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedGremlinDatabaseResourceInfo resource, GremlinDatabasePropertiesConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal GremlinDatabaseData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedGremlinDatabaseResourceInfo resource, GremlinDatabasePropertiesConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -87,8 +85,5 @@ internal GremlinDatabaseData() /// Gets or sets the options. [WirePath("properties.options")] public GremlinDatabasePropertiesConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseResource.cs index a4eea9996c9e..c5bda2c00d5b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseResource.cs @@ -117,7 +117,7 @@ public virtual GremlinGraphCollection GetGremlinGraphs() /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -148,7 +148,7 @@ public virtual async Task> GetGremlinGraphAsync(s /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -179,7 +179,7 @@ public virtual Response GetGremlinGraph(string graphName, /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -219,7 +219,7 @@ public virtual async Task> GetAsync(Cancellati /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -259,7 +259,7 @@ public virtual Response Get(CancellationToken cancellat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -301,7 +301,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -343,7 +343,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -389,7 +389,7 @@ public virtual async Task> UpdateAsync(Wai /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -435,7 +435,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -497,7 +497,7 @@ public virtual async Task> AddTagAsync(string /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -559,7 +559,7 @@ public virtual Response AddTag(string key, string value /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -616,7 +616,7 @@ public virtual async Task> SetTagsAsync(IDicti /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -673,7 +673,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -733,7 +733,7 @@ public virtual async Task> RemoveTagAsync(stri /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseThroughputSettingResource.cs index d9eccd4d38d9..52ae27c637f2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseThroughputSettingResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(Cancellati /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -229,7 +229,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation CreateOrUp /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -317,7 +317,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation MigrateGre /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -401,7 +401,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual ArmOperation MigrateGre /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -505,7 +505,7 @@ public virtual async Task> Ad /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -567,7 +567,7 @@ public virtual Response AddTag(string /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -624,7 +624,7 @@ public virtual async Task> Se /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -681,7 +681,7 @@ public virtual Response SetTags(IDicti /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -741,7 +741,7 @@ public virtual async Task> Re /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphCollection.cs index d4ad9be40192..939ab4bdebcf 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateAsyn /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitU /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string graphN /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string graphName, Cancellation /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToken /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken cancellat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string graphName, Cancella /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string graphName, CancellationToken cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExistsAsy /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphData.Serialization.cs index 21dac0e3f4ae..1c87083a074a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphData.Serialization.cs @@ -30,12 +30,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -120,7 +114,6 @@ internal static GremlinGraphData DeserializeGremlinGraphData(JsonElement element { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -133,16 +126,6 @@ internal static GremlinGraphData DeserializeGremlinGraphData(JsonElement element Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -231,7 +214,6 @@ internal static GremlinGraphData DeserializeGremlinGraphData(JsonElement element location, resource, options0, - identity, serializedAdditionalRawData); } @@ -318,21 +300,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphData.cs index 777952f74990..6b4043d8f297 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphData.cs @@ -66,13 +66,11 @@ public GremlinGraphData(AzureLocation location) : base(location) /// The location. /// /// - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal GremlinGraphData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedGremlinGraphResourceInfo resource, GremlinGraphPropertiesConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal GremlinGraphData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedGremlinGraphResourceInfo resource, GremlinGraphPropertiesConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -87,8 +85,5 @@ internal GremlinGraphData() /// Gets or sets the options. [WirePath("properties.options")] public GremlinGraphPropertiesConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphResource.cs index ae2f9830c994..bc5b7e142746 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphResource.cs @@ -111,7 +111,7 @@ public virtual GremlinGraphThroughputSettingResource GetGremlinGraphThroughputSe /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -151,7 +151,7 @@ public virtual async Task> GetAsync(CancellationT /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -191,7 +191,7 @@ public virtual Response Get(CancellationToken cancellation /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -233,7 +233,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -321,7 +321,7 @@ public virtual async Task> UpdateAsync(WaitUn /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -367,7 +367,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, Gr /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -413,7 +413,7 @@ public virtual async Task> RetrieveConti /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -459,7 +459,7 @@ public virtual ArmOperation RetrieveContinuousBackupI /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -521,7 +521,7 @@ public virtual async Task> AddTagAsync(string key /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -583,7 +583,7 @@ public virtual Response AddTag(string key, string value, C /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -640,7 +640,7 @@ public virtual async Task> SetTagsAsync(IDictiona /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -697,7 +697,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -757,7 +757,7 @@ public virtual async Task> RemoveTagAsync(string /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphThroughputSettingResource.cs index 6373bf94d35f..25f22f72facc 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphThroughputSettingResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> GetAs /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(CancellationT /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -230,7 +230,7 @@ public virtual async Task> C /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -276,7 +276,7 @@ public virtual ArmOperation CreateOrUpdat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -318,7 +318,7 @@ public virtual async Task> M /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -360,7 +360,7 @@ public virtual ArmOperation MigrateGremli /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -402,7 +402,7 @@ public virtual async Task> M /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -444,7 +444,7 @@ public virtual ArmOperation MigrateGremli /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -506,7 +506,7 @@ public virtual async Task> AddTa /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -568,7 +568,7 @@ public virtual Response AddTag(string key /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -625,7 +625,7 @@ public virtual async Task> SetTa /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -682,7 +682,7 @@ public virtual Response SetTags(IDictiona /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -742,7 +742,7 @@ public virtual async Task> Remov /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraKeyspaceThroughputSettingOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraKeyspaceThroughputSettingOperationSource.cs index 3ad5ec571757..9f3dddd96e94 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraKeyspaceThroughputSettingOperationSource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraKeyspaceThroughputSettingOperationSource.cs @@ -62,7 +62,6 @@ private ThroughputSettingData ScrubId(ThroughputSettingData data) data.Tags, data.Location, data.Resource, - data.Identity, null); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraTableThroughputSettingOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraTableThroughputSettingOperationSource.cs index 7edc805329e2..21361edbd316 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraTableThroughputSettingOperationSource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraTableThroughputSettingOperationSource.cs @@ -64,7 +64,6 @@ private ThroughputSettingData ScrubId(ThroughputSettingData data) data.Tags, data.Location, data.Resource, - data.Identity, null); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraViewGetResultOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraViewGetResultOperationSource.cs deleted file mode 100644 index 70a5c5bfecd8..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraViewGetResultOperationSource.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB -{ - internal class CassandraViewGetResultOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal CassandraViewGetResultOperationSource(ArmClient client) - { - _client = client; - } - - CassandraViewGetResultResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = CassandraViewGetResultData.DeserializeCassandraViewGetResultData(document.RootElement); - return new CassandraViewGetResultResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = CassandraViewGetResultData.DeserializeCassandraViewGetResultData(document.RootElement); - return new CassandraViewGetResultResource(_client, data); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraViewThroughputSettingOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraViewThroughputSettingOperationSource.cs deleted file mode 100644 index 1394eb087f80..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraViewThroughputSettingOperationSource.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB -{ - internal class CassandraViewThroughputSettingOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal CassandraViewThroughputSettingOperationSource(ArmClient client) - { - _client = client; - } - - CassandraViewThroughputSettingResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = ThroughputSettingData.DeserializeThroughputSettingData(document.RootElement); - return new CassandraViewThroughputSettingResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = ThroughputSettingData.DeserializeThroughputSettingData(document.RootElement); - return new CassandraViewThroughputSettingResource(_client, data); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBSqlContainerThroughputSettingOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBSqlContainerThroughputSettingOperationSource.cs index af9245a5fb97..f492aadeb1d3 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBSqlContainerThroughputSettingOperationSource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBSqlContainerThroughputSettingOperationSource.cs @@ -64,7 +64,6 @@ private ThroughputSettingData ScrubId(ThroughputSettingData data) data.Tags, data.Location, data.Resource, - data.Identity, null); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBSqlDatabaseThroughputSettingOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBSqlDatabaseThroughputSettingOperationSource.cs index 0fe23f1c89bc..33bd0f9f59dd 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBSqlDatabaseThroughputSettingOperationSource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBSqlDatabaseThroughputSettingOperationSource.cs @@ -62,7 +62,6 @@ private ThroughputSettingData ScrubId(ThroughputSettingData data) data.Tags, data.Location, data.Resource, - data.Identity, null); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBThroughputPoolAccountOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBThroughputPoolAccountOperationSource.cs deleted file mode 100644 index 30abec784760..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBThroughputPoolAccountOperationSource.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB -{ - internal class CosmosDBThroughputPoolAccountOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal CosmosDBThroughputPoolAccountOperationSource(ArmClient client) - { - _client = client; - } - - CosmosDBThroughputPoolAccountResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = CosmosDBThroughputPoolAccountData.DeserializeCosmosDBThroughputPoolAccountData(document.RootElement); - return new CosmosDBThroughputPoolAccountResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = CosmosDBThroughputPoolAccountData.DeserializeCosmosDBThroughputPoolAccountData(document.RootElement); - return new CosmosDBThroughputPoolAccountResource(_client, data); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBThroughputPoolOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBThroughputPoolOperationSource.cs deleted file mode 100644 index a6ce37b70457..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBThroughputPoolOperationSource.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB -{ - internal class CosmosDBThroughputPoolOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal CosmosDBThroughputPoolOperationSource(ArmClient client) - { - _client = client; - } - - CosmosDBThroughputPoolResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = CosmosDBThroughputPoolData.DeserializeCosmosDBThroughputPoolData(document.RootElement); - return new CosmosDBThroughputPoolResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = CosmosDBThroughputPoolData.DeserializeCosmosDBThroughputPoolData(document.RootElement); - return new CosmosDBThroughputPoolResource(_client, data); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosTableThroughputSettingOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosTableThroughputSettingOperationSource.cs index 0e5c9833df92..3795d6f36e70 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosTableThroughputSettingOperationSource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosTableThroughputSettingOperationSource.cs @@ -62,7 +62,6 @@ private ThroughputSettingData ScrubId(ThroughputSettingData data) data.Tags, data.Location, data.Resource, - data.Identity, null); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GraphResourceGetResultOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GraphResourceGetResultOperationSource.cs deleted file mode 100644 index 6c63eaa3b485..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GraphResourceGetResultOperationSource.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB -{ - internal class GraphResourceGetResultOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal GraphResourceGetResultOperationSource(ArmClient client) - { - _client = client; - } - - GraphResourceGetResultResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = GraphResourceGetResultData.DeserializeGraphResourceGetResultData(document.RootElement); - return new GraphResourceGetResultResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = GraphResourceGetResultData.DeserializeGraphResourceGetResultData(document.RootElement); - return new GraphResourceGetResultResource(_client, data); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GremlinDatabaseThroughputSettingOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GremlinDatabaseThroughputSettingOperationSource.cs index 7b1093b43f5e..3edf9d05727d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GremlinDatabaseThroughputSettingOperationSource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GremlinDatabaseThroughputSettingOperationSource.cs @@ -62,7 +62,6 @@ private ThroughputSettingData ScrubId(ThroughputSettingData data) data.Tags, data.Location, data.Resource, - data.Identity, null); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GremlinGraphThroughputSettingOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GremlinGraphThroughputSettingOperationSource.cs index b1f6eaa5b4bf..b67f22dee77a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GremlinGraphThroughputSettingOperationSource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GremlinGraphThroughputSettingOperationSource.cs @@ -64,7 +64,6 @@ private ThroughputSettingData ScrubId(ThroughputSettingData data) data.Tags, data.Location, data.Resource, - data.Identity, null); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/MongoDBCollectionThroughputSettingOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/MongoDBCollectionThroughputSettingOperationSource.cs index ba0caf7dfd63..e74999f5c334 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/MongoDBCollectionThroughputSettingOperationSource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/MongoDBCollectionThroughputSettingOperationSource.cs @@ -64,7 +64,6 @@ private ThroughputSettingData ScrubId(ThroughputSettingData data) data.Tags, data.Location, data.Resource, - data.Identity, null); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/MongoDBDatabaseThroughputSettingOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/MongoDBDatabaseThroughputSettingOperationSource.cs index 4c5eab41e545..7e20cabb630a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/MongoDBDatabaseThroughputSettingOperationSource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/MongoDBDatabaseThroughputSettingOperationSource.cs @@ -62,7 +62,6 @@ private ThroughputSettingData ScrubId(ThroughputSettingData data) data.Tags, data.Location, data.Resource, - data.Identity, null); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/PhysicalPartitionStorageInfoCollectionOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/PhysicalPartitionStorageInfoCollectionOperationSource.cs deleted file mode 100644 index e78c5f9955ed..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/PhysicalPartitionStorageInfoCollectionOperationSource.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - internal class PhysicalPartitionStorageInfoCollectionOperationSource : IOperationSource - { - PhysicalPartitionStorageInfoCollection IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - return PhysicalPartitionStorageInfoCollection.DeserializePhysicalPartitionStorageInfoCollection(document.RootElement); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - return PhysicalPartitionStorageInfoCollection.DeserializePhysicalPartitionStorageInfoCollection(document.RootElement); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/PhysicalPartitionThroughputInfoResultOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/PhysicalPartitionThroughputInfoResultOperationSource.cs deleted file mode 100644 index bcda0825749f..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/PhysicalPartitionThroughputInfoResultOperationSource.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - internal class PhysicalPartitionThroughputInfoResultOperationSource : IOperationSource - { - PhysicalPartitionThroughputInfoResult IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - return PhysicalPartitionThroughputInfoResult.DeserializePhysicalPartitionThroughputInfoResult(document.RootElement); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - return PhysicalPartitionThroughputInfoResult.DeserializePhysicalPartitionThroughputInfoResult(document.RootElement); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRule.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRule.Serialization.cs deleted file mode 100644 index c92851b175a9..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRule.Serialization.cs +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class AccessRule : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AccessRule)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (Optional.IsDefined(Properties)) - { - writer.WritePropertyName("properties"u8); - writer.WriteObjectValue(Properties, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - AccessRule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AccessRule)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAccessRule(document.RootElement, options); - } - - internal static AccessRule DeserializeAccessRule(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string name = default; - AccessRuleProperties properties = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - properties = AccessRuleProperties.DeserializeAccessRuleProperties(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new AccessRule(name, properties, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Properties), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" properties: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Properties)) - { - builder.Append(" properties: "); - BicepSerializationHelpers.AppendChildObject(builder, Properties, options, 2, false, " properties: "); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(AccessRule)} does not support writing '{options.Format}' format."); - } - } - - AccessRule IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAccessRule(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(AccessRule)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRuleDirection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRuleDirection.cs deleted file mode 100644 index 9b80de2aaf33..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRuleDirection.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Direction of Access Rule. - public readonly partial struct AccessRuleDirection : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public AccessRuleDirection(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string InboundValue = "Inbound"; - private const string OutboundValue = "Outbound"; - - /// Applies to inbound network traffic to the secured resources. - public static AccessRuleDirection Inbound { get; } = new AccessRuleDirection(InboundValue); - /// Applies to outbound network traffic from the secured resources. - public static AccessRuleDirection Outbound { get; } = new AccessRuleDirection(OutboundValue); - /// Determines if two values are the same. - public static bool operator ==(AccessRuleDirection left, AccessRuleDirection right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(AccessRuleDirection left, AccessRuleDirection right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator AccessRuleDirection(string value) => new AccessRuleDirection(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is AccessRuleDirection other && Equals(other); - /// - public bool Equals(AccessRuleDirection other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRuleProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRuleProperties.Serialization.cs deleted file mode 100644 index cd897a3892f0..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRuleProperties.Serialization.cs +++ /dev/null @@ -1,509 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class AccessRuleProperties : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AccessRuleProperties)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Direction)) - { - writer.WritePropertyName("direction"u8); - writer.WriteStringValue(Direction.Value.ToString()); - } - if (Optional.IsCollectionDefined(AddressPrefixes)) - { - writer.WritePropertyName("addressPrefixes"u8); - writer.WriteStartArray(); - foreach (var item in AddressPrefixes) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(Subscriptions)) - { - writer.WritePropertyName("subscriptions"u8); - writer.WriteStartArray(); - foreach (var item in Subscriptions) - { - JsonSerializer.Serialize(writer, item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(NetworkSecurityPerimeters)) - { - writer.WritePropertyName("networkSecurityPerimeters"u8); - writer.WriteStartArray(); - foreach (var item in NetworkSecurityPerimeters) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(FullyQualifiedDomainNames)) - { - writer.WritePropertyName("fullyQualifiedDomainNames"u8); - writer.WriteStartArray(); - foreach (var item in FullyQualifiedDomainNames) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(EmailAddresses)) - { - writer.WritePropertyName("emailAddresses"u8); - writer.WriteStartArray(); - foreach (var item in EmailAddresses) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(PhoneNumbers)) - { - writer.WritePropertyName("phoneNumbers"u8); - writer.WriteStartArray(); - foreach (var item in PhoneNumbers) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - AccessRuleProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AccessRuleProperties)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAccessRuleProperties(document.RootElement, options); - } - - internal static AccessRuleProperties DeserializeAccessRuleProperties(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - AccessRuleDirection? direction = default; - IList addressPrefixes = default; - IList subscriptions = default; - IList networkSecurityPerimeters = default; - IList fullyQualifiedDomainNames = default; - IList emailAddresses = default; - IList phoneNumbers = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("direction"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - direction = new AccessRuleDirection(property.Value.GetString()); - continue; - } - if (property.NameEquals("addressPrefixes"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - addressPrefixes = array; - continue; - } - if (property.NameEquals("subscriptions"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(JsonSerializer.Deserialize(item.GetRawText())); - } - subscriptions = array; - continue; - } - if (property.NameEquals("networkSecurityPerimeters"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(NetworkSecurityPerimeter.DeserializeNetworkSecurityPerimeter(item, options)); - } - networkSecurityPerimeters = array; - continue; - } - if (property.NameEquals("fullyQualifiedDomainNames"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - fullyQualifiedDomainNames = array; - continue; - } - if (property.NameEquals("emailAddresses"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - emailAddresses = array; - continue; - } - if (property.NameEquals("phoneNumbers"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - phoneNumbers = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new AccessRuleProperties( - direction, - addressPrefixes ?? new ChangeTrackingList(), - subscriptions ?? new ChangeTrackingList(), - networkSecurityPerimeters ?? new ChangeTrackingList(), - fullyQualifiedDomainNames ?? new ChangeTrackingList(), - emailAddresses ?? new ChangeTrackingList(), - phoneNumbers ?? new ChangeTrackingList(), - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Direction), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" direction: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Direction)) - { - builder.Append(" direction: "); - builder.AppendLine($"'{Direction.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AddressPrefixes), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" addressPrefixes: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(AddressPrefixes)) - { - if (AddressPrefixes.Any()) - { - builder.Append(" addressPrefixes: "); - builder.AppendLine("["); - foreach (var item in AddressPrefixes) - { - if (item == null) - { - builder.Append("null"); - continue; - } - if (item.Contains(Environment.NewLine)) - { - builder.AppendLine(" '''"); - builder.AppendLine($"{item}'''"); - } - else - { - builder.AppendLine($" '{item}'"); - } - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Subscriptions), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" subscriptions: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Subscriptions)) - { - if (Subscriptions.Any()) - { - builder.Append(" subscriptions: "); - builder.AppendLine("["); - foreach (var item in Subscriptions) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " subscriptions: "); - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NetworkSecurityPerimeters), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" networkSecurityPerimeters: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(NetworkSecurityPerimeters)) - { - if (NetworkSecurityPerimeters.Any()) - { - builder.Append(" networkSecurityPerimeters: "); - builder.AppendLine("["); - foreach (var item in NetworkSecurityPerimeters) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " networkSecurityPerimeters: "); - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(FullyQualifiedDomainNames), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" fullyQualifiedDomainNames: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(FullyQualifiedDomainNames)) - { - if (FullyQualifiedDomainNames.Any()) - { - builder.Append(" fullyQualifiedDomainNames: "); - builder.AppendLine("["); - foreach (var item in FullyQualifiedDomainNames) - { - if (item == null) - { - builder.Append("null"); - continue; - } - if (item.Contains(Environment.NewLine)) - { - builder.AppendLine(" '''"); - builder.AppendLine($"{item}'''"); - } - else - { - builder.AppendLine($" '{item}'"); - } - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EmailAddresses), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" emailAddresses: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(EmailAddresses)) - { - if (EmailAddresses.Any()) - { - builder.Append(" emailAddresses: "); - builder.AppendLine("["); - foreach (var item in EmailAddresses) - { - if (item == null) - { - builder.Append("null"); - continue; - } - if (item.Contains(Environment.NewLine)) - { - builder.AppendLine(" '''"); - builder.AppendLine($"{item}'''"); - } - else - { - builder.AppendLine($" '{item}'"); - } - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PhoneNumbers), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" phoneNumbers: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(PhoneNumbers)) - { - if (PhoneNumbers.Any()) - { - builder.Append(" phoneNumbers: "); - builder.AppendLine("["); - foreach (var item in PhoneNumbers) - { - if (item == null) - { - builder.Append("null"); - continue; - } - if (item.Contains(Environment.NewLine)) - { - builder.AppendLine(" '''"); - builder.AppendLine($"{item}'''"); - } - else - { - builder.AppendLine($" '{item}'"); - } - } - builder.AppendLine(" ]"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(AccessRuleProperties)} does not support writing '{options.Format}' format."); - } - } - - AccessRuleProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAccessRuleProperties(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(AccessRuleProperties)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRuleProperties.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRuleProperties.cs deleted file mode 100644 index 5f258218ce35..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRuleProperties.cs +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Properties of Access Rule. - public partial class AccessRuleProperties - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public AccessRuleProperties() - { - AddressPrefixes = new ChangeTrackingList(); - Subscriptions = new ChangeTrackingList(); - NetworkSecurityPerimeters = new ChangeTrackingList(); - FullyQualifiedDomainNames = new ChangeTrackingList(); - EmailAddresses = new ChangeTrackingList(); - PhoneNumbers = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Direction of Access Rule. - /// Address prefixes in the CIDR format for inbound rules. - /// Subscriptions for inbound rules. - /// Network security perimeters for inbound rules. - /// Fully qualified domain names (FQDN) for outbound rules. - /// Email addresses for outbound rules. - /// Phone numbers for outbound rules. - /// Keeps track of any properties unknown to the library. - internal AccessRuleProperties(AccessRuleDirection? direction, IList addressPrefixes, IList subscriptions, IList networkSecurityPerimeters, IList fullyQualifiedDomainNames, IList emailAddresses, IList phoneNumbers, IDictionary serializedAdditionalRawData) - { - Direction = direction; - AddressPrefixes = addressPrefixes; - Subscriptions = subscriptions; - NetworkSecurityPerimeters = networkSecurityPerimeters; - FullyQualifiedDomainNames = fullyQualifiedDomainNames; - EmailAddresses = emailAddresses; - PhoneNumbers = phoneNumbers; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Direction of Access Rule. - [WirePath("direction")] - public AccessRuleDirection? Direction { get; set; } - /// Address prefixes in the CIDR format for inbound rules. - [WirePath("addressPrefixes")] - public IList AddressPrefixes { get; } - /// Subscriptions for inbound rules. - [WirePath("subscriptions")] - public IList Subscriptions { get; } - /// Network security perimeters for inbound rules. - [WirePath("networkSecurityPerimeters")] - public IList NetworkSecurityPerimeters { get; } - /// Fully qualified domain names (FQDN) for outbound rules. - [WirePath("fullyQualifiedDomainNames")] - public IList FullyQualifiedDomainNames { get; } - /// Email addresses for outbound rules. - [WirePath("emailAddresses")] - public IList EmailAddresses { get; } - /// Phone numbers for outbound rules. - [WirePath("phoneNumbers")] - public IList PhoneNumbers { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ApiProperties.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ApiProperties.cs index e9dee759a0bf..a2a3c4a80813 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ApiProperties.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ApiProperties.cs @@ -51,7 +51,7 @@ public ApiProperties() } /// Initializes a new instance of . - /// Describes the ServerVersion of an a MongoDB account. + /// Describes the version of the MongoDB account. /// Keeps track of any properties unknown to the library. internal ApiProperties(CosmosDBServerVersion? serverVersion, IDictionary serializedAdditionalRawData) { @@ -59,7 +59,7 @@ internal ApiProperties(CosmosDBServerVersion? serverVersion, IDictionary Describes the ServerVersion of an a MongoDB account. + /// Describes the version of the MongoDB account. [WirePath("serverVersion")] public CosmosDBServerVersion? ServerVersion { get; set; } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AzureBlobDataTransferDataSourceSink.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AzureBlobDataTransferDataSourceSink.Serialization.cs deleted file mode 100644 index a7dfdd43049e..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AzureBlobDataTransferDataSourceSink.Serialization.cs +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class AzureBlobDataTransferDataSourceSink : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AzureBlobDataTransferDataSourceSink)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("containerName"u8); - writer.WriteStringValue(ContainerName); - if (Optional.IsDefined(EndpointUri)) - { - writer.WritePropertyName("endpointUrl"u8); - writer.WriteStringValue(EndpointUri.AbsoluteUri); - } - writer.WritePropertyName("component"u8); - writer.WriteStringValue(Component.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - AzureBlobDataTransferDataSourceSink IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AzureBlobDataTransferDataSourceSink)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAzureBlobDataTransferDataSourceSink(document.RootElement, options); - } - - internal static AzureBlobDataTransferDataSourceSink DeserializeAzureBlobDataTransferDataSourceSink(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string containerName = default; - Uri endpointUrl = default; - DataTransferComponent component = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("containerName"u8)) - { - containerName = property.Value.GetString(); - continue; - } - if (property.NameEquals("endpointUrl"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - endpointUrl = new Uri(property.Value.GetString()); - continue; - } - if (property.NameEquals("component"u8)) - { - component = new DataTransferComponent(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new AzureBlobDataTransferDataSourceSink(component, serializedAdditionalRawData, containerName, endpointUrl); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ContainerName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" containerName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ContainerName)) - { - builder.Append(" containerName: "); - if (ContainerName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{ContainerName}'''"); - } - else - { - builder.AppendLine($"'{ContainerName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EndpointUri), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" endpointUrl: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(EndpointUri)) - { - builder.Append(" endpointUrl: "); - builder.AppendLine($"'{EndpointUri.AbsoluteUri}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Component), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" component: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" component: "); - builder.AppendLine($"'{Component.ToString()}'"); - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(AzureBlobDataTransferDataSourceSink)} does not support writing '{options.Format}' format."); - } - } - - AzureBlobDataTransferDataSourceSink IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAzureBlobDataTransferDataSourceSink(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(AzureBlobDataTransferDataSourceSink)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AzureBlobDataTransferDataSourceSink.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AzureBlobDataTransferDataSourceSink.cs deleted file mode 100644 index 0beca6426b11..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AzureBlobDataTransferDataSourceSink.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// An Azure Blob Storage data source/sink. - public partial class AzureBlobDataTransferDataSourceSink : DataTransferDataSourceSink - { - /// Initializes a new instance of . - /// - /// is null. - public AzureBlobDataTransferDataSourceSink(string containerName) - { - Argument.AssertNotNull(containerName, nameof(containerName)); - - ContainerName = containerName; - Component = DataTransferComponent.AzureBlobStorage; - } - - /// Initializes a new instance of . - /// - /// Keeps track of any properties unknown to the library. - /// - /// - internal AzureBlobDataTransferDataSourceSink(DataTransferComponent component, IDictionary serializedAdditionalRawData, string containerName, Uri endpointUri) : base(component, serializedAdditionalRawData) - { - ContainerName = containerName; - EndpointUri = endpointUri; - Component = component; - } - - /// Initializes a new instance of for deserialization. - internal AzureBlobDataTransferDataSourceSink() - { - } - - /// Gets or sets the container name. - [WirePath("containerName")] - public string ContainerName { get; set; } - /// Gets or sets the endpoint uri. - [WirePath("endpointUrl")] - public Uri EndpointUri { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BaseCosmosDataTransferDataSourceSink.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BaseCosmosDataTransferDataSourceSink.Serialization.cs deleted file mode 100644 index 45fe531a8667..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BaseCosmosDataTransferDataSourceSink.Serialization.cs +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class BaseCosmosDataTransferDataSourceSink : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(BaseCosmosDataTransferDataSourceSink)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(RemoteAccountName)) - { - writer.WritePropertyName("remoteAccountName"u8); - writer.WriteStringValue(RemoteAccountName); - } - writer.WritePropertyName("component"u8); - writer.WriteStringValue(Component.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - BaseCosmosDataTransferDataSourceSink IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(BaseCosmosDataTransferDataSourceSink)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeBaseCosmosDataTransferDataSourceSink(document.RootElement, options); - } - - internal static BaseCosmosDataTransferDataSourceSink DeserializeBaseCosmosDataTransferDataSourceSink(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("component", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "CosmosDBCassandra": return CosmosCassandraDataTransferDataSourceSink.DeserializeCosmosCassandraDataTransferDataSourceSink(element, options); - case "CosmosDBMongo": return CosmosMongoDataTransferDataSourceSink.DeserializeCosmosMongoDataTransferDataSourceSink(element, options); - case "CosmosDBSql": return CosmosSqlDataTransferDataSourceSink.DeserializeCosmosSqlDataTransferDataSourceSink(element, options); - } - } - string remoteAccountName = default; - DataTransferComponent component = "BaseCosmosDataTransferDataSourceSink"; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("remoteAccountName"u8)) - { - remoteAccountName = property.Value.GetString(); - continue; - } - if (property.NameEquals("component"u8)) - { - component = new DataTransferComponent(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new BaseCosmosDataTransferDataSourceSink(component, serializedAdditionalRawData, remoteAccountName); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RemoteAccountName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" remoteAccountName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(RemoteAccountName)) - { - builder.Append(" remoteAccountName: "); - if (RemoteAccountName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{RemoteAccountName}'''"); - } - else - { - builder.AppendLine($"'{RemoteAccountName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Component), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" component: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" component: "); - builder.AppendLine($"'{Component.ToString()}'"); - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(BaseCosmosDataTransferDataSourceSink)} does not support writing '{options.Format}' format."); - } - } - - BaseCosmosDataTransferDataSourceSink IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeBaseCosmosDataTransferDataSourceSink(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(BaseCosmosDataTransferDataSourceSink)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BaseCosmosDataTransferDataSourceSink.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BaseCosmosDataTransferDataSourceSink.cs deleted file mode 100644 index 572917dec35e..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BaseCosmosDataTransferDataSourceSink.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// - /// A base CosmosDB data source/sink - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - public partial class BaseCosmosDataTransferDataSourceSink : DataTransferDataSourceSink - { - /// Initializes a new instance of . - public BaseCosmosDataTransferDataSourceSink() - { - Component = new DataTransferComponent("BaseCosmosDataTransferDataSourceSink"); - } - - /// Initializes a new instance of . - /// - /// Keeps track of any properties unknown to the library. - /// - internal BaseCosmosDataTransferDataSourceSink(DataTransferComponent component, IDictionary serializedAdditionalRawData, string remoteAccountName) : base(component, serializedAdditionalRawData) - { - RemoteAccountName = remoteAccountName; - Component = component; - } - - /// Gets or sets the remote account name. - [WirePath("remoteAccountName")] - public string RemoteAccountName { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityMode.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityMode.cs deleted file mode 100644 index affc5c9640ec..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityMode.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Indicates the capacity mode of the account. - public readonly partial struct CapacityMode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public CapacityMode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string NoneValue = "None"; - private const string ProvisionedValue = "Provisioned"; - private const string ServerlessValue = "Serverless"; - - /// None. - public static CapacityMode None { get; } = new CapacityMode(NoneValue); - /// Provisioned. - public static CapacityMode Provisioned { get; } = new CapacityMode(ProvisionedValue); - /// Serverless. - public static CapacityMode Serverless { get; } = new CapacityMode(ServerlessValue); - /// Determines if two values are the same. - public static bool operator ==(CapacityMode left, CapacityMode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(CapacityMode left, CapacityMode right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator CapacityMode(string value) => new CapacityMode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is CapacityMode other && Equals(other); - /// - public bool Equals(CapacityMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityModeChangeTransitionState.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityModeChangeTransitionState.Serialization.cs deleted file mode 100644 index db4ddb606122..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityModeChangeTransitionState.Serialization.cs +++ /dev/null @@ -1,319 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CapacityModeChangeTransitionState : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CapacityModeChangeTransitionState)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(CapacityModeTransitionStatus)) - { - writer.WritePropertyName("capacityModeTransitionStatus"u8); - writer.WriteStringValue(CapacityModeTransitionStatus.Value.ToString()); - } - if (Optional.IsDefined(CurrentCapacityMode)) - { - writer.WritePropertyName("currentCapacityMode"u8); - writer.WriteStringValue(CurrentCapacityMode.Value.ToString()); - } - if (Optional.IsDefined(PreviousCapacityMode)) - { - writer.WritePropertyName("previousCapacityMode"u8); - writer.WriteStringValue(PreviousCapacityMode.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(CapacityModeTransitionBeginTimestamp)) - { - writer.WritePropertyName("capacityModeTransitionBeginTimestamp"u8); - writer.WriteStringValue(CapacityModeTransitionBeginTimestamp.Value, "O"); - } - if (options.Format != "W" && Optional.IsDefined(CapacityModeTransitionEndTimestamp)) - { - writer.WritePropertyName("capacityModeTransitionEndTimestamp"u8); - writer.WriteStringValue(CapacityModeTransitionEndTimestamp.Value, "O"); - } - if (options.Format != "W" && Optional.IsDefined(CapacityModeLastSuccessfulTransitionEndTimestamp)) - { - writer.WritePropertyName("capacityModeLastSuccessfulTransitionEndTimestamp"u8); - writer.WriteStringValue(CapacityModeLastSuccessfulTransitionEndTimestamp.Value, "O"); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - CapacityModeChangeTransitionState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CapacityModeChangeTransitionState)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCapacityModeChangeTransitionState(document.RootElement, options); - } - - internal static CapacityModeChangeTransitionState DeserializeCapacityModeChangeTransitionState(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - CapacityModeTransitionStatus? capacityModeTransitionStatus = default; - CapacityMode? currentCapacityMode = default; - CapacityMode? previousCapacityMode = default; - DateTimeOffset? capacityModeTransitionBeginTimestamp = default; - DateTimeOffset? capacityModeTransitionEndTimestamp = default; - DateTimeOffset? capacityModeLastSuccessfulTransitionEndTimestamp = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("capacityModeTransitionStatus"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - capacityModeTransitionStatus = new CapacityModeTransitionStatus(property.Value.GetString()); - continue; - } - if (property.NameEquals("currentCapacityMode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - currentCapacityMode = new CapacityMode(property.Value.GetString()); - continue; - } - if (property.NameEquals("previousCapacityMode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - previousCapacityMode = new CapacityMode(property.Value.GetString()); - continue; - } - if (property.NameEquals("capacityModeTransitionBeginTimestamp"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - capacityModeTransitionBeginTimestamp = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("capacityModeTransitionEndTimestamp"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - capacityModeTransitionEndTimestamp = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("capacityModeLastSuccessfulTransitionEndTimestamp"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - capacityModeLastSuccessfulTransitionEndTimestamp = property.Value.GetDateTimeOffset("O"); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CapacityModeChangeTransitionState( - capacityModeTransitionStatus, - currentCapacityMode, - previousCapacityMode, - capacityModeTransitionBeginTimestamp, - capacityModeTransitionEndTimestamp, - capacityModeLastSuccessfulTransitionEndTimestamp, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CapacityModeTransitionStatus), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" capacityModeTransitionStatus: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(CapacityModeTransitionStatus)) - { - builder.Append(" capacityModeTransitionStatus: "); - builder.AppendLine($"'{CapacityModeTransitionStatus.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CurrentCapacityMode), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" currentCapacityMode: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(CurrentCapacityMode)) - { - builder.Append(" currentCapacityMode: "); - builder.AppendLine($"'{CurrentCapacityMode.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PreviousCapacityMode), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" previousCapacityMode: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(PreviousCapacityMode)) - { - builder.Append(" previousCapacityMode: "); - builder.AppendLine($"'{PreviousCapacityMode.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CapacityModeTransitionBeginTimestamp), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" capacityModeTransitionBeginTimestamp: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(CapacityModeTransitionBeginTimestamp)) - { - builder.Append(" capacityModeTransitionBeginTimestamp: "); - var formattedDateTimeString = TypeFormatters.ToString(CapacityModeTransitionBeginTimestamp.Value, "o"); - builder.AppendLine($"'{formattedDateTimeString}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CapacityModeTransitionEndTimestamp), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" capacityModeTransitionEndTimestamp: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(CapacityModeTransitionEndTimestamp)) - { - builder.Append(" capacityModeTransitionEndTimestamp: "); - var formattedDateTimeString = TypeFormatters.ToString(CapacityModeTransitionEndTimestamp.Value, "o"); - builder.AppendLine($"'{formattedDateTimeString}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CapacityModeLastSuccessfulTransitionEndTimestamp), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" capacityModeLastSuccessfulTransitionEndTimestamp: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(CapacityModeLastSuccessfulTransitionEndTimestamp)) - { - builder.Append(" capacityModeLastSuccessfulTransitionEndTimestamp: "); - var formattedDateTimeString = TypeFormatters.ToString(CapacityModeLastSuccessfulTransitionEndTimestamp.Value, "o"); - builder.AppendLine($"'{formattedDateTimeString}'"); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CapacityModeChangeTransitionState)} does not support writing '{options.Format}' format."); - } - } - - CapacityModeChangeTransitionState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCapacityModeChangeTransitionState(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CapacityModeChangeTransitionState)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityModeChangeTransitionState.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityModeChangeTransitionState.cs deleted file mode 100644 index d84fd207dee9..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityModeChangeTransitionState.cs +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The transition state information related capacity mode change with update request. - public partial class CapacityModeChangeTransitionState - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public CapacityModeChangeTransitionState() - { - } - - /// Initializes a new instance of . - /// The transition status of capacity mode. - /// Indicates the current capacity mode of the account. - /// Indicates the previous capacity mode of the account before successful transition. - /// Begin time in UTC of the capacity mode change. - /// End time in UTC of the capacity mode change. - /// End time in UTC of the last successful capacity mode change. - /// Keeps track of any properties unknown to the library. - internal CapacityModeChangeTransitionState(CapacityModeTransitionStatus? capacityModeTransitionStatus, CapacityMode? currentCapacityMode, CapacityMode? previousCapacityMode, DateTimeOffset? capacityModeTransitionBeginTimestamp, DateTimeOffset? capacityModeTransitionEndTimestamp, DateTimeOffset? capacityModeLastSuccessfulTransitionEndTimestamp, IDictionary serializedAdditionalRawData) - { - CapacityModeTransitionStatus = capacityModeTransitionStatus; - CurrentCapacityMode = currentCapacityMode; - PreviousCapacityMode = previousCapacityMode; - CapacityModeTransitionBeginTimestamp = capacityModeTransitionBeginTimestamp; - CapacityModeTransitionEndTimestamp = capacityModeTransitionEndTimestamp; - CapacityModeLastSuccessfulTransitionEndTimestamp = capacityModeLastSuccessfulTransitionEndTimestamp; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The transition status of capacity mode. - [WirePath("capacityModeTransitionStatus")] - public CapacityModeTransitionStatus? CapacityModeTransitionStatus { get; set; } - /// Indicates the current capacity mode of the account. - [WirePath("currentCapacityMode")] - public CapacityMode? CurrentCapacityMode { get; set; } - /// Indicates the previous capacity mode of the account before successful transition. - [WirePath("previousCapacityMode")] - public CapacityMode? PreviousCapacityMode { get; set; } - /// Begin time in UTC of the capacity mode change. - [WirePath("capacityModeTransitionBeginTimestamp")] - public DateTimeOffset? CapacityModeTransitionBeginTimestamp { get; } - /// End time in UTC of the capacity mode change. - [WirePath("capacityModeTransitionEndTimestamp")] - public DateTimeOffset? CapacityModeTransitionEndTimestamp { get; } - /// End time in UTC of the last successful capacity mode change. - [WirePath("capacityModeLastSuccessfulTransitionEndTimestamp")] - public DateTimeOffset? CapacityModeLastSuccessfulTransitionEndTimestamp { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityModeTransitionStatus.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityModeTransitionStatus.cs deleted file mode 100644 index 74d324b667c2..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityModeTransitionStatus.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The transition status of capacity mode. - public readonly partial struct CapacityModeTransitionStatus : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public CapacityModeTransitionStatus(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string InvalidValue = "Invalid"; - private const string InitializedValue = "Initialized"; - private const string InProgressValue = "InProgress"; - private const string CompletedValue = "Completed"; - private const string FailedValue = "Failed"; - - /// Invalid. - public static CapacityModeTransitionStatus Invalid { get; } = new CapacityModeTransitionStatus(InvalidValue); - /// Initialized. - public static CapacityModeTransitionStatus Initialized { get; } = new CapacityModeTransitionStatus(InitializedValue); - /// InProgress. - public static CapacityModeTransitionStatus InProgress { get; } = new CapacityModeTransitionStatus(InProgressValue); - /// Completed. - public static CapacityModeTransitionStatus Completed { get; } = new CapacityModeTransitionStatus(CompletedValue); - /// Failed. - public static CapacityModeTransitionStatus Failed { get; } = new CapacityModeTransitionStatus(FailedValue); - /// Determines if two values are the same. - public static bool operator ==(CapacityModeTransitionStatus left, CapacityModeTransitionStatus right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(CapacityModeTransitionStatus left, CapacityModeTransitionStatus right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator CapacityModeTransitionStatus(string value) => new CapacityModeTransitionStatus(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is CapacityModeTransitionStatus other && Equals(other); - /// - public bool Equals(CapacityModeTransitionStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraAutoReplicateForm.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraAutoReplicateForm.cs deleted file mode 100644 index 65b5bcce229d..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraAutoReplicateForm.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The form of AutoReplicate that is being used by this cluster. - public readonly partial struct CassandraAutoReplicateForm : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public CassandraAutoReplicateForm(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string NoneValue = "None"; - private const string SystemKeyspacesValue = "SystemKeyspaces"; - private const string AllKeyspacesValue = "AllKeyspaces"; - - /// None. - public static CassandraAutoReplicateForm None { get; } = new CassandraAutoReplicateForm(NoneValue); - /// SystemKeyspaces. - public static CassandraAutoReplicateForm SystemKeyspaces { get; } = new CassandraAutoReplicateForm(SystemKeyspacesValue); - /// AllKeyspaces. - public static CassandraAutoReplicateForm AllKeyspaces { get; } = new CassandraAutoReplicateForm(AllKeyspacesValue); - /// Determines if two values are the same. - public static bool operator ==(CassandraAutoReplicateForm left, CassandraAutoReplicateForm right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(CassandraAutoReplicateForm left, CassandraAutoReplicateForm right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator CassandraAutoReplicateForm(string value) => new CassandraAutoReplicateForm(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is CassandraAutoReplicateForm other && Equals(other); - /// - public bool Equals(CassandraAutoReplicateForm other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupResourceInfo.Serialization.cs deleted file mode 100644 index fa718e7abcd9..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupResourceInfo.Serialization.cs +++ /dev/null @@ -1,292 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CassandraClusterBackupResourceInfo : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraClusterBackupResourceInfo)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(BackupId)) - { - writer.WritePropertyName("backupId"u8); - writer.WriteStringValue(BackupId); - } - if (Optional.IsDefined(BackupState)) - { - writer.WritePropertyName("backupState"u8); - writer.WriteStringValue(BackupState.Value.ToString()); - } - if (Optional.IsDefined(BackupStartTimestamp)) - { - writer.WritePropertyName("backupStartTimestamp"u8); - writer.WriteStringValue(BackupStartTimestamp.Value, "O"); - } - if (Optional.IsDefined(BackupStopTimestamp)) - { - writer.WritePropertyName("backupStopTimestamp"u8); - writer.WriteStringValue(BackupStopTimestamp.Value, "O"); - } - if (Optional.IsDefined(BackupExpiryTimestamp)) - { - writer.WritePropertyName("backupExpiryTimestamp"u8); - writer.WriteStringValue(BackupExpiryTimestamp.Value, "O"); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - CassandraClusterBackupResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraClusterBackupResourceInfo)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCassandraClusterBackupResourceInfo(document.RootElement, options); - } - - internal static CassandraClusterBackupResourceInfo DeserializeCassandraClusterBackupResourceInfo(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string backupId = default; - CassandraClusterBackupState? backupState = default; - DateTimeOffset? backupStartTimestamp = default; - DateTimeOffset? backupStopTimestamp = default; - DateTimeOffset? backupExpiryTimestamp = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("backupId"u8)) - { - backupId = property.Value.GetString(); - continue; - } - if (property.NameEquals("backupState"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - backupState = new CassandraClusterBackupState(property.Value.GetString()); - continue; - } - if (property.NameEquals("backupStartTimestamp"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - backupStartTimestamp = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("backupStopTimestamp"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - backupStopTimestamp = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("backupExpiryTimestamp"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - backupExpiryTimestamp = property.Value.GetDateTimeOffset("O"); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CassandraClusterBackupResourceInfo( - backupId, - backupState, - backupStartTimestamp, - backupStopTimestamp, - backupExpiryTimestamp, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(BackupId), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" backupId: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(BackupId)) - { - builder.Append(" backupId: "); - if (BackupId.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{BackupId}'''"); - } - else - { - builder.AppendLine($"'{BackupId}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(BackupState), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" backupState: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(BackupState)) - { - builder.Append(" backupState: "); - builder.AppendLine($"'{BackupState.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(BackupStartTimestamp), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" backupStartTimestamp: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(BackupStartTimestamp)) - { - builder.Append(" backupStartTimestamp: "); - var formattedDateTimeString = TypeFormatters.ToString(BackupStartTimestamp.Value, "o"); - builder.AppendLine($"'{formattedDateTimeString}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(BackupStopTimestamp), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" backupStopTimestamp: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(BackupStopTimestamp)) - { - builder.Append(" backupStopTimestamp: "); - var formattedDateTimeString = TypeFormatters.ToString(BackupStopTimestamp.Value, "o"); - builder.AppendLine($"'{formattedDateTimeString}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(BackupExpiryTimestamp), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" backupExpiryTimestamp: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(BackupExpiryTimestamp)) - { - builder.Append(" backupExpiryTimestamp: "); - var formattedDateTimeString = TypeFormatters.ToString(BackupExpiryTimestamp.Value, "o"); - builder.AppendLine($"'{formattedDateTimeString}'"); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CassandraClusterBackupResourceInfo)} does not support writing '{options.Format}' format."); - } - } - - CassandraClusterBackupResourceInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCassandraClusterBackupResourceInfo(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CassandraClusterBackupResourceInfo)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupResourceInfo.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupResourceInfo.cs deleted file mode 100644 index 2fb86f9304e3..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupResourceInfo.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// A restorable backup of a Cassandra cluster. - public partial class CassandraClusterBackupResourceInfo - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal CassandraClusterBackupResourceInfo() - { - } - - /// Initializes a new instance of . - /// The unique identifier of backup. - /// The current state of the backup. - /// The time at which the backup process begins. - /// The time at which the backup process ends. - /// The time at which the backup will expire. - /// Keeps track of any properties unknown to the library. - internal CassandraClusterBackupResourceInfo(string backupId, CassandraClusterBackupState? backupState, DateTimeOffset? backupStartTimestamp, DateTimeOffset? backupStopTimestamp, DateTimeOffset? backupExpiryTimestamp, IDictionary serializedAdditionalRawData) - { - BackupId = backupId; - BackupState = backupState; - BackupStartTimestamp = backupStartTimestamp; - BackupStopTimestamp = backupStopTimestamp; - BackupExpiryTimestamp = backupExpiryTimestamp; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The unique identifier of backup. - [WirePath("backupId")] - public string BackupId { get; } - /// The current state of the backup. - [WirePath("backupState")] - public CassandraClusterBackupState? BackupState { get; } - /// The time at which the backup process begins. - [WirePath("backupStartTimestamp")] - public DateTimeOffset? BackupStartTimestamp { get; } - /// The time at which the backup process ends. - [WirePath("backupStopTimestamp")] - public DateTimeOffset? BackupStopTimestamp { get; } - /// The time at which the backup will expire. - [WirePath("backupExpiryTimestamp")] - public DateTimeOffset? BackupExpiryTimestamp { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupSchedule.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupSchedule.Serialization.cs deleted file mode 100644 index 5312824b9616..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupSchedule.Serialization.cs +++ /dev/null @@ -1,227 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CassandraClusterBackupSchedule : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraClusterBackupSchedule)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(ScheduleName)) - { - writer.WritePropertyName("scheduleName"u8); - writer.WriteStringValue(ScheduleName); - } - if (Optional.IsDefined(CronExpression)) - { - writer.WritePropertyName("cronExpression"u8); - writer.WriteStringValue(CronExpression); - } - if (Optional.IsDefined(RetentionInHours)) - { - writer.WritePropertyName("retentionInHours"u8); - writer.WriteNumberValue(RetentionInHours.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - CassandraClusterBackupSchedule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraClusterBackupSchedule)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCassandraClusterBackupSchedule(document.RootElement, options); - } - - internal static CassandraClusterBackupSchedule DeserializeCassandraClusterBackupSchedule(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string scheduleName = default; - string cronExpression = default; - int? retentionInHours = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("scheduleName"u8)) - { - scheduleName = property.Value.GetString(); - continue; - } - if (property.NameEquals("cronExpression"u8)) - { - cronExpression = property.Value.GetString(); - continue; - } - if (property.NameEquals("retentionInHours"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - retentionInHours = property.Value.GetInt32(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CassandraClusterBackupSchedule(scheduleName, cronExpression, retentionInHours, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ScheduleName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" scheduleName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ScheduleName)) - { - builder.Append(" scheduleName: "); - if (ScheduleName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{ScheduleName}'''"); - } - else - { - builder.AppendLine($"'{ScheduleName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CronExpression), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" cronExpression: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(CronExpression)) - { - builder.Append(" cronExpression: "); - if (CronExpression.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{CronExpression}'''"); - } - else - { - builder.AppendLine($"'{CronExpression}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RetentionInHours), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" retentionInHours: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(RetentionInHours)) - { - builder.Append(" retentionInHours: "); - builder.AppendLine($"{RetentionInHours.Value}"); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CassandraClusterBackupSchedule)} does not support writing '{options.Format}' format."); - } - } - - CassandraClusterBackupSchedule IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCassandraClusterBackupSchedule(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CassandraClusterBackupSchedule)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupState.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupState.cs deleted file mode 100644 index f6e8e382669b..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupState.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The current state of the backup. - public readonly partial struct CassandraClusterBackupState : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public CassandraClusterBackupState(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string InitiatedValue = "Initiated"; - private const string InProgressValue = "InProgress"; - private const string SucceededValue = "Succeeded"; - private const string FailedValue = "Failed"; - - /// Initiated. - public static CassandraClusterBackupState Initiated { get; } = new CassandraClusterBackupState(InitiatedValue); - /// InProgress. - public static CassandraClusterBackupState InProgress { get; } = new CassandraClusterBackupState(InProgressValue); - /// Succeeded. - public static CassandraClusterBackupState Succeeded { get; } = new CassandraClusterBackupState(SucceededValue); - /// Failed. - public static CassandraClusterBackupState Failed { get; } = new CassandraClusterBackupState(FailedValue); - /// Determines if two values are the same. - public static bool operator ==(CassandraClusterBackupState left, CassandraClusterBackupState right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(CassandraClusterBackupState left, CassandraClusterBackupState right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator CassandraClusterBackupState(string value) => new CassandraClusterBackupState(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is CassandraClusterBackupState other && Equals(other); - /// - public bool Equals(CassandraClusterBackupState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterCommand.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterCommand.Serialization.cs deleted file mode 100644 index f1401c33c3ed..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterCommand.Serialization.cs +++ /dev/null @@ -1,470 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CassandraClusterCommand : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraClusterCommand)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Command)) - { - writer.WritePropertyName("command"u8); - writer.WriteStringValue(Command); - } - if (Optional.IsDefined(CommandId)) - { - writer.WritePropertyName("commandId"u8); - writer.WriteStringValue(CommandId); - } - if (Optional.IsDefined(Arguments)) - { - writer.WritePropertyName("arguments"u8); -#if NET6_0_OR_GREATER - writer.WriteRawValue(Arguments); -#else - using (JsonDocument document = JsonDocument.Parse(Arguments)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - if (Optional.IsDefined(Host)) - { - writer.WritePropertyName("host"u8); - writer.WriteStringValue(Host); - } - if (Optional.IsDefined(IsAdmin)) - { - writer.WritePropertyName("isAdmin"u8); - writer.WriteBooleanValue(IsAdmin.Value); - } - if (Optional.IsDefined(ShouldStopCassandraBeforeStart)) - { - writer.WritePropertyName("cassandraStopStart"u8); - writer.WriteBooleanValue(ShouldStopCassandraBeforeStart.Value); - } - if (Optional.IsDefined(IsReadWrite)) - { - writer.WritePropertyName("readWrite"u8); - writer.WriteBooleanValue(IsReadWrite.Value); - } - if (Optional.IsDefined(Result)) - { - writer.WritePropertyName("result"u8); - writer.WriteStringValue(Result); - } - if (Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.Value.ToString()); - } - if (Optional.IsDefined(OutputFile)) - { - writer.WritePropertyName("outputFile"u8); - writer.WriteStringValue(OutputFile); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - CassandraClusterCommand IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraClusterCommand)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCassandraClusterCommand(document.RootElement, options); - } - - internal static CassandraClusterCommand DeserializeCassandraClusterCommand(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string command = default; - string commandId = default; - BinaryData arguments = default; - string host = default; - bool? isAdmin = default; - bool? cassandraStopStart = default; - bool? readWrite = default; - string result = default; - CassandraClusterCommandStatus? status = default; - string outputFile = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("command"u8)) - { - command = property.Value.GetString(); - continue; - } - if (property.NameEquals("commandId"u8)) - { - commandId = property.Value.GetString(); - continue; - } - if (property.NameEquals("arguments"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - arguments = BinaryData.FromString(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("host"u8)) - { - host = property.Value.GetString(); - continue; - } - if (property.NameEquals("isAdmin"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - isAdmin = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("cassandraStopStart"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - cassandraStopStart = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("readWrite"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - readWrite = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("result"u8)) - { - result = property.Value.GetString(); - continue; - } - if (property.NameEquals("status"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - status = new CassandraClusterCommandStatus(property.Value.GetString()); - continue; - } - if (property.NameEquals("outputFile"u8)) - { - outputFile = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CassandraClusterCommand( - command, - commandId, - arguments, - host, - isAdmin, - cassandraStopStart, - readWrite, - result, - status, - outputFile, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Command), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" command: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Command)) - { - builder.Append(" command: "); - if (Command.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Command}'''"); - } - else - { - builder.AppendLine($"'{Command}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CommandId), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" commandId: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(CommandId)) - { - builder.Append(" commandId: "); - if (CommandId.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{CommandId}'''"); - } - else - { - builder.AppendLine($"'{CommandId}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Arguments), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" arguments: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Arguments)) - { - builder.Append(" arguments: "); - builder.AppendLine($"'{Arguments.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Host), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" host: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Host)) - { - builder.Append(" host: "); - if (Host.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Host}'''"); - } - else - { - builder.AppendLine($"'{Host}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IsAdmin), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" isAdmin: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(IsAdmin)) - { - builder.Append(" isAdmin: "); - var boolValue = IsAdmin.Value == true ? "true" : "false"; - builder.AppendLine($"{boolValue}"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ShouldStopCassandraBeforeStart), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" cassandraStopStart: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ShouldStopCassandraBeforeStart)) - { - builder.Append(" cassandraStopStart: "); - var boolValue = ShouldStopCassandraBeforeStart.Value == true ? "true" : "false"; - builder.AppendLine($"{boolValue}"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IsReadWrite), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" readWrite: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(IsReadWrite)) - { - builder.Append(" readWrite: "); - var boolValue = IsReadWrite.Value == true ? "true" : "false"; - builder.AppendLine($"{boolValue}"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Result), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" result: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Result)) - { - builder.Append(" result: "); - if (Result.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Result}'''"); - } - else - { - builder.AppendLine($"'{Result}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Status), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" status: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Status)) - { - builder.Append(" status: "); - builder.AppendLine($"'{Status.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OutputFile), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" outputFile: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(OutputFile)) - { - builder.Append(" outputFile: "); - if (OutputFile.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{OutputFile}'''"); - } - else - { - builder.AppendLine($"'{OutputFile}'"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CassandraClusterCommand)} does not support writing '{options.Format}' format."); - } - } - - CassandraClusterCommand IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCassandraClusterCommand(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CassandraClusterCommand)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterCommand.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterCommand.cs deleted file mode 100644 index 698500131c28..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterCommand.cs +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// resource representing a command. - public partial class CassandraClusterCommand - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal CassandraClusterCommand() - { - } - - /// Initializes a new instance of . - /// The command which should be run. - /// The unique id of command. - /// The arguments for the command to be run. - /// IP address of the cassandra host to run the command on. - /// Whether command has admin privileges. - /// If true, stops cassandra before executing the command and then start it again. - /// If true, allows the command to *write* to the cassandra directory, otherwise read-only. - /// Result output of the command. - /// Status of the command. - /// The name of the file where the result is written. - /// Keeps track of any properties unknown to the library. - internal CassandraClusterCommand(string command, string commandId, BinaryData arguments, string host, bool? isAdmin, bool? shouldStopCassandraBeforeStart, bool? isReadWrite, string result, CassandraClusterCommandStatus? status, string outputFile, IDictionary serializedAdditionalRawData) - { - Command = command; - CommandId = commandId; - Arguments = arguments; - Host = host; - IsAdmin = isAdmin; - ShouldStopCassandraBeforeStart = shouldStopCassandraBeforeStart; - IsReadWrite = isReadWrite; - Result = result; - Status = status; - OutputFile = outputFile; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The command which should be run. - [WirePath("command")] - public string Command { get; } - /// The unique id of command. - [WirePath("commandId")] - public string CommandId { get; } - /// - /// The arguments for the command to be run - /// - /// To assign an object to this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - [WirePath("arguments")] - public BinaryData Arguments { get; } - /// IP address of the cassandra host to run the command on. - [WirePath("host")] - public string Host { get; } - /// Whether command has admin privileges. - [WirePath("isAdmin")] - public bool? IsAdmin { get; } - /// If true, stops cassandra before executing the command and then start it again. - [WirePath("cassandraStopStart")] - public bool? ShouldStopCassandraBeforeStart { get; } - /// If true, allows the command to *write* to the cassandra directory, otherwise read-only. - [WirePath("readWrite")] - public bool? IsReadWrite { get; } - /// Result output of the command. - [WirePath("result")] - public string Result { get; } - /// Status of the command. - [WirePath("status")] - public CassandraClusterCommandStatus? Status { get; } - /// The name of the file where the result is written. - [WirePath("outputFile")] - public string OutputFile { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterCommandStatus.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterCommandStatus.cs deleted file mode 100644 index dfc99d4f7531..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterCommandStatus.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Status of the command. - public readonly partial struct CassandraClusterCommandStatus : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public CassandraClusterCommandStatus(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string DoneValue = "Done"; - private const string RunningValue = "Running"; - private const string EnqueueValue = "Enqueue"; - private const string ProcessingValue = "Processing"; - private const string FinishedValue = "Finished"; - private const string FailedValue = "Failed"; - - /// Done. - public static CassandraClusterCommandStatus Done { get; } = new CassandraClusterCommandStatus(DoneValue); - /// Running. - public static CassandraClusterCommandStatus Running { get; } = new CassandraClusterCommandStatus(RunningValue); - /// Enqueue. - public static CassandraClusterCommandStatus Enqueue { get; } = new CassandraClusterCommandStatus(EnqueueValue); - /// Processing. - public static CassandraClusterCommandStatus Processing { get; } = new CassandraClusterCommandStatus(ProcessingValue); - /// Finished. - public static CassandraClusterCommandStatus Finished { get; } = new CassandraClusterCommandStatus(FinishedValue); - /// Failed. - public static CassandraClusterCommandStatus Failed { get; } = new CassandraClusterCommandStatus(FailedValue); - /// Determines if two values are the same. - public static bool operator ==(CassandraClusterCommandStatus left, CassandraClusterCommandStatus right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(CassandraClusterCommandStatus left, CassandraClusterCommandStatus right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator CassandraClusterCommandStatus(string value) => new CassandraClusterCommandStatus(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is CassandraClusterCommandStatus other && Equals(other); - /// - public bool Equals(CassandraClusterCommandStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterDataCenterNodeItem.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterDataCenterNodeItem.Serialization.cs index 41539485aace..7f605b3ac4f1 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterDataCenterNodeItem.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterDataCenterNodeItem.Serialization.cs @@ -118,11 +118,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WritePropertyName("cpuUsage"u8); writer.WriteNumberValue(CpuUsage.Value); } - if (Optional.IsDefined(IsLatestModel)) - { - writer.WritePropertyName("isLatestModel"u8); - writer.WriteBooleanValue(IsLatestModel.Value); - } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -178,7 +173,6 @@ internal static CassandraClusterDataCenterNodeItem DeserializeCassandraClusterDa long? memoryFreeKB = default; long? memoryTotalKB = default; double? cpuUsage = default; - bool? isLatestModel = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -317,15 +311,6 @@ internal static CassandraClusterDataCenterNodeItem DeserializeCassandraClusterDa cpuUsage = property.Value.GetDouble(); continue; } - if (property.NameEquals("isLatestModel"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - isLatestModel = property.Value.GetBoolean(); - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -350,7 +335,6 @@ internal static CassandraClusterDataCenterNodeItem DeserializeCassandraClusterDa memoryFreeKB, memoryTotalKB, cpuUsage, - isLatestModel, serializedAdditionalRawData); } @@ -689,22 +673,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IsLatestModel), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" isLatestModel: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(IsLatestModel)) - { - builder.Append(" isLatestModel: "); - var boolValue = IsLatestModel.Value == true ? "true" : "false"; - builder.AppendLine($"{boolValue}"); - } - } - builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterDataCenterNodeItem.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterDataCenterNodeItem.cs index dba03dd08080..3932357b3057 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterDataCenterNodeItem.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterDataCenterNodeItem.cs @@ -69,9 +69,8 @@ internal CassandraClusterDataCenterNodeItem() /// Unused memory (MemFree and SwapFree in /proc/meminfo), in kB. /// Total installed memory (MemTotal and SwapTotal in /proc/meminfo), in kB. /// A float representing the current system-wide CPU utilization as a percentage. - /// If node has been updated to latest model. /// Keeps track of any properties unknown to the library. - internal CassandraClusterDataCenterNodeItem(string address, CassandraNodeState? state, string status, string cassandraProcessStatus, string load, IReadOnlyList tokens, int? size, Guid? hostId, string rack, string timestamp, long? diskUsedKB, long? diskFreeKB, long? memoryUsedKB, long? memoryBuffersAndCachedKB, long? memoryFreeKB, long? memoryTotalKB, double? cpuUsage, bool? isLatestModel, IDictionary serializedAdditionalRawData) + internal CassandraClusterDataCenterNodeItem(string address, CassandraNodeState? state, string status, string cassandraProcessStatus, string load, IReadOnlyList tokens, int? size, Guid? hostId, string rack, string timestamp, long? diskUsedKB, long? diskFreeKB, long? memoryUsedKB, long? memoryBuffersAndCachedKB, long? memoryFreeKB, long? memoryTotalKB, double? cpuUsage, IDictionary serializedAdditionalRawData) { Address = address; State = state; @@ -90,7 +89,6 @@ internal CassandraClusterDataCenterNodeItem(string address, CassandraNodeState? MemoryFreeKB = memoryFreeKB; MemoryTotalKB = memoryTotalKB; CpuUsage = cpuUsage; - IsLatestModel = isLatestModel; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -145,8 +143,5 @@ internal CassandraClusterDataCenterNodeItem(string address, CassandraNodeState? /// A float representing the current system-wide CPU utilization as a percentage. [WirePath("cpuUsage")] public double? CpuUsage { get; } - /// If node has been updated to latest model. - [WirePath("isLatestModel")] - public bool? IsLatestModel { get; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterProperties.Serialization.cs index 477cf23bd823..a6be600e1375 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterProperties.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterProperties.Serialization.cs @@ -73,11 +73,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe writer.WritePropertyName("repairEnabled"u8); writer.WriteBooleanValue(IsRepairEnabled.Value); } - if (Optional.IsDefined(AutoReplicate)) - { - writer.WritePropertyName("autoReplicate"u8); - writer.WriteStringValue(AutoReplicate.Value.ToString()); - } if (Optional.IsCollectionDefined(ClientCertificates)) { writer.WritePropertyName("clientCertificates"u8); @@ -128,16 +123,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe } writer.WriteEndArray(); } - if (Optional.IsCollectionDefined(ExternalDataCenters)) - { - writer.WritePropertyName("externalDataCenters"u8); - writer.WriteStartArray(); - foreach (var item in ExternalDataCenters) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } if (Optional.IsDefined(HoursBetweenBackups)) { writer.WritePropertyName("hoursBetweenBackups"u8); @@ -153,41 +138,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe writer.WritePropertyName("cassandraAuditLoggingEnabled"u8); writer.WriteBooleanValue(IsCassandraAuditLoggingEnabled.Value); } - if (Optional.IsDefined(ClusterType)) - { - writer.WritePropertyName("clusterType"u8); - writer.WriteStringValue(ClusterType.Value.ToString()); - } if (Optional.IsDefined(ProvisionError)) { writer.WritePropertyName("provisionError"u8); writer.WriteObjectValue(ProvisionError, options); } - if (Optional.IsCollectionDefined(Extensions)) - { - writer.WritePropertyName("extensions"u8); - writer.WriteStartArray(); - foreach (var item in Extensions) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(BackupSchedules)) - { - writer.WritePropertyName("backupSchedules"u8); - writer.WriteStartArray(); - foreach (var item in BackupSchedules) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(ScheduledEventStrategy)) - { - writer.WritePropertyName("scheduledEventStrategy"u8); - writer.WriteStringValue(ScheduledEventStrategy.Value.ToString()); - } if (Optional.IsDefined(AzureConnectionMethod)) { writer.WritePropertyName("azureConnectionMethod"u8); @@ -245,21 +200,15 @@ internal static CassandraClusterProperties DeserializeCassandraClusterProperties string initialCassandraAdminPassword = default; CassandraDataCenterSeedNode prometheusEndpoint = default; bool? repairEnabled = default; - CassandraAutoReplicateForm? autoReplicate = default; IList clientCertificates = default; IList externalGossipCertificates = default; IReadOnlyList gossipCertificates = default; IList externalSeedNodes = default; IReadOnlyList seedNodes = default; - IList externalDataCenters = default; int? hoursBetweenBackups = default; bool? deallocated = default; bool? cassandraAuditLoggingEnabled = default; - CassandraClusterType? clusterType = default; CassandraError provisionError = default; - IList extensions = default; - IList backupSchedules = default; - ScheduledEventStrategy? scheduledEventStrategy = default; ServiceConnectionType? azureConnectionMethod = default; ResourceIdentifier privateLinkResourceId = default; IDictionary serializedAdditionalRawData = default; @@ -331,15 +280,6 @@ internal static CassandraClusterProperties DeserializeCassandraClusterProperties repairEnabled = property.Value.GetBoolean(); continue; } - if (property.NameEquals("autoReplicate"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - autoReplicate = new CassandraAutoReplicateForm(property.Value.GetString()); - continue; - } if (property.NameEquals("clientCertificates"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -410,20 +350,6 @@ internal static CassandraClusterProperties DeserializeCassandraClusterProperties seedNodes = array; continue; } - if (property.NameEquals("externalDataCenters"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - externalDataCenters = array; - continue; - } if (property.NameEquals("hoursBetweenBackups"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -451,15 +377,6 @@ internal static CassandraClusterProperties DeserializeCassandraClusterProperties cassandraAuditLoggingEnabled = property.Value.GetBoolean(); continue; } - if (property.NameEquals("clusterType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - clusterType = new CassandraClusterType(property.Value.GetString()); - continue; - } if (property.NameEquals("provisionError"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -469,43 +386,6 @@ internal static CassandraClusterProperties DeserializeCassandraClusterProperties provisionError = CassandraError.DeserializeCassandraError(property.Value, options); continue; } - if (property.NameEquals("extensions"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - extensions = array; - continue; - } - if (property.NameEquals("backupSchedules"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(CassandraClusterBackupSchedule.DeserializeCassandraClusterBackupSchedule(item, options)); - } - backupSchedules = array; - continue; - } - if (property.NameEquals("scheduledEventStrategy"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - scheduledEventStrategy = new ScheduledEventStrategy(property.Value.GetString()); - continue; - } if (property.NameEquals("azureConnectionMethod"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -540,21 +420,15 @@ internal static CassandraClusterProperties DeserializeCassandraClusterProperties initialCassandraAdminPassword, prometheusEndpoint, repairEnabled, - autoReplicate, clientCertificates ?? new ChangeTrackingList(), externalGossipCertificates ?? new ChangeTrackingList(), gossipCertificates ?? new ChangeTrackingList(), externalSeedNodes ?? new ChangeTrackingList(), seedNodes ?? new ChangeTrackingList(), - externalDataCenters ?? new ChangeTrackingList(), hoursBetweenBackups, deallocated, cassandraAuditLoggingEnabled, - clusterType, provisionError, - extensions ?? new ChangeTrackingList(), - backupSchedules ?? new ChangeTrackingList(), - scheduledEventStrategy, azureConnectionMethod, privateLinkResourceId, serializedAdditionalRawData); @@ -742,21 +616,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AutoReplicate), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" autoReplicate: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(AutoReplicate)) - { - builder.Append(" autoReplicate: "); - builder.AppendLine($"'{AutoReplicate.Value.ToString()}'"); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ClientCertificates), out propertyOverride); if (hasPropertyOverride) { @@ -872,42 +731,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ExternalDataCenters), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" externalDataCenters: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(ExternalDataCenters)) - { - if (ExternalDataCenters.Any()) - { - builder.Append(" externalDataCenters: "); - builder.AppendLine("["); - foreach (var item in ExternalDataCenters) - { - if (item == null) - { - builder.Append("null"); - continue; - } - if (item.Contains(Environment.NewLine)) - { - builder.AppendLine(" '''"); - builder.AppendLine($"{item}'''"); - } - else - { - builder.AppendLine($" '{item}'"); - } - } - builder.AppendLine(" ]"); - } - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(HoursBetweenBackups), out propertyOverride); if (hasPropertyOverride) { @@ -955,21 +778,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ClusterType), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" clusterType: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ClusterType)) - { - builder.Append(" clusterType: "); - builder.AppendLine($"'{ClusterType.Value.ToString()}'"); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisionError), out propertyOverride); if (hasPropertyOverride) { @@ -985,80 +793,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Extensions), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" extensions: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Extensions)) - { - if (Extensions.Any()) - { - builder.Append(" extensions: "); - builder.AppendLine("["); - foreach (var item in Extensions) - { - if (item == null) - { - builder.Append("null"); - continue; - } - if (item.Contains(Environment.NewLine)) - { - builder.AppendLine(" '''"); - builder.AppendLine($"{item}'''"); - } - else - { - builder.AppendLine($" '{item}'"); - } - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(BackupSchedules), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" backupSchedules: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(BackupSchedules)) - { - if (BackupSchedules.Any()) - { - builder.Append(" backupSchedules: "); - builder.AppendLine("["); - foreach (var item in BackupSchedules) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " backupSchedules: "); - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ScheduledEventStrategy), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" scheduledEventStrategy: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ScheduledEventStrategy)) - { - builder.Append(" scheduledEventStrategy: "); - builder.AppendLine($"'{ScheduledEventStrategy.Value.ToString()}'"); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AzureConnectionMethod), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterProperties.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterProperties.cs index ee65e9f38870..75291438ae06 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterProperties.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterProperties.cs @@ -54,9 +54,6 @@ public CassandraClusterProperties() GossipCertificates = new ChangeTrackingList(); ExternalSeedNodes = new ChangeTrackingList(); SeedNodes = new ChangeTrackingList(); - ExternalDataCenters = new ChangeTrackingList(); - Extensions = new ChangeTrackingList(); - BackupSchedules = new ChangeTrackingList(); } /// Initializes a new instance of . @@ -69,25 +66,19 @@ public CassandraClusterProperties() /// Initial password for clients connecting as admin to the cluster. Should be changed after cluster creation. Returns null on GET. This field only applies when the authenticationMethod field is 'Cassandra'. /// Hostname or IP address where the Prometheus endpoint containing data about the managed Cassandra nodes can be reached. /// Should automatic repairs run on this cluster? If omitted, this is true, and should stay true unless you are running a hybrid cluster where you are already doing your own repairs. - /// The form of AutoReplicate that is being used by this cluster. /// List of TLS certificates used to authorize clients connecting to the cluster. All connections are TLS encrypted whether clientCertificates is set or not, but if clientCertificates is set, the managed Cassandra cluster will reject all connections not bearing a TLS client certificate that can be validated from one or more of the public certificates in this property. /// List of TLS certificates used to authorize gossip from unmanaged data centers. The TLS certificates of all nodes in unmanaged data centers must be verifiable using one of the certificates provided in this property. /// List of TLS certificates that unmanaged nodes must trust for gossip with managed nodes. All managed nodes will present TLS client certificates that are verifiable using one of the certificates provided in this property. /// List of IP addresses of seed nodes in unmanaged data centers. These will be added to the seed node lists of all managed nodes. /// List of IP addresses of seed nodes in the managed data centers. These should be added to the seed node lists of all unmanaged nodes. - /// List of the data center names for unmanaged data centers in this cluster to be included in auto-replication. /// (Deprecated) Number of hours to wait between taking a backup of the cluster. /// Whether the cluster and associated data centers has been deallocated. /// Whether Cassandra audit logging is enabled. - /// Type of the cluster. If set to Production, some operations might not be permitted on cluster. /// Error related to resource provisioning. - /// Extensions to be added or updated on cluster. - /// List of backup schedules that define when you want to back up your data. - /// How the nodes in the cluster react to scheduled events. /// How to connect to the azure services needed for running the cluster. - /// If the Connection Method is Vpn, this is the Id of the private link resource that the datacenters need to connect to. + /// If the Connection Method is VPN, this is the Id of the private link resource that the datacenters need to connect to. /// Keeps track of any properties unknown to the library. - internal CassandraClusterProperties(CassandraProvisioningState? provisioningState, string restoreFromBackupId, ResourceIdentifier delegatedManagementSubnetId, string cassandraVersion, string clusterNameOverride, CassandraAuthenticationMethod? authenticationMethod, string initialCassandraAdminPassword, CassandraDataCenterSeedNode prometheusEndpoint, bool? isRepairEnabled, CassandraAutoReplicateForm? autoReplicate, IList clientCertificates, IList externalGossipCertificates, IReadOnlyList gossipCertificates, IList externalSeedNodes, IReadOnlyList seedNodes, IList externalDataCenters, int? hoursBetweenBackups, bool? isDeallocated, bool? isCassandraAuditLoggingEnabled, CassandraClusterType? clusterType, CassandraError provisionError, IList extensions, IList backupSchedules, ScheduledEventStrategy? scheduledEventStrategy, ServiceConnectionType? azureConnectionMethod, ResourceIdentifier privateLinkResourceId, IDictionary serializedAdditionalRawData) + internal CassandraClusterProperties(CassandraProvisioningState? provisioningState, string restoreFromBackupId, ResourceIdentifier delegatedManagementSubnetId, string cassandraVersion, string clusterNameOverride, CassandraAuthenticationMethod? authenticationMethod, string initialCassandraAdminPassword, CassandraDataCenterSeedNode prometheusEndpoint, bool? isRepairEnabled, IList clientCertificates, IList externalGossipCertificates, IReadOnlyList gossipCertificates, IList externalSeedNodes, IReadOnlyList seedNodes, int? hoursBetweenBackups, bool? isDeallocated, bool? isCassandraAuditLoggingEnabled, CassandraError provisionError, ServiceConnectionType? azureConnectionMethod, ResourceIdentifier privateLinkResourceId, IDictionary serializedAdditionalRawData) { ProvisioningState = provisioningState; RestoreFromBackupId = restoreFromBackupId; @@ -98,21 +89,15 @@ internal CassandraClusterProperties(CassandraProvisioningState? provisioningStat InitialCassandraAdminPassword = initialCassandraAdminPassword; PrometheusEndpoint = prometheusEndpoint; IsRepairEnabled = isRepairEnabled; - AutoReplicate = autoReplicate; ClientCertificates = clientCertificates; ExternalGossipCertificates = externalGossipCertificates; GossipCertificates = gossipCertificates; ExternalSeedNodes = externalSeedNodes; SeedNodes = seedNodes; - ExternalDataCenters = externalDataCenters; HoursBetweenBackups = hoursBetweenBackups; IsDeallocated = isDeallocated; IsCassandraAuditLoggingEnabled = isCassandraAuditLoggingEnabled; - ClusterType = clusterType; ProvisionError = provisionError; - Extensions = extensions; - BackupSchedules = backupSchedules; - ScheduledEventStrategy = scheduledEventStrategy; AzureConnectionMethod = azureConnectionMethod; PrivateLinkResourceId = privateLinkResourceId; _serializedAdditionalRawData = serializedAdditionalRawData; @@ -157,9 +142,6 @@ public string PrometheusEndpointIPAddress /// Should automatic repairs run on this cluster? If omitted, this is true, and should stay true unless you are running a hybrid cluster where you are already doing your own repairs. [WirePath("repairEnabled")] public bool? IsRepairEnabled { get; set; } - /// The form of AutoReplicate that is being used by this cluster. - [WirePath("autoReplicate")] - public CassandraAutoReplicateForm? AutoReplicate { get; set; } /// List of TLS certificates used to authorize clients connecting to the cluster. All connections are TLS encrypted whether clientCertificates is set or not, but if clientCertificates is set, the managed Cassandra cluster will reject all connections not bearing a TLS client certificate that can be validated from one or more of the public certificates in this property. [WirePath("clientCertificates")] public IList ClientCertificates { get; } @@ -175,9 +157,6 @@ public string PrometheusEndpointIPAddress /// List of IP addresses of seed nodes in the managed data centers. These should be added to the seed node lists of all unmanaged nodes. [WirePath("seedNodes")] public IReadOnlyList SeedNodes { get; } - /// List of the data center names for unmanaged data centers in this cluster to be included in auto-replication. - [WirePath("externalDataCenters")] - public IList ExternalDataCenters { get; } /// (Deprecated) Number of hours to wait between taking a backup of the cluster. [WirePath("hoursBetweenBackups")] public int? HoursBetweenBackups { get; set; } @@ -187,25 +166,13 @@ public string PrometheusEndpointIPAddress /// Whether Cassandra audit logging is enabled. [WirePath("cassandraAuditLoggingEnabled")] public bool? IsCassandraAuditLoggingEnabled { get; set; } - /// Type of the cluster. If set to Production, some operations might not be permitted on cluster. - [WirePath("clusterType")] - public CassandraClusterType? ClusterType { get; set; } /// Error related to resource provisioning. [WirePath("provisionError")] public CassandraError ProvisionError { get; set; } - /// Extensions to be added or updated on cluster. - [WirePath("extensions")] - public IList Extensions { get; } - /// List of backup schedules that define when you want to back up your data. - [WirePath("backupSchedules")] - public IList BackupSchedules { get; } - /// How the nodes in the cluster react to scheduled events. - [WirePath("scheduledEventStrategy")] - public ScheduledEventStrategy? ScheduledEventStrategy { get; set; } /// How to connect to the azure services needed for running the cluster. [WirePath("azureConnectionMethod")] public ServiceConnectionType? AzureConnectionMethod { get; set; } - /// If the Connection Method is Vpn, this is the Id of the private link resource that the datacenters need to connect to. + /// If the Connection Method is VPN, this is the Id of the private link resource that the datacenters need to connect to. [WirePath("privateLinkResourceId")] public ResourceIdentifier PrivateLinkResourceId { get; } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterType.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterType.cs deleted file mode 100644 index eadd5acf56b6..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Type of the cluster. If set to Production, some operations might not be permitted on cluster. - public readonly partial struct CassandraClusterType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public CassandraClusterType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ProductionValue = "Production"; - private const string NonProductionValue = "NonProduction"; - - /// Production. - public static CassandraClusterType Production { get; } = new CassandraClusterType(ProductionValue); - /// NonProduction. - public static CassandraClusterType NonProduction { get; } = new CassandraClusterType(NonProductionValue); - /// Determines if two values are the same. - public static bool operator ==(CassandraClusterType left, CassandraClusterType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(CassandraClusterType left, CassandraClusterType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator CassandraClusterType(string value) => new CassandraClusterType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is CassandraClusterType other && Equals(other); - /// - public bool Equals(CassandraClusterType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraCommandPostBody.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraCommandPostBody.Serialization.cs index 58ba02e0e5a9..ba0baea24975 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraCommandPostBody.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraCommandPostBody.Serialization.cs @@ -46,10 +46,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead writer.WritePropertyName("cassandra-stop-start"u8); writer.WriteBooleanValue(CassandraStopStart.Value); } - if (Optional.IsDefined(AllowWrite)) + if (Optional.IsDefined(Readwrite)) { - writer.WritePropertyName("readWrite"u8); - writer.WriteBooleanValue(AllowWrite.Value); + writer.WritePropertyName("readwrite"u8); + writer.WriteBooleanValue(Readwrite.Value); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -93,7 +93,7 @@ internal static CassandraCommandPostBody DeserializeCassandraCommandPostBody(Jso IDictionary arguments = default; string host = default; bool? cassandraStopStart = default; - bool? readWrite = default; + bool? readwrite = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -131,13 +131,13 @@ internal static CassandraCommandPostBody DeserializeCassandraCommandPostBody(Jso cassandraStopStart = property.Value.GetBoolean(); continue; } - if (property.NameEquals("readWrite"u8)) + if (property.NameEquals("readwrite"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - readWrite = property.Value.GetBoolean(); + readwrite = property.Value.GetBoolean(); continue; } if (options.Format != "W") @@ -151,7 +151,7 @@ internal static CassandraCommandPostBody DeserializeCassandraCommandPostBody(Jso arguments ?? new ChangeTrackingDictionary(), host, cassandraStopStart, - readWrite, + readwrite, serializedAdditionalRawData); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraCommandPostBody.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraCommandPostBody.cs index f1a30a528624..cbc35ba4c830 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraCommandPostBody.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraCommandPostBody.cs @@ -64,15 +64,15 @@ public CassandraCommandPostBody(string command, string host) /// The arguments for the command to be run. /// IP address of the cassandra host to run the command on. /// If true, stops cassandra before executing the command and then start it again. - /// If true, allows the command to *write* to the cassandra directory, otherwise read-only. + /// If true, allows the command to *write* to the cassandra directory, otherwise read-only. /// Keeps track of any properties unknown to the library. - internal CassandraCommandPostBody(string command, IDictionary arguments, string host, bool? cassandraStopStart, bool? allowWrite, IDictionary serializedAdditionalRawData) + internal CassandraCommandPostBody(string command, IDictionary arguments, string host, bool? cassandraStopStart, bool? readwrite, IDictionary serializedAdditionalRawData) { Command = command; Arguments = arguments; Host = host; CassandraStopStart = cassandraStopStart; - AllowWrite = allowWrite; + Readwrite = readwrite; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -94,7 +94,7 @@ internal CassandraCommandPostBody() [WirePath("cassandra-stop-start")] public bool? CassandraStopStart { get; set; } /// If true, allows the command to *write* to the cassandra directory, otherwise read-only. - [WirePath("readWrite")] - public bool? AllowWrite { get; set; } + [WirePath("readwrite")] + public bool? Readwrite { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceCreateOrUpdateContent.Serialization.cs index 6e1f2937fc84..5ef07834a583 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceCreateOrUpdateContent.Serialization.cs @@ -29,12 +29,6 @@ void IJsonModel.Write(Utf8JsonWriter wri } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -116,7 +110,6 @@ internal static CassandraKeyspaceCreateOrUpdateContent DeserializeCassandraKeysp { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -129,16 +122,6 @@ internal static CassandraKeyspaceCreateOrUpdateContent DeserializeCassandraKeysp Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -223,7 +206,6 @@ internal static CassandraKeyspaceCreateOrUpdateContent DeserializeCassandraKeysp location, resource, options0, - identity, serializedAdditionalRawData); } @@ -310,21 +292,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceCreateOrUpdateContent.cs index 6820de815f52..b76fc6bec344 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceCreateOrUpdateContent.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceCreateOrUpdateContent.cs @@ -67,13 +67,11 @@ public CassandraKeyspaceCreateOrUpdateContent(AzureLocation location, CassandraK /// The location. /// The standard JSON format of a Cassandra keyspace. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CassandraKeyspaceCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CassandraKeyspaceResourceInfo resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CassandraKeyspaceCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CassandraKeyspaceResourceInfo resource, CosmosDBCreateUpdateConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -95,8 +93,5 @@ public string ResourceKeyspaceName /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. [WirePath("properties.options")] public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableCreateOrUpdateContent.Serialization.cs index 1ae0e1ea253a..ee7d6a813c04 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableCreateOrUpdateContent.Serialization.cs @@ -29,12 +29,6 @@ void IJsonModel.Write(Utf8JsonWriter writer } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -116,7 +110,6 @@ internal static CassandraTableCreateOrUpdateContent DeserializeCassandraTableCre { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -129,16 +122,6 @@ internal static CassandraTableCreateOrUpdateContent DeserializeCassandraTableCre Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -223,7 +206,6 @@ internal static CassandraTableCreateOrUpdateContent DeserializeCassandraTableCre location, resource, options0, - identity, serializedAdditionalRawData); } @@ -310,21 +292,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableCreateOrUpdateContent.cs index 2605da0abfae..5235cd0d4f83 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableCreateOrUpdateContent.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableCreateOrUpdateContent.cs @@ -67,13 +67,11 @@ public CassandraTableCreateOrUpdateContent(AzureLocation location, CassandraTabl /// The location. /// The standard JSON format of a Cassandra table. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CassandraTableCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CassandraTableResourceInfo resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CassandraTableCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CassandraTableResourceInfo resource, CosmosDBCreateUpdateConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -88,8 +86,5 @@ internal CassandraTableCreateOrUpdateContent() /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. [WirePath("properties.options")] public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesOptions.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesOptions.Serialization.cs deleted file mode 100644 index f8540c148381..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesOptions.Serialization.cs +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CassandraViewGetPropertiesOptions : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraViewGetPropertiesOptions)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Throughput)) - { - writer.WritePropertyName("throughput"u8); - writer.WriteNumberValue(Throughput.Value); - } - if (Optional.IsDefined(AutoscaleSettings)) - { - writer.WritePropertyName("autoscaleSettings"u8); - writer.WriteObjectValue(AutoscaleSettings, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - CassandraViewGetPropertiesOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraViewGetPropertiesOptions)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCassandraViewGetPropertiesOptions(document.RootElement, options); - } - - internal static CassandraViewGetPropertiesOptions DeserializeCassandraViewGetPropertiesOptions(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - int? throughput = default; - AutoscaleSettings autoscaleSettings = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("throughput"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - throughput = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("autoscaleSettings"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - autoscaleSettings = AutoscaleSettings.DeserializeAutoscaleSettings(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CassandraViewGetPropertiesOptions(throughput, autoscaleSettings, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Throughput), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" throughput: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Throughput)) - { - builder.Append(" throughput: "); - builder.AppendLine($"{Throughput.Value}"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("AutoscaleMaxThroughput", out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" autoscaleSettings: "); - builder.AppendLine("{"); - builder.Append(" maxThroughput: "); - builder.AppendLine(propertyOverride); - builder.AppendLine(" }"); - } - else - { - if (Optional.IsDefined(AutoscaleSettings)) - { - builder.Append(" autoscaleSettings: "); - BicepSerializationHelpers.AppendChildObject(builder, AutoscaleSettings, options, 2, false, " autoscaleSettings: "); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CassandraViewGetPropertiesOptions)} does not support writing '{options.Format}' format."); - } - } - - CassandraViewGetPropertiesOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCassandraViewGetPropertiesOptions(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CassandraViewGetPropertiesOptions)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesOptions.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesOptions.cs deleted file mode 100644 index 592a376d7a9f..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesOptions.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The CassandraViewGetPropertiesOptions. - public partial class CassandraViewGetPropertiesOptions : CosmosDBBaseConfig - { - /// Initializes a new instance of . - public CassandraViewGetPropertiesOptions() - { - } - - /// Initializes a new instance of . - /// Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. - /// Specifies the Autoscale settings. - /// Keeps track of any properties unknown to the library. - internal CassandraViewGetPropertiesOptions(int? throughput, AutoscaleSettings autoscaleSettings, IDictionary serializedAdditionalRawData) : base(throughput, autoscaleSettings, serializedAdditionalRawData) - { - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesResource.Serialization.cs deleted file mode 100644 index 66002ffbc000..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesResource.Serialization.cs +++ /dev/null @@ -1,291 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CassandraViewGetPropertiesResource : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraViewGetPropertiesResource)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(Rid)) - { - writer.WritePropertyName("_rid"u8); - writer.WriteStringValue(Rid); - } - if (options.Format != "W" && Optional.IsDefined(Timestamp)) - { - writer.WritePropertyName("_ts"u8); - writer.WriteNumberValue(Timestamp.Value); - } - if (options.Format != "W" && Optional.IsDefined(ETag)) - { - writer.WritePropertyName("_etag"u8); - writer.WriteStringValue(ETag.Value.ToString()); - } - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - writer.WritePropertyName("viewDefinition"u8); - writer.WriteStringValue(ViewDefinition); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - CassandraViewGetPropertiesResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraViewGetPropertiesResource)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCassandraViewGetPropertiesResource(document.RootElement, options); - } - - internal static CassandraViewGetPropertiesResource DeserializeCassandraViewGetPropertiesResource(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string rid = default; - float? ts = default; - ETag? etag = default; - string id = default; - string viewDefinition = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("_rid"u8)) - { - rid = property.Value.GetString(); - continue; - } - if (property.NameEquals("_ts"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - ts = property.Value.GetSingle(); - continue; - } - if (property.NameEquals("_etag"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - etag = new ETag(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("viewDefinition"u8)) - { - viewDefinition = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CassandraViewGetPropertiesResource( - id, - viewDefinition, - serializedAdditionalRawData, - rid, - ts, - etag); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Rid), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" _rid: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Rid)) - { - builder.Append(" _rid: "); - if (Rid.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Rid}'''"); - } - else - { - builder.AppendLine($"'{Rid}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Timestamp), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" _ts: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Timestamp)) - { - builder.Append(" _ts: "); - builder.AppendLine($"'{Timestamp.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ETag), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" _etag: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ETag)) - { - builder.Append(" _etag: "); - builder.AppendLine($"'{ETag.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - if (Id.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Id}'''"); - } - else - { - builder.AppendLine($"'{Id}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ViewDefinition), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" viewDefinition: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ViewDefinition)) - { - builder.Append(" viewDefinition: "); - if (ViewDefinition.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{ViewDefinition}'''"); - } - else - { - builder.AppendLine($"'{ViewDefinition}'"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CassandraViewGetPropertiesResource)} does not support writing '{options.Format}' format."); - } - } - - CassandraViewGetPropertiesResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCassandraViewGetPropertiesResource(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CassandraViewGetPropertiesResource)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesResource.cs deleted file mode 100644 index 9b83c445f7b3..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesResource.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The CassandraViewGetPropertiesResource. - public partial class CassandraViewGetPropertiesResource : CassandraViewResource - { - /// Initializes a new instance of . - /// Name of the Cosmos DB Cassandra view. - /// View Definition of the Cosmos DB Cassandra view. - /// or is null. - public CassandraViewGetPropertiesResource(string id, string viewDefinition) : base(id, viewDefinition) - { - Argument.AssertNotNull(id, nameof(id)); - Argument.AssertNotNull(viewDefinition, nameof(viewDefinition)); - } - - /// Initializes a new instance of . - /// Name of the Cosmos DB Cassandra view. - /// View Definition of the Cosmos DB Cassandra view. - /// Keeps track of any properties unknown to the library. - /// A system generated property. A unique identifier. - /// A system generated property that denotes the last updated timestamp of the resource. - /// A system generated property representing the resource etag required for optimistic concurrency control. - internal CassandraViewGetPropertiesResource(string id, string viewDefinition, IDictionary serializedAdditionalRawData, string rid, float? timestamp, ETag? etag) : base(id, viewDefinition, serializedAdditionalRawData) - { - Rid = rid; - Timestamp = timestamp; - ETag = etag; - } - - /// Initializes a new instance of for deserialization. - internal CassandraViewGetPropertiesResource() - { - } - - /// A system generated property. A unique identifier. - [WirePath("_rid")] - public string Rid { get; } - /// A system generated property that denotes the last updated timestamp of the resource. - [WirePath("_ts")] - public float? Timestamp { get; } - /// A system generated property representing the resource etag required for optimistic concurrency control. - [WirePath("_etag")] - public ETag? ETag { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetResultCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetResultCreateOrUpdateContent.Serialization.cs deleted file mode 100644 index a7faa3184ab9..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetResultCreateOrUpdateContent.Serialization.cs +++ /dev/null @@ -1,428 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CassandraViewGetResultCreateOrUpdateContent : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraViewGetResultCreateOrUpdateContent)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - writer.WritePropertyName("resource"u8); - writer.WriteObjectValue(Resource, options); - if (Optional.IsDefined(Options)) - { - writer.WritePropertyName("options"u8); - writer.WriteObjectValue(Options, options); - } - writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - CassandraViewGetResultCreateOrUpdateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraViewGetResultCreateOrUpdateContent)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCassandraViewGetResultCreateOrUpdateContent(document.RootElement, options); - } - - internal static CassandraViewGetResultCreateOrUpdateContent DeserializeCassandraViewGetResultCreateOrUpdateContent(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ManagedServiceIdentity identity = default; - IDictionary tags = default; - AzureLocation location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - CassandraViewResource resource = default; - CosmosDBCreateUpdateConfig options0 = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("location"u8)) - { - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("resource"u8)) - { - resource = CassandraViewResource.DeserializeCassandraViewResource(property0.Value, options); - continue; - } - if (property0.NameEquals("options"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - options0 = CosmosDBCreateUpdateConfig.DeserializeCosmosDBCreateUpdateConfig(property0.Value, options); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CassandraViewGetResultCreateOrUpdateContent( - id, - name, - type, - systemData, - tags ?? new ChangeTrackingDictionary(), - location, - resource, - options0, - identity, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" location: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" location: "); - builder.AppendLine($"'{Location.ToString()}'"); - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" tags: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Tags)) - { - if (Tags.Any()) - { - builder.Append(" tags: "); - builder.AppendLine("{"); - foreach (var item in Tags) - { - builder.Append($" '{item.Key}': "); - if (item.Value == null) - { - builder.Append("null"); - continue; - } - if (item.Value.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{item.Value}'''"); - } - else - { - builder.AppendLine($"'{item.Value}'"); - } - } - builder.AppendLine(" }"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.Append(" properties:"); - builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Resource), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" resource: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Resource)) - { - builder.Append(" resource: "); - BicepSerializationHelpers.AppendChildObject(builder, Resource, options, 4, false, " resource: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Options), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" options: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Options)) - { - builder.Append(" options: "); - BicepSerializationHelpers.AppendChildObject(builder, Options, options, 4, false, " options: "); - } - } - - builder.AppendLine(" }"); - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CassandraViewGetResultCreateOrUpdateContent)} does not support writing '{options.Format}' format."); - } - } - - CassandraViewGetResultCreateOrUpdateContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCassandraViewGetResultCreateOrUpdateContent(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CassandraViewGetResultCreateOrUpdateContent)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetResultCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetResultCreateOrUpdateContent.cs deleted file mode 100644 index 69d2c56c0064..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetResultCreateOrUpdateContent.cs +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Parameters to create and update Cosmos DB Cassandra view. - public partial class CassandraViewGetResultCreateOrUpdateContent : TrackedResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The location. - /// The standard JSON format of a Cassandra view. - /// is null. - public CassandraViewGetResultCreateOrUpdateContent(AzureLocation location, CassandraViewResource resource) : base(location) - { - Argument.AssertNotNull(resource, nameof(resource)); - - Resource = resource; - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The standard JSON format of a Cassandra view. - /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. - /// Keeps track of any properties unknown to the library. - internal CassandraViewGetResultCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CassandraViewResource resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) - { - Resource = resource; - Options = options; - Identity = identity; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal CassandraViewGetResultCreateOrUpdateContent() - { - } - - /// The standard JSON format of a Cassandra view. - [WirePath("properties.resource")] - public CassandraViewResource Resource { get; set; } - /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - [WirePath("properties.options")] - public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewListResult.Serialization.cs deleted file mode 100644 index f6147d64a37b..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewListResult.Serialization.cs +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - internal partial class CassandraViewListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraViewListResult)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - CassandraViewListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraViewListResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCassandraViewListResult(document.RootElement, options); - } - - internal static CassandraViewListResult DeserializeCassandraViewListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(CassandraViewGetResultData.DeserializeCassandraViewGetResultData(item, options)); - } - value = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CassandraViewListResult(value ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" value: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Value)) - { - if (Value.Any()) - { - builder.Append(" value: "); - builder.AppendLine("["); - foreach (var item in Value) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); - } - builder.AppendLine(" ]"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CassandraViewListResult)} does not support writing '{options.Format}' format."); - } - } - - CassandraViewListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCassandraViewListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CassandraViewListResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewResource.Serialization.cs deleted file mode 100644 index dce1d590180d..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewResource.Serialization.cs +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CassandraViewResource : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraViewResource)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - writer.WritePropertyName("viewDefinition"u8); - writer.WriteStringValue(ViewDefinition); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - CassandraViewResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraViewResource)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCassandraViewResource(document.RootElement, options); - } - - internal static CassandraViewResource DeserializeCassandraViewResource(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string id = default; - string viewDefinition = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("viewDefinition"u8)) - { - viewDefinition = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CassandraViewResource(id, viewDefinition, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - if (Id.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Id}'''"); - } - else - { - builder.AppendLine($"'{Id}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ViewDefinition), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" viewDefinition: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ViewDefinition)) - { - builder.Append(" viewDefinition: "); - if (ViewDefinition.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{ViewDefinition}'''"); - } - else - { - builder.AppendLine($"'{ViewDefinition}'"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CassandraViewResource)} does not support writing '{options.Format}' format."); - } - } - - CassandraViewResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCassandraViewResource(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CassandraViewResource)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewResource.cs deleted file mode 100644 index 00b0c796b103..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewResource.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Cosmos DB Cassandra view resource object. - public partial class CassandraViewResource - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// Name of the Cosmos DB Cassandra view. - /// View Definition of the Cosmos DB Cassandra view. - /// or is null. - public CassandraViewResource(string id, string viewDefinition) - { - Argument.AssertNotNull(id, nameof(id)); - Argument.AssertNotNull(viewDefinition, nameof(viewDefinition)); - - Id = id; - ViewDefinition = viewDefinition; - } - - /// Initializes a new instance of . - /// Name of the Cosmos DB Cassandra view. - /// View Definition of the Cosmos DB Cassandra view. - /// Keeps track of any properties unknown to the library. - internal CassandraViewResource(string id, string viewDefinition, IDictionary serializedAdditionalRawData) - { - Id = id; - ViewDefinition = viewDefinition; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal CassandraViewResource() - { - } - - /// Name of the Cosmos DB Cassandra view. - [WirePath("id")] - public string Id { get; set; } - /// View Definition of the Cosmos DB Cassandra view. - [WirePath("viewDefinition")] - public string ViewDefinition { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousModeBackupPolicy.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousModeBackupPolicy.cs index 30b994436d03..692a02f725ea 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousModeBackupPolicy.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousModeBackupPolicy.cs @@ -32,7 +32,7 @@ internal ContinuousModeBackupPolicy(BackupPolicyType backupPolicyType, BackupPol /// Configuration values for continuous mode backup. internal ContinuousModeProperties ContinuousModeProperties { get; set; } - /// Enum to indicate type of Continuos backup mode. + /// Enum to indicate type of Continuous backup mode. [WirePath("continuousModeProperties.tier")] public ContinuousTier? ContinuousModeTier { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousModeProperties.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousModeProperties.cs index 6ba0eb1d606e..a8e3f277570d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousModeProperties.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousModeProperties.cs @@ -51,7 +51,7 @@ public ContinuousModeProperties() } /// Initializes a new instance of . - /// Enum to indicate type of Continuos backup mode. + /// Enum to indicate type of Continuous backup mode. /// Keeps track of any properties unknown to the library. internal ContinuousModeProperties(ContinuousTier? tier, IDictionary serializedAdditionalRawData) { @@ -59,7 +59,7 @@ internal ContinuousModeProperties(ContinuousTier? tier, IDictionary Enum to indicate type of Continuos backup mode. + /// Enum to indicate type of Continuous backup mode. [WirePath("tier")] public ContinuousTier? Tier { get; set; } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosCassandraDataTransferDataSourceSink.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosCassandraDataTransferDataSourceSink.Serialization.cs deleted file mode 100644 index 8a8a6a3ad091..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosCassandraDataTransferDataSourceSink.Serialization.cs +++ /dev/null @@ -1,245 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CosmosCassandraDataTransferDataSourceSink : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosCassandraDataTransferDataSourceSink)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("keyspaceName"u8); - writer.WriteStringValue(KeyspaceName); - writer.WritePropertyName("tableName"u8); - writer.WriteStringValue(TableName); - if (Optional.IsDefined(RemoteAccountName)) - { - writer.WritePropertyName("remoteAccountName"u8); - writer.WriteStringValue(RemoteAccountName); - } - writer.WritePropertyName("component"u8); - writer.WriteStringValue(Component.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - CosmosCassandraDataTransferDataSourceSink IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosCassandraDataTransferDataSourceSink)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCosmosCassandraDataTransferDataSourceSink(document.RootElement, options); - } - - internal static CosmosCassandraDataTransferDataSourceSink DeserializeCosmosCassandraDataTransferDataSourceSink(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string keyspaceName = default; - string tableName = default; - string remoteAccountName = default; - DataTransferComponent component = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("keyspaceName"u8)) - { - keyspaceName = property.Value.GetString(); - continue; - } - if (property.NameEquals("tableName"u8)) - { - tableName = property.Value.GetString(); - continue; - } - if (property.NameEquals("remoteAccountName"u8)) - { - remoteAccountName = property.Value.GetString(); - continue; - } - if (property.NameEquals("component"u8)) - { - component = new DataTransferComponent(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CosmosCassandraDataTransferDataSourceSink(component, serializedAdditionalRawData, remoteAccountName, keyspaceName, tableName); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(KeyspaceName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" keyspaceName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(KeyspaceName)) - { - builder.Append(" keyspaceName: "); - if (KeyspaceName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{KeyspaceName}'''"); - } - else - { - builder.AppendLine($"'{KeyspaceName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TableName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" tableName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(TableName)) - { - builder.Append(" tableName: "); - if (TableName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{TableName}'''"); - } - else - { - builder.AppendLine($"'{TableName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RemoteAccountName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" remoteAccountName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(RemoteAccountName)) - { - builder.Append(" remoteAccountName: "); - if (RemoteAccountName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{RemoteAccountName}'''"); - } - else - { - builder.AppendLine($"'{RemoteAccountName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Component), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" component: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" component: "); - builder.AppendLine($"'{Component.ToString()}'"); - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CosmosCassandraDataTransferDataSourceSink)} does not support writing '{options.Format}' format."); - } - } - - CosmosCassandraDataTransferDataSourceSink IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCosmosCassandraDataTransferDataSourceSink(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CosmosCassandraDataTransferDataSourceSink)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosCassandraDataTransferDataSourceSink.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosCassandraDataTransferDataSourceSink.cs deleted file mode 100644 index f915006de849..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosCassandraDataTransferDataSourceSink.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// A CosmosDB Cassandra API data source/sink. - public partial class CosmosCassandraDataTransferDataSourceSink : BaseCosmosDataTransferDataSourceSink - { - /// Initializes a new instance of . - /// - /// - /// or is null. - public CosmosCassandraDataTransferDataSourceSink(string keyspaceName, string tableName) - { - Argument.AssertNotNull(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNull(tableName, nameof(tableName)); - - KeyspaceName = keyspaceName; - TableName = tableName; - Component = DataTransferComponent.CosmosDBCassandra; - } - - /// Initializes a new instance of . - /// - /// Keeps track of any properties unknown to the library. - /// - /// - /// - internal CosmosCassandraDataTransferDataSourceSink(DataTransferComponent component, IDictionary serializedAdditionalRawData, string remoteAccountName, string keyspaceName, string tableName) : base(component, serializedAdditionalRawData, remoteAccountName) - { - KeyspaceName = keyspaceName; - TableName = tableName; - Component = component; - } - - /// Initializes a new instance of for deserialization. - internal CosmosCassandraDataTransferDataSourceSink() - { - } - - /// Gets or sets the keyspace name. - [WirePath("keyspaceName")] - public string KeyspaceName { get; set; } - /// Gets or sets the table name. - [WirePath("tableName")] - public string TableName { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCreateOrUpdateContent.Serialization.cs index e46744332f7c..5e5d37c232dc 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCreateOrUpdateContent.Serialization.cs @@ -224,11 +224,6 @@ void IJsonModel.Write(Utf8JsonWriter write } writer.WriteEndArray(); } - if (Optional.IsDefined(DiagnosticLogSettings)) - { - writer.WritePropertyName("diagnosticLogSettings"u8); - writer.WriteObjectValue(DiagnosticLogSettings, options); - } if (Optional.IsDefined(DisableLocalAuth)) { writer.WritePropertyName("disableLocalAuth"u8); @@ -244,16 +239,6 @@ void IJsonModel.Write(Utf8JsonWriter write writer.WritePropertyName("capacity"u8); writer.WriteObjectValue(Capacity, options); } - if (Optional.IsDefined(CapacityMode)) - { - writer.WritePropertyName("capacityMode"u8); - writer.WriteStringValue(CapacityMode.Value.ToString()); - } - if (Optional.IsDefined(EnableMaterializedViews)) - { - writer.WritePropertyName("enableMaterializedViews"u8); - writer.WriteBooleanValue(EnableMaterializedViews.Value); - } if (options.Format != "W" && Optional.IsDefined(KeysMetadata)) { writer.WritePropertyName("keysMetadata"u8); @@ -264,36 +249,21 @@ void IJsonModel.Write(Utf8JsonWriter write writer.WritePropertyName("enablePartitionMerge"u8); writer.WriteBooleanValue(EnablePartitionMerge.Value); } - if (Optional.IsDefined(EnableBurstCapacity)) - { - writer.WritePropertyName("enableBurstCapacity"u8); - writer.WriteBooleanValue(EnableBurstCapacity.Value); - } if (Optional.IsDefined(MinimalTlsVersion)) { writer.WritePropertyName("minimalTlsVersion"u8); writer.WriteStringValue(MinimalTlsVersion.Value.ToString()); } + if (Optional.IsDefined(EnableBurstCapacity)) + { + writer.WritePropertyName("enableBurstCapacity"u8); + writer.WriteBooleanValue(EnableBurstCapacity.Value); + } if (Optional.IsDefined(CustomerManagedKeyStatus)) { writer.WritePropertyName("customerManagedKeyStatus"u8); writer.WriteStringValue(CustomerManagedKeyStatus); } - if (Optional.IsDefined(EnablePriorityBasedExecution)) - { - writer.WritePropertyName("enablePriorityBasedExecution"u8); - writer.WriteBooleanValue(EnablePriorityBasedExecution.Value); - } - if (Optional.IsDefined(DefaultPriorityLevel)) - { - writer.WritePropertyName("defaultPriorityLevel"u8); - writer.WriteStringValue(DefaultPriorityLevel.Value.ToString()); - } - if (Optional.IsDefined(EnablePerRegionPerPartitionAutoscale)) - { - writer.WritePropertyName("enablePerRegionPerPartitionAutoscale"u8); - writer.WriteBooleanValue(EnablePerRegionPerPartitionAutoscale.Value); - } writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -365,20 +335,14 @@ internal static CosmosDBAccountCreateOrUpdateContent DeserializeCosmosDBAccountC IList cors = default; NetworkAclBypass? networkAclBypass = default; IList networkAclBypassResourceIds = default; - DiagnosticLogSettings diagnosticLogSettings = default; bool? disableLocalAuth = default; CosmosDBAccountRestoreParameters restoreParameters = default; CosmosDBAccountCapacity capacity = default; - CapacityMode? capacityMode = default; - bool? enableMaterializedViews = default; DatabaseAccountKeysMetadata keysMetadata = default; bool? enablePartitionMerge = default; - bool? enableBurstCapacity = default; CosmosDBMinimalTlsVersion? minimalTlsVersion = default; + bool? enableBurstCapacity = default; string customerManagedKeyStatus = default; - bool? enablePriorityBasedExecution = default; - DefaultPriorityLevel? defaultPriorityLevel = default; - bool? enablePerRegionPerPartitionAutoscale = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -695,15 +659,6 @@ internal static CosmosDBAccountCreateOrUpdateContent DeserializeCosmosDBAccountC networkAclBypassResourceIds = array; continue; } - if (property0.NameEquals("diagnosticLogSettings"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - diagnosticLogSettings = DiagnosticLogSettings.DeserializeDiagnosticLogSettings(property0.Value, options); - continue; - } if (property0.NameEquals("disableLocalAuth"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -731,24 +686,6 @@ internal static CosmosDBAccountCreateOrUpdateContent DeserializeCosmosDBAccountC capacity = CosmosDBAccountCapacity.DeserializeCosmosDBAccountCapacity(property0.Value, options); continue; } - if (property0.NameEquals("capacityMode"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - capacityMode = new CapacityMode(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("enableMaterializedViews"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableMaterializedViews = property0.Value.GetBoolean(); - continue; - } if (property0.NameEquals("keysMetadata"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -767,15 +704,6 @@ internal static CosmosDBAccountCreateOrUpdateContent DeserializeCosmosDBAccountC enablePartitionMerge = property0.Value.GetBoolean(); continue; } - if (property0.NameEquals("enableBurstCapacity"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableBurstCapacity = property0.Value.GetBoolean(); - continue; - } if (property0.NameEquals("minimalTlsVersion"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -785,36 +713,18 @@ internal static CosmosDBAccountCreateOrUpdateContent DeserializeCosmosDBAccountC minimalTlsVersion = new CosmosDBMinimalTlsVersion(property0.Value.GetString()); continue; } - if (property0.NameEquals("customerManagedKeyStatus"u8)) - { - customerManagedKeyStatus = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("enablePriorityBasedExecution"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enablePriorityBasedExecution = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("defaultPriorityLevel"u8)) + if (property0.NameEquals("enableBurstCapacity"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - defaultPriorityLevel = new DefaultPriorityLevel(property0.Value.GetString()); + enableBurstCapacity = property0.Value.GetBoolean(); continue; } - if (property0.NameEquals("enablePerRegionPerPartitionAutoscale"u8)) + if (property0.NameEquals("customerManagedKeyStatus"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enablePerRegionPerPartitionAutoscale = property0.Value.GetBoolean(); + customerManagedKeyStatus = property0.Value.GetString(); continue; } } @@ -834,6 +744,7 @@ internal static CosmosDBAccountCreateOrUpdateContent DeserializeCosmosDBAccountC tags ?? new ChangeTrackingDictionary(), location, kind, + identity, consistencyPolicy, locations, databaseAccountOfferType, @@ -858,21 +769,14 @@ internal static CosmosDBAccountCreateOrUpdateContent DeserializeCosmosDBAccountC cors ?? new ChangeTrackingList(), networkAclBypass, networkAclBypassResourceIds ?? new ChangeTrackingList(), - diagnosticLogSettings, disableLocalAuth, restoreParameters, capacity, - capacityMode, - enableMaterializedViews, keysMetadata, enablePartitionMerge, - enableBurstCapacity, minimalTlsVersion, + enableBurstCapacity, customerManagedKeyStatus, - enablePriorityBasedExecution, - defaultPriorityLevel, - enablePerRegionPerPartitionAutoscale, - identity, serializedAdditionalRawData); } @@ -1456,26 +1360,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("DiagnosticLogEnableFullTextQuery", out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" diagnosticLogSettings: "); - builder.AppendLine("{"); - builder.AppendLine(" diagnosticLogSettings: {"); - builder.Append(" enableFullTextQuery: "); - builder.AppendLine(propertyOverride); - builder.AppendLine(" }"); - builder.AppendLine(" }"); - } - else - { - if (Optional.IsDefined(DiagnosticLogSettings)) - { - builder.Append(" diagnosticLogSettings: "); - BicepSerializationHelpers.AppendChildObject(builder, DiagnosticLogSettings, options, 4, false, " diagnosticLogSettings: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DisableLocalAuth), out propertyOverride); if (hasPropertyOverride) { @@ -1527,37 +1411,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CapacityMode), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" capacityMode: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(CapacityMode)) - { - builder.Append(" capacityMode: "); - builder.AppendLine($"'{CapacityMode.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnableMaterializedViews), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" enableMaterializedViews: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(EnableMaterializedViews)) - { - builder.Append(" enableMaterializedViews: "); - var boolValue = EnableMaterializedViews.Value == true ? "true" : "false"; - builder.AppendLine($"{boolValue}"); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(KeysMetadata), out propertyOverride); if (hasPropertyOverride) { @@ -1589,34 +1442,34 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnableBurstCapacity), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MinimalTlsVersion), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" enableBurstCapacity: "); + builder.Append(" minimalTlsVersion: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(EnableBurstCapacity)) + if (Optional.IsDefined(MinimalTlsVersion)) { - builder.Append(" enableBurstCapacity: "); - var boolValue = EnableBurstCapacity.Value == true ? "true" : "false"; - builder.AppendLine($"{boolValue}"); + builder.Append(" minimalTlsVersion: "); + builder.AppendLine($"'{MinimalTlsVersion.Value.ToString()}'"); } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MinimalTlsVersion), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnableBurstCapacity), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" minimalTlsVersion: "); + builder.Append(" enableBurstCapacity: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(MinimalTlsVersion)) + if (Optional.IsDefined(EnableBurstCapacity)) { - builder.Append(" minimalTlsVersion: "); - builder.AppendLine($"'{MinimalTlsVersion.Value.ToString()}'"); + builder.Append(" enableBurstCapacity: "); + var boolValue = EnableBurstCapacity.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); } } @@ -1643,53 +1496,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnablePriorityBasedExecution), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" enablePriorityBasedExecution: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(EnablePriorityBasedExecution)) - { - builder.Append(" enablePriorityBasedExecution: "); - var boolValue = EnablePriorityBasedExecution.Value == true ? "true" : "false"; - builder.AppendLine($"{boolValue}"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DefaultPriorityLevel), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" defaultPriorityLevel: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(DefaultPriorityLevel)) - { - builder.Append(" defaultPriorityLevel: "); - builder.AppendLine($"'{DefaultPriorityLevel.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnablePerRegionPerPartitionAutoscale), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" enablePerRegionPerPartitionAutoscale: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(EnablePerRegionPerPartitionAutoscale)) - { - builder.Append(" enablePerRegionPerPartitionAutoscale: "); - var boolValue = EnablePerRegionPerPartitionAutoscale.Value == true ? "true" : "false"; - builder.AppendLine($"{boolValue}"); - } - } - builder.AppendLine(" }"); builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCreateOrUpdateContent.cs index 6c115e78bc8e..762ba0719a9a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCreateOrUpdateContent.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCreateOrUpdateContent.cs @@ -73,6 +73,7 @@ public CosmosDBAccountCreateOrUpdateContent(AzureLocation location, IEnumerable< /// The tags. /// The location. /// Indicates the type of database account. This can only be set at database account creation. + /// Identity for the resource. /// The consistency policy for the Cosmos DB account. /// An array that contains the georeplication locations enabled for the Cosmos DB account. /// The offer type for the database. @@ -101,25 +102,19 @@ public CosmosDBAccountCreateOrUpdateContent(AzureLocation location, IEnumerable< /// The CORS policy for the Cosmos DB database account. /// Indicates what services are allowed to bypass firewall checks. /// An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. - /// The Object representing the different Diagnostic log settings for the Cosmos DB Account. /// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. /// Parameters to indicate the information about the restore. /// The object that represents all properties related to capacity enforcement on an account. - /// Indicates the capacityMode of the Cosmos DB account. - /// Flag to indicate whether to enable MaterializedViews on the Cosmos DB account. /// This property is ignored during the update/create operation, as the metadata is read-only. The object represents the metadata for the Account Keys of the Cosmos DB account. /// Flag to indicate enabling/disabling of Partition Merge feature on the account. - /// Flag to indicate enabling/disabling of Burst Capacity Preview feature on the account. - /// Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. + /// Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. + /// Flag to indicate enabling/disabling of Burst Capacity feature on the account. /// Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides troubleshooting guidance. - /// Flag to indicate enabling/disabling of Priority Based Execution Preview feature on the account. - /// Enum to indicate default Priority Level of request for Priority Based Execution. - /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account. - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CosmosDBAccountCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBAccountKind? kind, ConsistencyPolicy consistencyPolicy, IList locations, CosmosDBAccountOfferType databaseAccountOfferType, IList ipRules, bool? isVirtualNetworkFilterEnabled, bool? enableAutomaticFailover, IList capabilities, IList virtualNetworkRules, bool? enableMultipleWriteLocations, bool? enableCassandraConnector, ConnectorOffer? connectorOffer, bool? disableKeyBasedMetadataWriteAccess, Uri keyVaultKeyUri, string defaultIdentity, CosmosDBPublicNetworkAccess? publicNetworkAccess, bool? isFreeTierEnabled, ApiProperties apiProperties, bool? isAnalyticalStorageEnabled, AnalyticalStorageConfiguration analyticalStorageConfiguration, CosmosDBAccountCreateMode? createMode, CosmosDBAccountBackupPolicy backupPolicy, IList cors, NetworkAclBypass? networkAclBypass, IList networkAclBypassResourceIds, DiagnosticLogSettings diagnosticLogSettings, bool? disableLocalAuth, CosmosDBAccountRestoreParameters restoreParameters, CosmosDBAccountCapacity capacity, CapacityMode? capacityMode, bool? enableMaterializedViews, DatabaseAccountKeysMetadata keysMetadata, bool? enablePartitionMerge, bool? enableBurstCapacity, CosmosDBMinimalTlsVersion? minimalTlsVersion, string customerManagedKeyStatus, bool? enablePriorityBasedExecution, DefaultPriorityLevel? defaultPriorityLevel, bool? enablePerRegionPerPartitionAutoscale, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBAccountCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBAccountKind? kind, ManagedServiceIdentity identity, ConsistencyPolicy consistencyPolicy, IList locations, CosmosDBAccountOfferType databaseAccountOfferType, IList ipRules, bool? isVirtualNetworkFilterEnabled, bool? enableAutomaticFailover, IList capabilities, IList virtualNetworkRules, bool? enableMultipleWriteLocations, bool? enableCassandraConnector, ConnectorOffer? connectorOffer, bool? disableKeyBasedMetadataWriteAccess, Uri keyVaultKeyUri, string defaultIdentity, CosmosDBPublicNetworkAccess? publicNetworkAccess, bool? isFreeTierEnabled, ApiProperties apiProperties, bool? isAnalyticalStorageEnabled, AnalyticalStorageConfiguration analyticalStorageConfiguration, CosmosDBAccountCreateMode? createMode, CosmosDBAccountBackupPolicy backupPolicy, IList cors, NetworkAclBypass? networkAclBypass, IList networkAclBypassResourceIds, bool? disableLocalAuth, CosmosDBAccountRestoreParameters restoreParameters, CosmosDBAccountCapacity capacity, DatabaseAccountKeysMetadata keysMetadata, bool? enablePartitionMerge, CosmosDBMinimalTlsVersion? minimalTlsVersion, bool? enableBurstCapacity, string customerManagedKeyStatus, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Kind = kind; + Identity = identity; ConsistencyPolicy = consistencyPolicy; Locations = locations; DatabaseAccountOfferType = databaseAccountOfferType; @@ -144,21 +139,14 @@ internal CosmosDBAccountCreateOrUpdateContent(ResourceIdentifier id, string name Cors = cors; NetworkAclBypass = networkAclBypass; NetworkAclBypassResourceIds = networkAclBypassResourceIds; - DiagnosticLogSettings = diagnosticLogSettings; DisableLocalAuth = disableLocalAuth; RestoreParameters = restoreParameters; Capacity = capacity; - CapacityMode = capacityMode; - EnableMaterializedViews = enableMaterializedViews; KeysMetadata = keysMetadata; EnablePartitionMerge = enablePartitionMerge; - EnableBurstCapacity = enableBurstCapacity; MinimalTlsVersion = minimalTlsVersion; + EnableBurstCapacity = enableBurstCapacity; CustomerManagedKeyStatus = customerManagedKeyStatus; - EnablePriorityBasedExecution = enablePriorityBasedExecution; - DefaultPriorityLevel = defaultPriorityLevel; - EnablePerRegionPerPartitionAutoscale = enablePerRegionPerPartitionAutoscale; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -170,6 +158,9 @@ internal CosmosDBAccountCreateOrUpdateContent() /// Indicates the type of database account. This can only be set at database account creation. [WirePath("kind")] public CosmosDBAccountKind? Kind { get; set; } + /// Identity for the resource. + [WirePath("identity")] + public ManagedServiceIdentity Identity { get; set; } /// The consistency policy for the Cosmos DB account. [WirePath("properties.consistencyPolicy")] public ConsistencyPolicy ConsistencyPolicy { get; set; } @@ -217,7 +208,7 @@ internal CosmosDBAccountCreateOrUpdateContent() public bool? IsFreeTierEnabled { get; set; } /// API specific properties. Currently, supported only for MongoDB API. internal ApiProperties ApiProperties { get; set; } - /// Describes the ServerVersion of an a MongoDB account. + /// Describes the version of the MongoDB account. [WirePath("properties.apiProperties.serverVersion")] public CosmosDBServerVersion? ApiServerVersion { @@ -267,21 +258,6 @@ public AnalyticalStorageSchemaType? AnalyticalStorageSchemaType /// An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. [WirePath("properties.networkAclBypassResourceIds")] public IList NetworkAclBypassResourceIds { get; } - /// The Object representing the different Diagnostic log settings for the Cosmos DB Account. - internal DiagnosticLogSettings DiagnosticLogSettings { get; set; } - /// Describe the level of detail with which queries are to be logged. - [WirePath("properties.diagnosticLogSettings.enableFullTextQuery")] - public EnableFullTextQuery? DiagnosticLogEnableFullTextQuery - { - get => DiagnosticLogSettings is null ? default : DiagnosticLogSettings.EnableFullTextQuery; - set - { - if (DiagnosticLogSettings is null) - DiagnosticLogSettings = new DiagnosticLogSettings(); - DiagnosticLogSettings.EnableFullTextQuery = value; - } - } - /// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. [WirePath("properties.disableLocalAuth")] public bool? DisableLocalAuth { get; set; } @@ -303,38 +279,20 @@ public int? CapacityTotalThroughputLimit } } - /// Indicates the capacityMode of the Cosmos DB account. - [WirePath("properties.capacityMode")] - public CapacityMode? CapacityMode { get; set; } - /// Flag to indicate whether to enable MaterializedViews on the Cosmos DB account. - [WirePath("properties.enableMaterializedViews")] - public bool? EnableMaterializedViews { get; set; } /// This property is ignored during the update/create operation, as the metadata is read-only. The object represents the metadata for the Account Keys of the Cosmos DB account. [WirePath("properties.keysMetadata")] public DatabaseAccountKeysMetadata KeysMetadata { get; } /// Flag to indicate enabling/disabling of Partition Merge feature on the account. [WirePath("properties.enablePartitionMerge")] public bool? EnablePartitionMerge { get; set; } - /// Flag to indicate enabling/disabling of Burst Capacity Preview feature on the account. - [WirePath("properties.enableBurstCapacity")] - public bool? EnableBurstCapacity { get; set; } - /// Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. + /// Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. [WirePath("properties.minimalTlsVersion")] public CosmosDBMinimalTlsVersion? MinimalTlsVersion { get; set; } + /// Flag to indicate enabling/disabling of Burst Capacity feature on the account. + [WirePath("properties.enableBurstCapacity")] + public bool? EnableBurstCapacity { get; set; } /// Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides troubleshooting guidance. [WirePath("properties.customerManagedKeyStatus")] public string CustomerManagedKeyStatus { get; set; } - /// Flag to indicate enabling/disabling of Priority Based Execution Preview feature on the account. - [WirePath("properties.enablePriorityBasedExecution")] - public bool? EnablePriorityBasedExecution { get; set; } - /// Enum to indicate default Priority Level of request for Priority Based Execution. - [WirePath("properties.defaultPriorityLevel")] - public DefaultPriorityLevel? DefaultPriorityLevel { get; set; } - /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account. - [WirePath("properties.enablePerRegionPerPartitionAutoscale")] - public bool? EnablePerRegionPerPartitionAutoscale { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountPatch.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountPatch.Serialization.cs index 8112c3ba607c..4579463ab4ca 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountPatch.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountPatch.Serialization.cs @@ -196,11 +196,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr } writer.WriteEndArray(); } - if (Optional.IsDefined(DiagnosticLogSettings)) - { - writer.WritePropertyName("diagnosticLogSettings"u8); - writer.WriteObjectValue(DiagnosticLogSettings, options); - } if (Optional.IsDefined(DisableLocalAuth)) { writer.WritePropertyName("disableLocalAuth"u8); @@ -211,16 +206,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr writer.WritePropertyName("capacity"u8); writer.WriteObjectValue(Capacity, options); } - if (Optional.IsDefined(CapacityMode)) - { - writer.WritePropertyName("capacityMode"u8); - writer.WriteStringValue(CapacityMode.Value.ToString()); - } - if (Optional.IsDefined(EnableMaterializedViews)) - { - writer.WritePropertyName("enableMaterializedViews"u8); - writer.WriteBooleanValue(EnableMaterializedViews.Value); - } if (options.Format != "W" && Optional.IsDefined(KeysMetadata)) { writer.WritePropertyName("keysMetadata"u8); @@ -231,36 +216,21 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr writer.WritePropertyName("enablePartitionMerge"u8); writer.WriteBooleanValue(EnablePartitionMerge.Value); } - if (Optional.IsDefined(EnableBurstCapacity)) - { - writer.WritePropertyName("enableBurstCapacity"u8); - writer.WriteBooleanValue(EnableBurstCapacity.Value); - } if (Optional.IsDefined(MinimalTlsVersion)) { writer.WritePropertyName("minimalTlsVersion"u8); writer.WriteStringValue(MinimalTlsVersion.Value.ToString()); } + if (Optional.IsDefined(EnableBurstCapacity)) + { + writer.WritePropertyName("enableBurstCapacity"u8); + writer.WriteBooleanValue(EnableBurstCapacity.Value); + } if (Optional.IsDefined(CustomerManagedKeyStatus)) { writer.WritePropertyName("customerManagedKeyStatus"u8); writer.WriteStringValue(CustomerManagedKeyStatus); } - if (Optional.IsDefined(EnablePriorityBasedExecution)) - { - writer.WritePropertyName("enablePriorityBasedExecution"u8); - writer.WriteBooleanValue(EnablePriorityBasedExecution.Value); - } - if (Optional.IsDefined(DefaultPriorityLevel)) - { - writer.WritePropertyName("defaultPriorityLevel"u8); - writer.WriteStringValue(DefaultPriorityLevel.Value.ToString()); - } - if (Optional.IsDefined(EnablePerRegionPerPartitionAutoscale)) - { - writer.WritePropertyName("enablePerRegionPerPartitionAutoscale"u8); - writer.WriteBooleanValue(EnablePerRegionPerPartitionAutoscale.Value); - } writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -325,19 +295,13 @@ internal static CosmosDBAccountPatch DeserializeCosmosDBAccountPatch(JsonElement IList cors = default; NetworkAclBypass? networkAclBypass = default; IList networkAclBypassResourceIds = default; - DiagnosticLogSettings diagnosticLogSettings = default; bool? disableLocalAuth = default; CosmosDBAccountCapacity capacity = default; - CapacityMode? capacityMode = default; - bool? enableMaterializedViews = default; DatabaseAccountKeysMetadata keysMetadata = default; bool? enablePartitionMerge = default; - bool? enableBurstCapacity = default; CosmosDBMinimalTlsVersion? minimalTlsVersion = default; + bool? enableBurstCapacity = default; string customerManagedKeyStatus = default; - bool? enablePriorityBasedExecution = default; - DefaultPriorityLevel? defaultPriorityLevel = default; - bool? enablePerRegionPerPartitionAutoscale = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -615,15 +579,6 @@ internal static CosmosDBAccountPatch DeserializeCosmosDBAccountPatch(JsonElement networkAclBypassResourceIds = array; continue; } - if (property0.NameEquals("diagnosticLogSettings"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - diagnosticLogSettings = DiagnosticLogSettings.DeserializeDiagnosticLogSettings(property0.Value, options); - continue; - } if (property0.NameEquals("disableLocalAuth"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -642,24 +597,6 @@ internal static CosmosDBAccountPatch DeserializeCosmosDBAccountPatch(JsonElement capacity = CosmosDBAccountCapacity.DeserializeCosmosDBAccountCapacity(property0.Value, options); continue; } - if (property0.NameEquals("capacityMode"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - capacityMode = new CapacityMode(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("enableMaterializedViews"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableMaterializedViews = property0.Value.GetBoolean(); - continue; - } if (property0.NameEquals("keysMetadata"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -678,15 +615,6 @@ internal static CosmosDBAccountPatch DeserializeCosmosDBAccountPatch(JsonElement enablePartitionMerge = property0.Value.GetBoolean(); continue; } - if (property0.NameEquals("enableBurstCapacity"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableBurstCapacity = property0.Value.GetBoolean(); - continue; - } if (property0.NameEquals("minimalTlsVersion"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -696,36 +624,18 @@ internal static CosmosDBAccountPatch DeserializeCosmosDBAccountPatch(JsonElement minimalTlsVersion = new CosmosDBMinimalTlsVersion(property0.Value.GetString()); continue; } - if (property0.NameEquals("customerManagedKeyStatus"u8)) - { - customerManagedKeyStatus = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("enablePriorityBasedExecution"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enablePriorityBasedExecution = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("defaultPriorityLevel"u8)) + if (property0.NameEquals("enableBurstCapacity"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - defaultPriorityLevel = new DefaultPriorityLevel(property0.Value.GetString()); + enableBurstCapacity = property0.Value.GetBoolean(); continue; } - if (property0.NameEquals("enablePerRegionPerPartitionAutoscale"u8)) + if (property0.NameEquals("customerManagedKeyStatus"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enablePerRegionPerPartitionAutoscale = property0.Value.GetBoolean(); + customerManagedKeyStatus = property0.Value.GetString(); continue; } } @@ -763,19 +673,13 @@ internal static CosmosDBAccountPatch DeserializeCosmosDBAccountPatch(JsonElement cors ?? new ChangeTrackingList(), networkAclBypass, networkAclBypassResourceIds ?? new ChangeTrackingList(), - diagnosticLogSettings, disableLocalAuth, capacity, - capacityMode, - enableMaterializedViews, keysMetadata, enablePartitionMerge, - enableBurstCapacity, minimalTlsVersion, + enableBurstCapacity, customerManagedKeyStatus, - enablePriorityBasedExecution, - defaultPriorityLevel, - enablePerRegionPerPartitionAutoscale, serializedAdditionalRawData); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountPatch.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountPatch.cs index 7ad706668b4e..0ef971dd39fa 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountPatch.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountPatch.cs @@ -89,21 +89,15 @@ public CosmosDBAccountPatch() /// The CORS policy for the Cosmos DB database account. /// Indicates what services are allowed to bypass firewall checks. /// An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. - /// The Object representing the different Diagnostic log settings for the Cosmos DB Account. /// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. /// The object that represents all properties related to capacity enforcement on an account. - /// Indicates the capacityMode of the Cosmos DB account. - /// Flag to indicate whether to enable MaterializedViews on the Cosmos DB account. /// This property is ignored during the update operation, as the metadata is read-only. The object represents the metadata for the Account Keys of the Cosmos DB account. /// Flag to indicate enabling/disabling of Partition Merge feature on the account. - /// Flag to indicate enabling/disabling of Burst Capacity Preview feature on the account. - /// Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. + /// Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. + /// Flag to indicate enabling/disabling of Burst Capacity feature on the account. /// Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides troubleshooting guidance. - /// Flag to indicate enabling/disabling of Priority Based Execution Preview feature on the account. - /// Enum to indicate default Priority Level of request for Priority Based Execution. - /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account. /// Keeps track of any properties unknown to the library. - internal CosmosDBAccountPatch(IDictionary tags, AzureLocation? location, ManagedServiceIdentity identity, ConsistencyPolicy consistencyPolicy, IList locations, IList ipRules, bool? isVirtualNetworkFilterEnabled, bool? enableAutomaticFailover, IList capabilities, IList virtualNetworkRules, bool? enableMultipleWriteLocations, bool? enableCassandraConnector, ConnectorOffer? connectorOffer, bool? disableKeyBasedMetadataWriteAccess, Uri keyVaultKeyUri, string defaultIdentity, CosmosDBPublicNetworkAccess? publicNetworkAccess, bool? isFreeTierEnabled, ApiProperties apiProperties, bool? isAnalyticalStorageEnabled, AnalyticalStorageConfiguration analyticalStorageConfiguration, CosmosDBAccountBackupPolicy backupPolicy, IList cors, NetworkAclBypass? networkAclBypass, IList networkAclBypassResourceIds, DiagnosticLogSettings diagnosticLogSettings, bool? disableLocalAuth, CosmosDBAccountCapacity capacity, CapacityMode? capacityMode, bool? enableMaterializedViews, DatabaseAccountKeysMetadata keysMetadata, bool? enablePartitionMerge, bool? enableBurstCapacity, CosmosDBMinimalTlsVersion? minimalTlsVersion, string customerManagedKeyStatus, bool? enablePriorityBasedExecution, DefaultPriorityLevel? defaultPriorityLevel, bool? enablePerRegionPerPartitionAutoscale, IDictionary serializedAdditionalRawData) + internal CosmosDBAccountPatch(IDictionary tags, AzureLocation? location, ManagedServiceIdentity identity, ConsistencyPolicy consistencyPolicy, IList locations, IList ipRules, bool? isVirtualNetworkFilterEnabled, bool? enableAutomaticFailover, IList capabilities, IList virtualNetworkRules, bool? enableMultipleWriteLocations, bool? enableCassandraConnector, ConnectorOffer? connectorOffer, bool? disableKeyBasedMetadataWriteAccess, Uri keyVaultKeyUri, string defaultIdentity, CosmosDBPublicNetworkAccess? publicNetworkAccess, bool? isFreeTierEnabled, ApiProperties apiProperties, bool? isAnalyticalStorageEnabled, AnalyticalStorageConfiguration analyticalStorageConfiguration, CosmosDBAccountBackupPolicy backupPolicy, IList cors, NetworkAclBypass? networkAclBypass, IList networkAclBypassResourceIds, bool? disableLocalAuth, CosmosDBAccountCapacity capacity, DatabaseAccountKeysMetadata keysMetadata, bool? enablePartitionMerge, CosmosDBMinimalTlsVersion? minimalTlsVersion, bool? enableBurstCapacity, string customerManagedKeyStatus, IDictionary serializedAdditionalRawData) { Tags = tags; Location = location; @@ -130,19 +124,13 @@ internal CosmosDBAccountPatch(IDictionary tags, AzureLocation? l Cors = cors; NetworkAclBypass = networkAclBypass; NetworkAclBypassResourceIds = networkAclBypassResourceIds; - DiagnosticLogSettings = diagnosticLogSettings; DisableLocalAuth = disableLocalAuth; Capacity = capacity; - CapacityMode = capacityMode; - EnableMaterializedViews = enableMaterializedViews; KeysMetadata = keysMetadata; EnablePartitionMerge = enablePartitionMerge; - EnableBurstCapacity = enableBurstCapacity; MinimalTlsVersion = minimalTlsVersion; + EnableBurstCapacity = enableBurstCapacity; CustomerManagedKeyStatus = customerManagedKeyStatus; - EnablePriorityBasedExecution = enablePriorityBasedExecution; - DefaultPriorityLevel = defaultPriorityLevel; - EnablePerRegionPerPartitionAutoscale = enablePerRegionPerPartitionAutoscale; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -202,7 +190,7 @@ internal CosmosDBAccountPatch(IDictionary tags, AzureLocation? l public bool? IsFreeTierEnabled { get; set; } /// API specific properties. Currently, supported only for MongoDB API. internal ApiProperties ApiProperties { get; set; } - /// Describes the ServerVersion of an a MongoDB account. + /// Describes the version of the MongoDB account. [WirePath("properties.apiProperties.serverVersion")] public CosmosDBServerVersion? ApiServerVersion { @@ -249,21 +237,6 @@ public AnalyticalStorageSchemaType? AnalyticalStorageSchemaType /// An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. [WirePath("properties.networkAclBypassResourceIds")] public IList NetworkAclBypassResourceIds { get; } - /// The Object representing the different Diagnostic log settings for the Cosmos DB Account. - internal DiagnosticLogSettings DiagnosticLogSettings { get; set; } - /// Describe the level of detail with which queries are to be logged. - [WirePath("properties.diagnosticLogSettings.enableFullTextQuery")] - public EnableFullTextQuery? DiagnosticLogEnableFullTextQuery - { - get => DiagnosticLogSettings is null ? default : DiagnosticLogSettings.EnableFullTextQuery; - set - { - if (DiagnosticLogSettings is null) - DiagnosticLogSettings = new DiagnosticLogSettings(); - DiagnosticLogSettings.EnableFullTextQuery = value; - } - } - /// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. [WirePath("properties.disableLocalAuth")] public bool? DisableLocalAuth { get; set; } @@ -282,35 +255,20 @@ public int? CapacityTotalThroughputLimit } } - /// Indicates the capacityMode of the Cosmos DB account. - [WirePath("properties.capacityMode")] - public CapacityMode? CapacityMode { get; set; } - /// Flag to indicate whether to enable MaterializedViews on the Cosmos DB account. - [WirePath("properties.enableMaterializedViews")] - public bool? EnableMaterializedViews { get; set; } /// This property is ignored during the update operation, as the metadata is read-only. The object represents the metadata for the Account Keys of the Cosmos DB account. [WirePath("properties.keysMetadata")] public DatabaseAccountKeysMetadata KeysMetadata { get; } /// Flag to indicate enabling/disabling of Partition Merge feature on the account. [WirePath("properties.enablePartitionMerge")] public bool? EnablePartitionMerge { get; set; } - /// Flag to indicate enabling/disabling of Burst Capacity Preview feature on the account. - [WirePath("properties.enableBurstCapacity")] - public bool? EnableBurstCapacity { get; set; } - /// Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. + /// Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. [WirePath("properties.minimalTlsVersion")] public CosmosDBMinimalTlsVersion? MinimalTlsVersion { get; set; } + /// Flag to indicate enabling/disabling of Burst Capacity feature on the account. + [WirePath("properties.enableBurstCapacity")] + public bool? EnableBurstCapacity { get; set; } /// Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides troubleshooting guidance. [WirePath("properties.customerManagedKeyStatus")] public string CustomerManagedKeyStatus { get; set; } - /// Flag to indicate enabling/disabling of Priority Based Execution Preview feature on the account. - [WirePath("properties.enablePriorityBasedExecution")] - public bool? EnablePriorityBasedExecution { get; set; } - /// Enum to indicate default Priority Level of request for Priority Based Execution. - [WirePath("properties.defaultPriorityLevel")] - public DefaultPriorityLevel? DefaultPriorityLevel { get; set; } - /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account. - [WirePath("properties.enablePerRegionPerPartitionAutoscale")] - public bool? EnablePerRegionPerPartitionAutoscale { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountRestoreParameters.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountRestoreParameters.Serialization.cs index 7385cc676e8b..0e420c9273c2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountRestoreParameters.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountRestoreParameters.Serialization.cs @@ -63,11 +63,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, M } writer.WriteEndArray(); } - if (Optional.IsDefined(SourceBackupLocation)) - { - writer.WritePropertyName("sourceBackupLocation"u8); - writer.WriteStringValue(SourceBackupLocation); - } if (Optional.IsDefined(RestoreSource)) { writer.WritePropertyName("restoreSource"u8); @@ -125,7 +120,6 @@ internal static CosmosDBAccountRestoreParameters DeserializeCosmosDBAccountResto IList databasesToRestore = default; IList gremlinDatabasesToRestore = default; IList tablesToRestore = default; - string sourceBackupLocation = default; string restoreSource = default; DateTimeOffset? restoreTimestampInUtc = default; bool? restoreWithTtlDisabled = default; @@ -184,11 +178,6 @@ internal static CosmosDBAccountRestoreParameters DeserializeCosmosDBAccountResto tablesToRestore = array; continue; } - if (property.NameEquals("sourceBackupLocation"u8)) - { - sourceBackupLocation = property.Value.GetString(); - continue; - } if (property.NameEquals("restoreSource"u8)) { restoreSource = property.Value.GetString(); @@ -226,8 +215,7 @@ internal static CosmosDBAccountRestoreParameters DeserializeCosmosDBAccountResto restoreMode, databasesToRestore ?? new ChangeTrackingList(), gremlinDatabasesToRestore ?? new ChangeTrackingList(), - tablesToRestore ?? new ChangeTrackingList(), - sourceBackupLocation); + tablesToRestore ?? new ChangeTrackingList()); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -338,29 +326,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SourceBackupLocation), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" sourceBackupLocation: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SourceBackupLocation)) - { - builder.Append(" sourceBackupLocation: "); - if (SourceBackupLocation.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{SourceBackupLocation}'''"); - } - else - { - builder.AppendLine($"'{SourceBackupLocation}'"); - } - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RestoreSource), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountRestoreParameters.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountRestoreParameters.cs index 11c9f08a794e..0baf944cb56e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountRestoreParameters.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountRestoreParameters.cs @@ -30,14 +30,12 @@ public CosmosDBAccountRestoreParameters() /// List of specific databases available for restore. /// List of specific gremlin databases available for restore. /// List of specific tables available for restore. - /// The source backup location for restore. - internal CosmosDBAccountRestoreParameters(string restoreSource, DateTimeOffset? restoreTimestampInUtc, bool? isRestoreWithTtlDisabled, IDictionary serializedAdditionalRawData, CosmosDBAccountRestoreMode? restoreMode, IList databasesToRestore, IList gremlinDatabasesToRestore, IList tablesToRestore, string sourceBackupLocation) : base(restoreSource, restoreTimestampInUtc, isRestoreWithTtlDisabled, serializedAdditionalRawData) + internal CosmosDBAccountRestoreParameters(string restoreSource, DateTimeOffset? restoreTimestampInUtc, bool? isRestoreWithTtlDisabled, IDictionary serializedAdditionalRawData, CosmosDBAccountRestoreMode? restoreMode, IList databasesToRestore, IList gremlinDatabasesToRestore, IList tablesToRestore) : base(restoreSource, restoreTimestampInUtc, isRestoreWithTtlDisabled, serializedAdditionalRawData) { RestoreMode = restoreMode; DatabasesToRestore = databasesToRestore; GremlinDatabasesToRestore = gremlinDatabasesToRestore; TablesToRestore = tablesToRestore; - SourceBackupLocation = sourceBackupLocation; } /// Describes the mode of the restore. @@ -52,8 +50,5 @@ internal CosmosDBAccountRestoreParameters(string restoreSource, DateTimeOffset? /// List of specific tables available for restore. [WirePath("tablesToRestore")] public IList TablesToRestore { get; } - /// The source backup location for restore. - [WirePath("sourceBackupLocation")] - public string SourceBackupLocation { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBErrorResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBErrorResult.Serialization.cs deleted file mode 100644 index df618d0989e8..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBErrorResult.Serialization.cs +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CosmosDBErrorResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosDBErrorResult)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Code)) - { - writer.WritePropertyName("code"u8); - writer.WriteStringValue(Code); - } - if (Optional.IsDefined(Message)) - { - writer.WritePropertyName("message"u8); - writer.WriteStringValue(Message); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - CosmosDBErrorResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosDBErrorResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCosmosDBErrorResult(document.RootElement, options); - } - - internal static CosmosDBErrorResult DeserializeCosmosDBErrorResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string code = default; - string message = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("code"u8)) - { - code = property.Value.GetString(); - continue; - } - if (property.NameEquals("message"u8)) - { - message = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CosmosDBErrorResult(code, message, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Code), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" code: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Code)) - { - builder.Append(" code: "); - if (Code.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Code}'''"); - } - else - { - builder.AppendLine($"'{Code}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Message), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" message: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Message)) - { - builder.Append(" message: "); - if (Message.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Message}'''"); - } - else - { - builder.AppendLine($"'{Message}'"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CosmosDBErrorResult)} does not support writing '{options.Format}' format."); - } - } - - CosmosDBErrorResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCosmosDBErrorResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CosmosDBErrorResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMinimalTlsVersion.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMinimalTlsVersion.cs index 3e67dfb92ab5..83f24759ffe0 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMinimalTlsVersion.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMinimalTlsVersion.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.CosmosDB.Models { - /// Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. + /// Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. public readonly partial struct CosmosDBMinimalTlsVersion : IEquatable { private readonly string _value; diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBServerVersion.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBServerVersion.cs index ea66badc581d..d811274dfe15 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBServerVersion.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBServerVersion.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.CosmosDB.Models { - /// Describes the ServerVersion of an a MongoDB account. + /// Describes the version of the MongoDB account. public readonly partial struct CosmosDBServerVersion : IEquatable { private readonly string _value; @@ -28,10 +28,13 @@ public CosmosDBServerVersion(string value) private const string V4_2Value = "4.2"; private const string Five0Value = "5.0"; private const string Six0Value = "6.0"; + private const string Seven0Value = "7.0"; /// 5.0. public static CosmosDBServerVersion Five0 { get; } = new CosmosDBServerVersion(Five0Value); /// 6.0. public static CosmosDBServerVersion Six0 { get; } = new CosmosDBServerVersion(Six0Value); + /// 7.0. + public static CosmosDBServerVersion Seven0 { get; } = new CosmosDBServerVersion(Seven0Value); /// Determines if two values are the same. public static bool operator ==(CosmosDBServerVersion left, CosmosDBServerVersion right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerCreateOrUpdateContent.Serialization.cs index 3dea4a88918d..f60fb3bdb70a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerCreateOrUpdateContent.Serialization.cs @@ -29,12 +29,6 @@ void IJsonModel.Write(Utf8JsonWriter } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -116,7 +110,6 @@ internal static CosmosDBSqlContainerCreateOrUpdateContent DeserializeCosmosDBSql { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -129,16 +122,6 @@ internal static CosmosDBSqlContainerCreateOrUpdateContent DeserializeCosmosDBSql Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -223,7 +206,6 @@ internal static CosmosDBSqlContainerCreateOrUpdateContent DeserializeCosmosDBSql location, resource, options0, - identity, serializedAdditionalRawData); } @@ -310,21 +292,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerCreateOrUpdateContent.cs index 93ebed35b8c1..bc52ada406d3 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerCreateOrUpdateContent.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerCreateOrUpdateContent.cs @@ -67,13 +67,11 @@ public CosmosDBSqlContainerCreateOrUpdateContent(AzureLocation location, CosmosD /// The location. /// The standard JSON format of a container. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CosmosDBSqlContainerCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBSqlContainerResourceInfo resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBSqlContainerCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBSqlContainerResourceInfo resource, CosmosDBCreateUpdateConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -88,8 +86,5 @@ internal CosmosDBSqlContainerCreateOrUpdateContent() /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. [WirePath("properties.options")] public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.Serialization.cs index 320d288e1805..4aec24635215 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.Serialization.cs @@ -75,11 +75,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, M writer.WritePropertyName("createMode"u8); writer.WriteStringValue(CreateMode.Value.ToString()); } - if (Optional.IsDefined(MaterializedViewDefinition)) - { - writer.WritePropertyName("materializedViewDefinition"u8); - writer.WriteObjectValue(MaterializedViewDefinition, options); - } if (Optional.IsCollectionDefined(ComputedProperties)) { writer.WritePropertyName("computedProperties"u8); @@ -138,7 +133,6 @@ internal static CosmosDBSqlContainerResourceInfo DeserializeCosmosDBSqlContainer long? analyticalStorageTtl = default; ResourceRestoreParameters restoreParameters = default; CosmosDBAccountCreateMode? createMode = default; - MaterializedViewDefinition materializedViewDefinition = default; IList computedProperties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -230,15 +224,6 @@ internal static CosmosDBSqlContainerResourceInfo DeserializeCosmosDBSqlContainer createMode = new CosmosDBAccountCreateMode(property.Value.GetString()); continue; } - if (property.NameEquals("materializedViewDefinition"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - materializedViewDefinition = MaterializedViewDefinition.DeserializeMaterializedViewDefinition(property.Value, options); - continue; - } if (property.NameEquals("computedProperties"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -270,7 +255,6 @@ internal static CosmosDBSqlContainerResourceInfo DeserializeCosmosDBSqlContainer analyticalStorageTtl, restoreParameters, createMode, - materializedViewDefinition, computedProperties ?? new ChangeTrackingList(), serializedAdditionalRawData); } @@ -447,21 +431,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MaterializedViewDefinition), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" materializedViewDefinition: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(MaterializedViewDefinition)) - { - builder.Append(" materializedViewDefinition: "); - BicepSerializationHelpers.AppendChildObject(builder, MaterializedViewDefinition, options, 2, false, " materializedViewDefinition: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ComputedProperties), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.cs index cc6c3aeda029..5b923aa15943 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.cs @@ -67,10 +67,9 @@ public CosmosDBSqlContainerResourceInfo(string containerName) /// Analytical TTL. /// Parameters to indicate the information about the restore. /// Enum to indicate the mode of resource creation. - /// The configuration for defining Materialized Views. This must be specified only for creating a Materialized View container. /// List of computed properties. /// Keeps track of any properties unknown to the library. - internal CosmosDBSqlContainerResourceInfo(string containerName, CosmosDBIndexingPolicy indexingPolicy, CosmosDBContainerPartitionKey partitionKey, int? defaultTtl, CosmosDBUniqueKeyPolicy uniqueKeyPolicy, ConflictResolutionPolicy conflictResolutionPolicy, CosmosDBClientEncryptionPolicy clientEncryptionPolicy, long? analyticalStorageTtl, ResourceRestoreParameters restoreParameters, CosmosDBAccountCreateMode? createMode, MaterializedViewDefinition materializedViewDefinition, IList computedProperties, IDictionary serializedAdditionalRawData) + internal CosmosDBSqlContainerResourceInfo(string containerName, CosmosDBIndexingPolicy indexingPolicy, CosmosDBContainerPartitionKey partitionKey, int? defaultTtl, CosmosDBUniqueKeyPolicy uniqueKeyPolicy, ConflictResolutionPolicy conflictResolutionPolicy, CosmosDBClientEncryptionPolicy clientEncryptionPolicy, long? analyticalStorageTtl, ResourceRestoreParameters restoreParameters, CosmosDBAccountCreateMode? createMode, IList computedProperties, IDictionary serializedAdditionalRawData) { ContainerName = containerName; IndexingPolicy = indexingPolicy; @@ -82,7 +81,6 @@ internal CosmosDBSqlContainerResourceInfo(string containerName, CosmosDBIndexing AnalyticalStorageTtl = analyticalStorageTtl; RestoreParameters = restoreParameters; CreateMode = createMode; - MaterializedViewDefinition = materializedViewDefinition; ComputedProperties = computedProperties; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -133,9 +131,6 @@ public IList UniqueKeys /// Enum to indicate the mode of resource creation. [WirePath("createMode")] public CosmosDBAccountCreateMode? CreateMode { get; set; } - /// The configuration for defining Materialized Views. This must be specified only for creating a Materialized View container. - [WirePath("materializedViewDefinition")] - public MaterializedViewDefinition MaterializedViewDefinition { get; set; } /// List of computed properties. [WirePath("computedProperties")] public IList ComputedProperties { get; } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlDatabaseCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlDatabaseCreateOrUpdateContent.Serialization.cs index cb33383f6dd1..cdbc6f80167b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlDatabaseCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlDatabaseCreateOrUpdateContent.Serialization.cs @@ -29,12 +29,6 @@ void IJsonModel.Write(Utf8JsonWriter w } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -116,7 +110,6 @@ internal static CosmosDBSqlDatabaseCreateOrUpdateContent DeserializeCosmosDBSqlD { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -129,16 +122,6 @@ internal static CosmosDBSqlDatabaseCreateOrUpdateContent DeserializeCosmosDBSqlD Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -223,7 +206,6 @@ internal static CosmosDBSqlDatabaseCreateOrUpdateContent DeserializeCosmosDBSqlD location, resource, options0, - identity, serializedAdditionalRawData); } @@ -310,21 +292,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlDatabaseCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlDatabaseCreateOrUpdateContent.cs index 4ad9a4132deb..1c5cb4ee68d1 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlDatabaseCreateOrUpdateContent.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlDatabaseCreateOrUpdateContent.cs @@ -67,13 +67,11 @@ public CosmosDBSqlDatabaseCreateOrUpdateContent(AzureLocation location, CosmosDB /// The location. /// The standard JSON format of a SQL database. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CosmosDBSqlDatabaseCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBSqlDatabaseResourceInfo resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBSqlDatabaseCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBSqlDatabaseResourceInfo resource, CosmosDBCreateUpdateConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -88,8 +86,5 @@ internal CosmosDBSqlDatabaseCreateOrUpdateContent() /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. [WirePath("properties.options")] public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlStoredProcedureCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlStoredProcedureCreateOrUpdateContent.Serialization.cs index 4733d4d938ad..770e3f624ded 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlStoredProcedureCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlStoredProcedureCreateOrUpdateContent.Serialization.cs @@ -29,12 +29,6 @@ void IJsonModel.Write(Utf8JsonW } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -116,7 +110,6 @@ internal static CosmosDBSqlStoredProcedureCreateOrUpdateContent DeserializeCosmo { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -129,16 +122,6 @@ internal static CosmosDBSqlStoredProcedureCreateOrUpdateContent DeserializeCosmo Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -223,7 +206,6 @@ internal static CosmosDBSqlStoredProcedureCreateOrUpdateContent DeserializeCosmo location, resource, options0, - identity, serializedAdditionalRawData); } @@ -310,21 +292,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlStoredProcedureCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlStoredProcedureCreateOrUpdateContent.cs index 2cfc40ab5dfa..cd8b59e13e7b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlStoredProcedureCreateOrUpdateContent.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlStoredProcedureCreateOrUpdateContent.cs @@ -67,13 +67,11 @@ public CosmosDBSqlStoredProcedureCreateOrUpdateContent(AzureLocation location, C /// The location. /// The standard JSON format of a storedProcedure. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CosmosDBSqlStoredProcedureCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBSqlStoredProcedureResourceInfo resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBSqlStoredProcedureCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBSqlStoredProcedureResourceInfo resource, CosmosDBCreateUpdateConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -88,8 +86,5 @@ internal CosmosDBSqlStoredProcedureCreateOrUpdateContent() /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. [WirePath("properties.options")] public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlTriggerCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlTriggerCreateOrUpdateContent.Serialization.cs index 043b0e925b5b..91c7ac55f98c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlTriggerCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlTriggerCreateOrUpdateContent.Serialization.cs @@ -29,12 +29,6 @@ void IJsonModel.Write(Utf8JsonWriter wr } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -116,7 +110,6 @@ internal static CosmosDBSqlTriggerCreateOrUpdateContent DeserializeCosmosDBSqlTr { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -129,16 +122,6 @@ internal static CosmosDBSqlTriggerCreateOrUpdateContent DeserializeCosmosDBSqlTr Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -223,7 +206,6 @@ internal static CosmosDBSqlTriggerCreateOrUpdateContent DeserializeCosmosDBSqlTr location, resource, options0, - identity, serializedAdditionalRawData); } @@ -310,21 +292,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlTriggerCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlTriggerCreateOrUpdateContent.cs index b5ec82f9849f..890b4b29a41d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlTriggerCreateOrUpdateContent.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlTriggerCreateOrUpdateContent.cs @@ -67,13 +67,11 @@ public CosmosDBSqlTriggerCreateOrUpdateContent(AzureLocation location, CosmosDBS /// The location. /// The standard JSON format of a trigger. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CosmosDBSqlTriggerCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBSqlTriggerResourceInfo resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBSqlTriggerCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBSqlTriggerResourceInfo resource, CosmosDBCreateUpdateConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -88,8 +86,5 @@ internal CosmosDBSqlTriggerCreateOrUpdateContent() /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. [WirePath("properties.options")] public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent.Serialization.cs index 95ede0aab61a..3d081967480b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent.Serialization.cs @@ -29,12 +29,6 @@ void IJsonModel.Write(Utf8J } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -116,7 +110,6 @@ internal static CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent DeserializeC { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -129,16 +122,6 @@ internal static CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent DeserializeC Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -223,7 +206,6 @@ internal static CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent DeserializeC location, resource, options0, - identity, serializedAdditionalRawData); } @@ -310,21 +292,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent.cs index 9091d7a2d98e..8ff656a56c9c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent.cs @@ -67,13 +67,11 @@ public CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent(AzureLocation locatio /// The location. /// The standard JSON format of a userDefinedFunction. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBSqlUserDefinedFunctionResourceInfo resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBSqlUserDefinedFunctionResourceInfo resource, CosmosDBCreateUpdateConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -88,8 +86,5 @@ internal CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent() /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. [WirePath("properties.options")] public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBStatus.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBStatus.cs index 9e605c21a6e6..865f28812ba7 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBStatus.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBStatus.cs @@ -27,10 +27,6 @@ public CosmosDBStatus(string value) private const string InternallyReadyValue = "InternallyReady"; private const string OnlineValue = "Online"; private const string DeletingValue = "Deleting"; - private const string SucceededValue = "Succeeded"; - private const string FailedValue = "Failed"; - private const string CanceledValue = "Canceled"; - private const string UpdatingValue = "Updating"; /// Uninitialized. public static CosmosDBStatus Uninitialized { get; } = new CosmosDBStatus(UninitializedValue); @@ -42,14 +38,6 @@ public CosmosDBStatus(string value) public static CosmosDBStatus Online { get; } = new CosmosDBStatus(OnlineValue); /// Deleting. public static CosmosDBStatus Deleting { get; } = new CosmosDBStatus(DeletingValue); - /// Succeeded. - public static CosmosDBStatus Succeeded { get; } = new CosmosDBStatus(SucceededValue); - /// Failed. - public static CosmosDBStatus Failed { get; } = new CosmosDBStatus(FailedValue); - /// Canceled. - public static CosmosDBStatus Canceled { get; } = new CosmosDBStatus(CanceledValue); - /// Updating. - public static CosmosDBStatus Updating { get; } = new CosmosDBStatus(UpdatingValue); /// Determines if two values are the same. public static bool operator ==(CosmosDBStatus left, CosmosDBStatus right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableCreateOrUpdateContent.Serialization.cs index 87c96d666096..a48e4d1c76ad 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableCreateOrUpdateContent.Serialization.cs @@ -29,12 +29,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -116,7 +110,6 @@ internal static CosmosDBTableCreateOrUpdateContent DeserializeCosmosDBTableCreat { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -129,16 +122,6 @@ internal static CosmosDBTableCreateOrUpdateContent DeserializeCosmosDBTableCreat Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -223,7 +206,6 @@ internal static CosmosDBTableCreateOrUpdateContent DeserializeCosmosDBTableCreat location, resource, options0, - identity, serializedAdditionalRawData); } @@ -310,21 +292,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableCreateOrUpdateContent.cs index ef312eb5d395..4d9b419dd115 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableCreateOrUpdateContent.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableCreateOrUpdateContent.cs @@ -67,13 +67,11 @@ public CosmosDBTableCreateOrUpdateContent(AzureLocation location, CosmosDBTableR /// The location. /// The standard JSON format of a Table. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CosmosDBTableCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBTableResourceInfo resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBTableCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBTableResourceInfo resource, CosmosDBCreateUpdateConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -88,8 +86,5 @@ internal CosmosDBTableCreateOrUpdateContent() /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. [WirePath("properties.options")] public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBThroughputPoolPatch.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBThroughputPoolPatch.Serialization.cs deleted file mode 100644 index 5a27e018de6a..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBThroughputPoolPatch.Serialization.cs +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CosmosDBThroughputPoolPatch : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosDBThroughputPoolPatch)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - if (Optional.IsDefined(MaxThroughput)) - { - writer.WritePropertyName("maxThroughput"u8); - writer.WriteNumberValue(MaxThroughput.Value); - } - writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - CosmosDBThroughputPoolPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosDBThroughputPoolPatch)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCosmosDBThroughputPoolPatch(document.RootElement, options); - } - - internal static CosmosDBThroughputPoolPatch DeserializeCosmosDBThroughputPoolPatch(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - CosmosDBStatus? provisioningState = default; - int? maxThroughput = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("provisioningState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new CosmosDBStatus(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("maxThroughput"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - maxThroughput = property0.Value.GetInt32(); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CosmosDBThroughputPoolPatch(provisioningState, maxThroughput, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(CosmosDBThroughputPoolPatch)} does not support writing '{options.Format}' format."); - } - } - - CosmosDBThroughputPoolPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCosmosDBThroughputPoolPatch(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CosmosDBThroughputPoolPatch)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosMongoDataTransferDataSourceSink.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosMongoDataTransferDataSourceSink.Serialization.cs deleted file mode 100644 index c853f46f4ba6..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosMongoDataTransferDataSourceSink.Serialization.cs +++ /dev/null @@ -1,245 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CosmosMongoDataTransferDataSourceSink : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosMongoDataTransferDataSourceSink)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("databaseName"u8); - writer.WriteStringValue(DatabaseName); - writer.WritePropertyName("collectionName"u8); - writer.WriteStringValue(CollectionName); - if (Optional.IsDefined(RemoteAccountName)) - { - writer.WritePropertyName("remoteAccountName"u8); - writer.WriteStringValue(RemoteAccountName); - } - writer.WritePropertyName("component"u8); - writer.WriteStringValue(Component.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - CosmosMongoDataTransferDataSourceSink IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosMongoDataTransferDataSourceSink)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCosmosMongoDataTransferDataSourceSink(document.RootElement, options); - } - - internal static CosmosMongoDataTransferDataSourceSink DeserializeCosmosMongoDataTransferDataSourceSink(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string databaseName = default; - string collectionName = default; - string remoteAccountName = default; - DataTransferComponent component = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("databaseName"u8)) - { - databaseName = property.Value.GetString(); - continue; - } - if (property.NameEquals("collectionName"u8)) - { - collectionName = property.Value.GetString(); - continue; - } - if (property.NameEquals("remoteAccountName"u8)) - { - remoteAccountName = property.Value.GetString(); - continue; - } - if (property.NameEquals("component"u8)) - { - component = new DataTransferComponent(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CosmosMongoDataTransferDataSourceSink(component, serializedAdditionalRawData, remoteAccountName, databaseName, collectionName); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DatabaseName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" databaseName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(DatabaseName)) - { - builder.Append(" databaseName: "); - if (DatabaseName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{DatabaseName}'''"); - } - else - { - builder.AppendLine($"'{DatabaseName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CollectionName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" collectionName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(CollectionName)) - { - builder.Append(" collectionName: "); - if (CollectionName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{CollectionName}'''"); - } - else - { - builder.AppendLine($"'{CollectionName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RemoteAccountName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" remoteAccountName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(RemoteAccountName)) - { - builder.Append(" remoteAccountName: "); - if (RemoteAccountName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{RemoteAccountName}'''"); - } - else - { - builder.AppendLine($"'{RemoteAccountName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Component), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" component: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" component: "); - builder.AppendLine($"'{Component.ToString()}'"); - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CosmosMongoDataTransferDataSourceSink)} does not support writing '{options.Format}' format."); - } - } - - CosmosMongoDataTransferDataSourceSink IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCosmosMongoDataTransferDataSourceSink(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CosmosMongoDataTransferDataSourceSink)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosMongoDataTransferDataSourceSink.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosMongoDataTransferDataSourceSink.cs deleted file mode 100644 index 1f4eb9086d73..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosMongoDataTransferDataSourceSink.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// A CosmosDB Mongo API data source/sink. - public partial class CosmosMongoDataTransferDataSourceSink : BaseCosmosDataTransferDataSourceSink - { - /// Initializes a new instance of . - /// - /// - /// or is null. - public CosmosMongoDataTransferDataSourceSink(string databaseName, string collectionName) - { - Argument.AssertNotNull(databaseName, nameof(databaseName)); - Argument.AssertNotNull(collectionName, nameof(collectionName)); - - DatabaseName = databaseName; - CollectionName = collectionName; - Component = DataTransferComponent.CosmosDBMongo; - } - - /// Initializes a new instance of . - /// - /// Keeps track of any properties unknown to the library. - /// - /// - /// - internal CosmosMongoDataTransferDataSourceSink(DataTransferComponent component, IDictionary serializedAdditionalRawData, string remoteAccountName, string databaseName, string collectionName) : base(component, serializedAdditionalRawData, remoteAccountName) - { - DatabaseName = databaseName; - CollectionName = collectionName; - Component = component; - } - - /// Initializes a new instance of for deserialization. - internal CosmosMongoDataTransferDataSourceSink() - { - } - - /// Gets or sets the database name. - [WirePath("databaseName")] - public string DatabaseName { get; set; } - /// Gets or sets the collection name. - [WirePath("collectionName")] - public string CollectionName { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosSqlDataTransferDataSourceSink.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosSqlDataTransferDataSourceSink.Serialization.cs deleted file mode 100644 index 5d192f6f9b5b..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosSqlDataTransferDataSourceSink.Serialization.cs +++ /dev/null @@ -1,245 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CosmosSqlDataTransferDataSourceSink : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosSqlDataTransferDataSourceSink)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("databaseName"u8); - writer.WriteStringValue(DatabaseName); - writer.WritePropertyName("containerName"u8); - writer.WriteStringValue(ContainerName); - if (Optional.IsDefined(RemoteAccountName)) - { - writer.WritePropertyName("remoteAccountName"u8); - writer.WriteStringValue(RemoteAccountName); - } - writer.WritePropertyName("component"u8); - writer.WriteStringValue(Component.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - CosmosSqlDataTransferDataSourceSink IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosSqlDataTransferDataSourceSink)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCosmosSqlDataTransferDataSourceSink(document.RootElement, options); - } - - internal static CosmosSqlDataTransferDataSourceSink DeserializeCosmosSqlDataTransferDataSourceSink(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string databaseName = default; - string containerName = default; - string remoteAccountName = default; - DataTransferComponent component = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("databaseName"u8)) - { - databaseName = property.Value.GetString(); - continue; - } - if (property.NameEquals("containerName"u8)) - { - containerName = property.Value.GetString(); - continue; - } - if (property.NameEquals("remoteAccountName"u8)) - { - remoteAccountName = property.Value.GetString(); - continue; - } - if (property.NameEquals("component"u8)) - { - component = new DataTransferComponent(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CosmosSqlDataTransferDataSourceSink(component, serializedAdditionalRawData, remoteAccountName, databaseName, containerName); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DatabaseName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" databaseName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(DatabaseName)) - { - builder.Append(" databaseName: "); - if (DatabaseName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{DatabaseName}'''"); - } - else - { - builder.AppendLine($"'{DatabaseName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ContainerName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" containerName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ContainerName)) - { - builder.Append(" containerName: "); - if (ContainerName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{ContainerName}'''"); - } - else - { - builder.AppendLine($"'{ContainerName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RemoteAccountName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" remoteAccountName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(RemoteAccountName)) - { - builder.Append(" remoteAccountName: "); - if (RemoteAccountName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{RemoteAccountName}'''"); - } - else - { - builder.AppendLine($"'{RemoteAccountName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Component), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" component: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" component: "); - builder.AppendLine($"'{Component.ToString()}'"); - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CosmosSqlDataTransferDataSourceSink)} does not support writing '{options.Format}' format."); - } - } - - CosmosSqlDataTransferDataSourceSink IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCosmosSqlDataTransferDataSourceSink(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CosmosSqlDataTransferDataSourceSink)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosSqlDataTransferDataSourceSink.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosSqlDataTransferDataSourceSink.cs deleted file mode 100644 index 44cd8c46b05c..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosSqlDataTransferDataSourceSink.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// A CosmosDB No Sql API data source/sink. - public partial class CosmosSqlDataTransferDataSourceSink : BaseCosmosDataTransferDataSourceSink - { - /// Initializes a new instance of . - /// - /// - /// or is null. - public CosmosSqlDataTransferDataSourceSink(string databaseName, string containerName) - { - Argument.AssertNotNull(databaseName, nameof(databaseName)); - Argument.AssertNotNull(containerName, nameof(containerName)); - - DatabaseName = databaseName; - ContainerName = containerName; - Component = DataTransferComponent.CosmosDBSql; - } - - /// Initializes a new instance of . - /// - /// Keeps track of any properties unknown to the library. - /// - /// - /// - internal CosmosSqlDataTransferDataSourceSink(DataTransferComponent component, IDictionary serializedAdditionalRawData, string remoteAccountName, string databaseName, string containerName) : base(component, serializedAdditionalRawData, remoteAccountName) - { - DatabaseName = databaseName; - ContainerName = containerName; - Component = component; - } - - /// Initializes a new instance of for deserialization. - internal CosmosSqlDataTransferDataSourceSink() - { - } - - /// Gets or sets the database name. - [WirePath("databaseName")] - public string DatabaseName { get; set; } - /// Gets or sets the container name. - [WirePath("containerName")] - public string ContainerName { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferComponent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferComponent.cs deleted file mode 100644 index 5aea670ce7cd..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferComponent.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The DataTransferComponent. - internal readonly partial struct DataTransferComponent : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public DataTransferComponent(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string CosmosDBCassandraValue = "CosmosDBCassandra"; - private const string CosmosDBMongoValue = "CosmosDBMongo"; - private const string CosmosDBSqlValue = "CosmosDBSql"; - private const string AzureBlobStorageValue = "AzureBlobStorage"; - - /// CosmosDBCassandra. - public static DataTransferComponent CosmosDBCassandra { get; } = new DataTransferComponent(CosmosDBCassandraValue); - /// CosmosDBMongo. - public static DataTransferComponent CosmosDBMongo { get; } = new DataTransferComponent(CosmosDBMongoValue); - /// CosmosDBSql. - public static DataTransferComponent CosmosDBSql { get; } = new DataTransferComponent(CosmosDBSqlValue); - /// AzureBlobStorage. - public static DataTransferComponent AzureBlobStorage { get; } = new DataTransferComponent(AzureBlobStorageValue); - /// Determines if two values are the same. - public static bool operator ==(DataTransferComponent left, DataTransferComponent right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(DataTransferComponent left, DataTransferComponent right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator DataTransferComponent(string value) => new DataTransferComponent(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is DataTransferComponent other && Equals(other); - /// - public bool Equals(DataTransferComponent other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferDataSourceSink.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferDataSourceSink.Serialization.cs deleted file mode 100644 index c703b56f5c56..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferDataSourceSink.Serialization.cs +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - [PersistableModelProxy(typeof(UnknownDataTransferDataSourceSink))] - public partial class DataTransferDataSourceSink : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataTransferDataSourceSink)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("component"u8); - writer.WriteStringValue(Component.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - DataTransferDataSourceSink IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataTransferDataSourceSink)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDataTransferDataSourceSink(document.RootElement, options); - } - - internal static DataTransferDataSourceSink DeserializeDataTransferDataSourceSink(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("component", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "AzureBlobStorage": return AzureBlobDataTransferDataSourceSink.DeserializeAzureBlobDataTransferDataSourceSink(element, options); - case "BaseCosmosDataTransferDataSourceSink": return BaseCosmosDataTransferDataSourceSink.DeserializeBaseCosmosDataTransferDataSourceSink(element, options); - case "CosmosDBCassandra": return CosmosCassandraDataTransferDataSourceSink.DeserializeCosmosCassandraDataTransferDataSourceSink(element, options); - case "CosmosDBMongo": return CosmosMongoDataTransferDataSourceSink.DeserializeCosmosMongoDataTransferDataSourceSink(element, options); - case "CosmosDBSql": return CosmosSqlDataTransferDataSourceSink.DeserializeCosmosSqlDataTransferDataSourceSink(element, options); - } - } - return UnknownDataTransferDataSourceSink.DeserializeUnknownDataTransferDataSourceSink(element, options); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Component), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" component: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" component: "); - builder.AppendLine($"'{Component.ToString()}'"); - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(DataTransferDataSourceSink)} does not support writing '{options.Format}' format."); - } - } - - DataTransferDataSourceSink IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDataTransferDataSourceSink(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DataTransferDataSourceSink)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferDataSourceSink.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferDataSourceSink.cs deleted file mode 100644 index 635e008e2b82..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferDataSourceSink.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// - /// Base class for all DataTransfer source/sink - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . - /// - public abstract partial class DataTransferDataSourceSink - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - protected DataTransferDataSourceSink() - { - } - - /// Initializes a new instance of . - /// - /// Keeps track of any properties unknown to the library. - internal DataTransferDataSourceSink(DataTransferComponent component, IDictionary serializedAdditionalRawData) - { - Component = component; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Gets or sets the component. - internal DataTransferComponent Component { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobFeedResults.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobFeedResults.Serialization.cs deleted file mode 100644 index 2bde9271b81a..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobFeedResults.Serialization.cs +++ /dev/null @@ -1,212 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - internal partial class DataTransferJobFeedResults : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataTransferJobFeedResults)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - DataTransferJobFeedResults IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataTransferJobFeedResults)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDataTransferJobFeedResults(document.RootElement, options); - } - - internal static DataTransferJobFeedResults DeserializeDataTransferJobFeedResults(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - string nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(item, options)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new DataTransferJobFeedResults(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" value: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Value)) - { - if (Value.Any()) - { - builder.Append(" value: "); - builder.AppendLine("["); - foreach (var item in Value) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" nextLink: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(NextLink)) - { - builder.Append(" nextLink: "); - if (NextLink.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{NextLink}'''"); - } - else - { - builder.AppendLine($"'{NextLink}'"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(DataTransferJobFeedResults)} does not support writing '{options.Format}' format."); - } - } - - DataTransferJobFeedResults IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDataTransferJobFeedResults(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DataTransferJobFeedResults)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobFeedResults.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobFeedResults.cs deleted file mode 100644 index fb232389dd51..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobFeedResults.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The List operation response, that contains the Data Transfer jobs and their properties. - internal partial class DataTransferJobFeedResults - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal DataTransferJobFeedResults() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// List of Data Transfer jobs and their properties. - /// URL to get the next set of Data Transfer job list results if there are any. - /// Keeps track of any properties unknown to the library. - internal DataTransferJobFeedResults(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) - { - Value = value; - NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// List of Data Transfer jobs and their properties. - public IReadOnlyList Value { get; } - /// URL to get the next set of Data Transfer job list results if there are any. - public string NextLink { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobGetResultCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobGetResultCreateOrUpdateContent.Serialization.cs deleted file mode 100644 index e58c1dcf7a0b..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobGetResultCreateOrUpdateContent.Serialization.cs +++ /dev/null @@ -1,260 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class DataTransferJobGetResultCreateOrUpdateContent : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataTransferJobGetResultCreateOrUpdateContent)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteObjectValue(Properties, options); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - DataTransferJobGetResultCreateOrUpdateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataTransferJobGetResultCreateOrUpdateContent)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDataTransferJobGetResultCreateOrUpdateContent(document.RootElement, options); - } - - internal static DataTransferJobGetResultCreateOrUpdateContent DeserializeDataTransferJobGetResultCreateOrUpdateContent(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - DataTransferJobProperties properties = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("properties"u8)) - { - properties = DataTransferJobProperties.DeserializeDataTransferJobProperties(property.Value, options); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new DataTransferJobGetResultCreateOrUpdateContent( - id, - name, - type, - systemData, - properties, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Properties), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" properties: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Properties)) - { - builder.Append(" properties: "); - BicepSerializationHelpers.AppendChildObject(builder, Properties, options, 2, false, " properties: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(DataTransferJobGetResultCreateOrUpdateContent)} does not support writing '{options.Format}' format."); - } - } - - DataTransferJobGetResultCreateOrUpdateContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDataTransferJobGetResultCreateOrUpdateContent(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DataTransferJobGetResultCreateOrUpdateContent)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobGetResultCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobGetResultCreateOrUpdateContent.cs deleted file mode 100644 index aa6b789a0c85..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobGetResultCreateOrUpdateContent.cs +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Parameters to create Data Transfer Job. - public partial class DataTransferJobGetResultCreateOrUpdateContent : ResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// Data Transfer Create Job Properties. - /// is null. - public DataTransferJobGetResultCreateOrUpdateContent(DataTransferJobProperties properties) - { - Argument.AssertNotNull(properties, nameof(properties)); - - Properties = properties; - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Data Transfer Create Job Properties. - /// Keeps track of any properties unknown to the library. - internal DataTransferJobGetResultCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DataTransferJobProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) - { - Properties = properties; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal DataTransferJobGetResultCreateOrUpdateContent() - { - } - - /// Data Transfer Create Job Properties. - [WirePath("properties")] - public DataTransferJobProperties Properties { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobMode.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobMode.cs deleted file mode 100644 index 3c04e94c6b4d..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobMode.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Mode of job execution. - public readonly partial struct DataTransferJobMode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public DataTransferJobMode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string OfflineValue = "Offline"; - private const string OnlineValue = "Online"; - - /// Offline. - public static DataTransferJobMode Offline { get; } = new DataTransferJobMode(OfflineValue); - /// Online. - public static DataTransferJobMode Online { get; } = new DataTransferJobMode(OnlineValue); - /// Determines if two values are the same. - public static bool operator ==(DataTransferJobMode left, DataTransferJobMode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(DataTransferJobMode left, DataTransferJobMode right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator DataTransferJobMode(string value) => new DataTransferJobMode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is DataTransferJobMode other && Equals(other); - /// - public bool Equals(DataTransferJobMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobProperties.Serialization.cs deleted file mode 100644 index c037da8e0c4a..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobProperties.Serialization.cs +++ /dev/null @@ -1,467 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class DataTransferJobProperties : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataTransferJobProperties)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(JobName)) - { - writer.WritePropertyName("jobName"u8); - writer.WriteStringValue(JobName); - } - writer.WritePropertyName("source"u8); - writer.WriteObjectValue(Source, options); - writer.WritePropertyName("destination"u8); - writer.WriteObjectValue(Destination, options); - if (options.Format != "W" && Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status); - } - if (options.Format != "W" && Optional.IsDefined(ProcessedCount)) - { - writer.WritePropertyName("processedCount"u8); - writer.WriteNumberValue(ProcessedCount.Value); - } - if (options.Format != "W" && Optional.IsDefined(TotalCount)) - { - writer.WritePropertyName("totalCount"u8); - writer.WriteNumberValue(TotalCount.Value); - } - if (options.Format != "W" && Optional.IsDefined(LastUpdatedUtcOn)) - { - writer.WritePropertyName("lastUpdatedUtcTime"u8); - writer.WriteStringValue(LastUpdatedUtcOn.Value, "O"); - } - if (Optional.IsDefined(WorkerCount)) - { - writer.WritePropertyName("workerCount"u8); - writer.WriteNumberValue(WorkerCount.Value); - } - if (options.Format != "W" && Optional.IsDefined(Error)) - { - writer.WritePropertyName("error"u8); - writer.WriteObjectValue(Error, options); - } - if (options.Format != "W" && Optional.IsDefined(Duration)) - { - writer.WritePropertyName("duration"u8); - writer.WriteStringValue(Duration.Value, "c"); - } - if (Optional.IsDefined(Mode)) - { - writer.WritePropertyName("mode"u8); - writer.WriteStringValue(Mode.Value.ToString()); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - DataTransferJobProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataTransferJobProperties)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDataTransferJobProperties(document.RootElement, options); - } - - internal static DataTransferJobProperties DeserializeDataTransferJobProperties(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string jobName = default; - DataTransferDataSourceSink source = default; - DataTransferDataSourceSink destination = default; - string status = default; - long? processedCount = default; - long? totalCount = default; - DateTimeOffset? lastUpdatedUtcTime = default; - int? workerCount = default; - CosmosDBErrorResult error = default; - TimeSpan? duration = default; - DataTransferJobMode? mode = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("jobName"u8)) - { - jobName = property.Value.GetString(); - continue; - } - if (property.NameEquals("source"u8)) - { - source = DataTransferDataSourceSink.DeserializeDataTransferDataSourceSink(property.Value, options); - continue; - } - if (property.NameEquals("destination"u8)) - { - destination = DataTransferDataSourceSink.DeserializeDataTransferDataSourceSink(property.Value, options); - continue; - } - if (property.NameEquals("status"u8)) - { - status = property.Value.GetString(); - continue; - } - if (property.NameEquals("processedCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - processedCount = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("totalCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - totalCount = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("lastUpdatedUtcTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - lastUpdatedUtcTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("workerCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - workerCount = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("error"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - error = CosmosDBErrorResult.DeserializeCosmosDBErrorResult(property.Value, options); - continue; - } - if (property.NameEquals("duration"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - duration = property.Value.GetTimeSpan("c"); - continue; - } - if (property.NameEquals("mode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - mode = new DataTransferJobMode(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new DataTransferJobProperties( - jobName, - source, - destination, - status, - processedCount, - totalCount, - lastUpdatedUtcTime, - workerCount, - error, - duration, - mode, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(JobName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" jobName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(JobName)) - { - builder.Append(" jobName: "); - if (JobName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{JobName}'''"); - } - else - { - builder.AppendLine($"'{JobName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Source), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" source: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Source)) - { - builder.Append(" source: "); - BicepSerializationHelpers.AppendChildObject(builder, Source, options, 2, false, " source: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Destination), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" destination: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Destination)) - { - builder.Append(" destination: "); - BicepSerializationHelpers.AppendChildObject(builder, Destination, options, 2, false, " destination: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Status), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" status: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Status)) - { - builder.Append(" status: "); - if (Status.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Status}'''"); - } - else - { - builder.AppendLine($"'{Status}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProcessedCount), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" processedCount: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ProcessedCount)) - { - builder.Append(" processedCount: "); - builder.AppendLine($"'{ProcessedCount.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TotalCount), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" totalCount: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(TotalCount)) - { - builder.Append(" totalCount: "); - builder.AppendLine($"'{TotalCount.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LastUpdatedUtcOn), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" lastUpdatedUtcTime: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(LastUpdatedUtcOn)) - { - builder.Append(" lastUpdatedUtcTime: "); - var formattedDateTimeString = TypeFormatters.ToString(LastUpdatedUtcOn.Value, "o"); - builder.AppendLine($"'{formattedDateTimeString}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(WorkerCount), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" workerCount: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(WorkerCount)) - { - builder.Append(" workerCount: "); - builder.AppendLine($"{WorkerCount.Value}"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Error), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" error: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Error)) - { - builder.Append(" error: "); - BicepSerializationHelpers.AppendChildObject(builder, Error, options, 2, false, " error: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Duration), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" duration: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Duration)) - { - builder.Append(" duration: "); - var formattedTimeSpan = TypeFormatters.ToString(Duration.Value, "P"); - builder.AppendLine($"'{formattedTimeSpan}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Mode), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" mode: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Mode)) - { - builder.Append(" mode: "); - builder.AppendLine($"'{Mode.Value.ToString()}'"); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(DataTransferJobProperties)} does not support writing '{options.Format}' format."); - } - } - - DataTransferJobProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDataTransferJobProperties(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DataTransferJobProperties)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobProperties.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobProperties.cs deleted file mode 100644 index cc81bf7d84c5..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobProperties.cs +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The properties of a DataTransfer Job. - public partial class DataTransferJobProperties - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// - /// Source DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . - /// - /// - /// Destination DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . - /// - /// or is null. - public DataTransferJobProperties(DataTransferDataSourceSink source, DataTransferDataSourceSink destination) - { - Argument.AssertNotNull(source, nameof(source)); - Argument.AssertNotNull(destination, nameof(destination)); - - Source = source; - Destination = destination; - } - - /// Initializes a new instance of . - /// Job Name. - /// - /// Source DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . - /// - /// - /// Destination DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . - /// - /// Job Status. - /// Processed Count. - /// Total Count. - /// Last Updated Time (ISO-8601 format). - /// Worker count. - /// Error response for Faulted job. - /// Total Duration of Job. - /// Mode of job execution. - /// Keeps track of any properties unknown to the library. - internal DataTransferJobProperties(string jobName, DataTransferDataSourceSink source, DataTransferDataSourceSink destination, string status, long? processedCount, long? totalCount, DateTimeOffset? lastUpdatedUtcOn, int? workerCount, CosmosDBErrorResult error, TimeSpan? duration, DataTransferJobMode? mode, IDictionary serializedAdditionalRawData) - { - JobName = jobName; - Source = source; - Destination = destination; - Status = status; - ProcessedCount = processedCount; - TotalCount = totalCount; - LastUpdatedUtcOn = lastUpdatedUtcOn; - WorkerCount = workerCount; - Error = error; - Duration = duration; - Mode = mode; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal DataTransferJobProperties() - { - } - - /// Job Name. - [WirePath("jobName")] - public string JobName { get; } - /// - /// Source DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . - /// - [WirePath("source")] - public DataTransferDataSourceSink Source { get; set; } - /// - /// Destination DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . - /// - [WirePath("destination")] - public DataTransferDataSourceSink Destination { get; set; } - /// Job Status. - [WirePath("status")] - public string Status { get; } - /// Processed Count. - [WirePath("processedCount")] - public long? ProcessedCount { get; } - /// Total Count. - [WirePath("totalCount")] - public long? TotalCount { get; } - /// Last Updated Time (ISO-8601 format). - [WirePath("lastUpdatedUtcTime")] - public DateTimeOffset? LastUpdatedUtcOn { get; } - /// Worker count. - [WirePath("workerCount")] - public int? WorkerCount { get; set; } - /// Error response for Faulted job. - [WirePath("error")] - public CosmosDBErrorResult Error { get; } - /// Total Duration of Job. - [WirePath("duration")] - public TimeSpan? Duration { get; } - /// Mode of job execution. - [WirePath("mode")] - public DataTransferJobMode? Mode { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DefaultPriorityLevel.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DefaultPriorityLevel.cs deleted file mode 100644 index e734331f138d..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DefaultPriorityLevel.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Enum to indicate default priorityLevel of requests. - public readonly partial struct DefaultPriorityLevel : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public DefaultPriorityLevel(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string HighValue = "High"; - private const string LowValue = "Low"; - - /// High. - public static DefaultPriorityLevel High { get; } = new DefaultPriorityLevel(HighValue); - /// Low. - public static DefaultPriorityLevel Low { get; } = new DefaultPriorityLevel(LowValue); - /// Determines if two values are the same. - public static bool operator ==(DefaultPriorityLevel left, DefaultPriorityLevel right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(DefaultPriorityLevel left, DefaultPriorityLevel right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator DefaultPriorityLevel(string value) => new DefaultPriorityLevel(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is DefaultPriorityLevel other && Equals(other); - /// - public bool Equals(DefaultPriorityLevel other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DiagnosticLogSettings.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DiagnosticLogSettings.Serialization.cs deleted file mode 100644 index 10229b3ded13..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DiagnosticLogSettings.Serialization.cs +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - internal partial class DiagnosticLogSettings : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DiagnosticLogSettings)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(EnableFullTextQuery)) - { - writer.WritePropertyName("enableFullTextQuery"u8); - writer.WriteStringValue(EnableFullTextQuery.Value.ToSerialString()); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - DiagnosticLogSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DiagnosticLogSettings)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDiagnosticLogSettings(document.RootElement, options); - } - - internal static DiagnosticLogSettings DeserializeDiagnosticLogSettings(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - EnableFullTextQuery? enableFullTextQuery = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("enableFullTextQuery"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableFullTextQuery = property.Value.GetString().ToEnableFullTextQuery(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new DiagnosticLogSettings(enableFullTextQuery, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnableFullTextQuery), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" enableFullTextQuery: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(EnableFullTextQuery)) - { - builder.Append(" enableFullTextQuery: "); - builder.AppendLine($"'{EnableFullTextQuery.Value.ToSerialString()}'"); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(DiagnosticLogSettings)} does not support writing '{options.Format}' format."); - } - } - - DiagnosticLogSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDiagnosticLogSettings(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DiagnosticLogSettings)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/EnableFullTextQuery.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/EnableFullTextQuery.Serialization.cs deleted file mode 100644 index f17d5acd7bf8..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/EnableFullTextQuery.Serialization.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - internal static partial class EnableFullTextQueryExtensions - { - public static string ToSerialString(this EnableFullTextQuery value) => value switch - { - EnableFullTextQuery.None => "None", - EnableFullTextQuery.True => "True", - EnableFullTextQuery.False => "False", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown EnableFullTextQuery value.") - }; - - public static EnableFullTextQuery ToEnableFullTextQuery(this string value) - { - if (StringComparer.OrdinalIgnoreCase.Equals(value, "None")) return EnableFullTextQuery.None; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "True")) return EnableFullTextQuery.True; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "False")) return EnableFullTextQuery.False; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown EnableFullTextQuery value."); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/EnableFullTextQuery.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/EnableFullTextQuery.cs deleted file mode 100644 index e851f23ff12e..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/EnableFullTextQuery.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Describe the level of detail with which queries are to be logged. - public enum EnableFullTextQuery - { - /// None. - None, - /// True. - True, - /// False. - False - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.Serialization.cs index 38c9cc44a336..669a137e7a9d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.Serialization.cs @@ -90,11 +90,6 @@ void IJsonModel.Write(Utf8JsonWriter w writer.WritePropertyName("createMode"u8); writer.WriteStringValue(CreateMode.Value.ToString()); } - if (Optional.IsDefined(MaterializedViewDefinition)) - { - writer.WritePropertyName("materializedViewDefinition"u8); - writer.WriteObjectValue(MaterializedViewDefinition, options); - } if (Optional.IsCollectionDefined(ComputedProperties)) { writer.WritePropertyName("computedProperties"u8); @@ -156,7 +151,6 @@ internal static ExtendedCosmosDBSqlContainerResourceInfo DeserializeExtendedCosm long? analyticalStorageTtl = default; ResourceRestoreParameters restoreParameters = default; CosmosDBAccountCreateMode? createMode = default; - MaterializedViewDefinition materializedViewDefinition = default; IList computedProperties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -271,15 +265,6 @@ internal static ExtendedCosmosDBSqlContainerResourceInfo DeserializeExtendedCosm createMode = new CosmosDBAccountCreateMode(property.Value.GetString()); continue; } - if (property.NameEquals("materializedViewDefinition"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - materializedViewDefinition = MaterializedViewDefinition.DeserializeMaterializedViewDefinition(property.Value, options); - continue; - } if (property.NameEquals("computedProperties"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -311,7 +296,6 @@ internal static ExtendedCosmosDBSqlContainerResourceInfo DeserializeExtendedCosm analyticalStorageTtl, restoreParameters, createMode, - materializedViewDefinition, computedProperties ?? new ChangeTrackingList(), serializedAdditionalRawData, rid, @@ -544,21 +528,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MaterializedViewDefinition), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" materializedViewDefinition: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(MaterializedViewDefinition)) - { - builder.Append(" materializedViewDefinition: "); - BicepSerializationHelpers.AppendChildObject(builder, MaterializedViewDefinition, options, 2, false, " materializedViewDefinition: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ComputedProperties), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.cs index 29bd68e82d12..dd115d5b5413 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.cs @@ -32,13 +32,12 @@ public ExtendedCosmosDBSqlContainerResourceInfo(string containerName) : base(con /// Analytical TTL. /// Parameters to indicate the information about the restore. /// Enum to indicate the mode of resource creation. - /// The configuration for defining Materialized Views. This must be specified only for creating a Materialized View container. /// List of computed properties. /// Keeps track of any properties unknown to the library. /// A system generated property. A unique identifier. /// A system generated property that denotes the last updated timestamp of the resource. /// A system generated property representing the resource etag required for optimistic concurrency control. - internal ExtendedCosmosDBSqlContainerResourceInfo(string containerName, CosmosDBIndexingPolicy indexingPolicy, CosmosDBContainerPartitionKey partitionKey, int? defaultTtl, CosmosDBUniqueKeyPolicy uniqueKeyPolicy, ConflictResolutionPolicy conflictResolutionPolicy, CosmosDBClientEncryptionPolicy clientEncryptionPolicy, long? analyticalStorageTtl, ResourceRestoreParameters restoreParameters, CosmosDBAccountCreateMode? createMode, MaterializedViewDefinition materializedViewDefinition, IList computedProperties, IDictionary serializedAdditionalRawData, string rid, float? timestamp, ETag? etag) : base(containerName, indexingPolicy, partitionKey, defaultTtl, uniqueKeyPolicy, conflictResolutionPolicy, clientEncryptionPolicy, analyticalStorageTtl, restoreParameters, createMode, materializedViewDefinition, computedProperties, serializedAdditionalRawData) + internal ExtendedCosmosDBSqlContainerResourceInfo(string containerName, CosmosDBIndexingPolicy indexingPolicy, CosmosDBContainerPartitionKey partitionKey, int? defaultTtl, CosmosDBUniqueKeyPolicy uniqueKeyPolicy, ConflictResolutionPolicy conflictResolutionPolicy, CosmosDBClientEncryptionPolicy clientEncryptionPolicy, long? analyticalStorageTtl, ResourceRestoreParameters restoreParameters, CosmosDBAccountCreateMode? createMode, IList computedProperties, IDictionary serializedAdditionalRawData, string rid, float? timestamp, ETag? etag) : base(containerName, indexingPolicy, partitionKey, defaultTtl, uniqueKeyPolicy, conflictResolutionPolicy, clientEncryptionPolicy, analyticalStorageTtl, restoreParameters, createMode, computedProperties, serializedAdditionalRawData) { Rid = rid; Timestamp = timestamp; diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetPropertiesOptions.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetPropertiesOptions.Serialization.cs deleted file mode 100644 index b596b434dbd6..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetPropertiesOptions.Serialization.cs +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class GraphResourceGetPropertiesOptions : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(GraphResourceGetPropertiesOptions)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Throughput)) - { - writer.WritePropertyName("throughput"u8); - writer.WriteNumberValue(Throughput.Value); - } - if (Optional.IsDefined(AutoscaleSettings)) - { - writer.WritePropertyName("autoscaleSettings"u8); - writer.WriteObjectValue(AutoscaleSettings, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - GraphResourceGetPropertiesOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(GraphResourceGetPropertiesOptions)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeGraphResourceGetPropertiesOptions(document.RootElement, options); - } - - internal static GraphResourceGetPropertiesOptions DeserializeGraphResourceGetPropertiesOptions(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - int? throughput = default; - AutoscaleSettings autoscaleSettings = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("throughput"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - throughput = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("autoscaleSettings"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - autoscaleSettings = AutoscaleSettings.DeserializeAutoscaleSettings(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new GraphResourceGetPropertiesOptions(throughput, autoscaleSettings, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Throughput), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" throughput: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Throughput)) - { - builder.Append(" throughput: "); - builder.AppendLine($"{Throughput.Value}"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("AutoscaleMaxThroughput", out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" autoscaleSettings: "); - builder.AppendLine("{"); - builder.Append(" maxThroughput: "); - builder.AppendLine(propertyOverride); - builder.AppendLine(" }"); - } - else - { - if (Optional.IsDefined(AutoscaleSettings)) - { - builder.Append(" autoscaleSettings: "); - BicepSerializationHelpers.AppendChildObject(builder, AutoscaleSettings, options, 2, false, " autoscaleSettings: "); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(GraphResourceGetPropertiesOptions)} does not support writing '{options.Format}' format."); - } - } - - GraphResourceGetPropertiesOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeGraphResourceGetPropertiesOptions(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(GraphResourceGetPropertiesOptions)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetPropertiesOptions.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetPropertiesOptions.cs deleted file mode 100644 index 666a18bb117a..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetPropertiesOptions.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The GraphResourceGetPropertiesOptions. - public partial class GraphResourceGetPropertiesOptions : CosmosDBBaseConfig - { - /// Initializes a new instance of . - public GraphResourceGetPropertiesOptions() - { - } - - /// Initializes a new instance of . - /// Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. - /// Specifies the Autoscale settings. - /// Keeps track of any properties unknown to the library. - internal GraphResourceGetPropertiesOptions(int? throughput, AutoscaleSettings autoscaleSettings, IDictionary serializedAdditionalRawData) : base(throughput, autoscaleSettings, serializedAdditionalRawData) - { - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetResultCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetResultCreateOrUpdateContent.Serialization.cs deleted file mode 100644 index 672c9ad5d5cb..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetResultCreateOrUpdateContent.Serialization.cs +++ /dev/null @@ -1,434 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class GraphResourceGetResultCreateOrUpdateContent : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(GraphResourceGetResultCreateOrUpdateContent)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - writer.WritePropertyName("resource"u8); - JsonSerializer.Serialize(writer, Resource); - if (Optional.IsDefined(Options)) - { - writer.WritePropertyName("options"u8); - writer.WriteObjectValue(Options, options); - } - writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - GraphResourceGetResultCreateOrUpdateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(GraphResourceGetResultCreateOrUpdateContent)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeGraphResourceGetResultCreateOrUpdateContent(document.RootElement, options); - } - - internal static GraphResourceGetResultCreateOrUpdateContent DeserializeGraphResourceGetResultCreateOrUpdateContent(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ManagedServiceIdentity identity = default; - IDictionary tags = default; - AzureLocation location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - WritableSubResource resource = default; - CosmosDBCreateUpdateConfig options0 = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("location"u8)) - { - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("resource"u8)) - { - resource = JsonSerializer.Deserialize(property0.Value.GetRawText()); - continue; - } - if (property0.NameEquals("options"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - options0 = CosmosDBCreateUpdateConfig.DeserializeCosmosDBCreateUpdateConfig(property0.Value, options); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new GraphResourceGetResultCreateOrUpdateContent( - id, - name, - type, - systemData, - tags ?? new ChangeTrackingDictionary(), - location, - resource, - options0, - identity, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" location: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" location: "); - builder.AppendLine($"'{Location.ToString()}'"); - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" tags: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Tags)) - { - if (Tags.Any()) - { - builder.Append(" tags: "); - builder.AppendLine("{"); - foreach (var item in Tags) - { - builder.Append($" '{item.Key}': "); - if (item.Value == null) - { - builder.Append("null"); - continue; - } - if (item.Value.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{item.Value}'''"); - } - else - { - builder.AppendLine($"'{item.Value}'"); - } - } - builder.AppendLine(" }"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.Append(" properties:"); - builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("ResourceId", out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" resource: "); - builder.AppendLine("{"); - builder.AppendLine(" resource: {"); - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - builder.AppendLine(" }"); - builder.AppendLine(" }"); - } - else - { - if (Optional.IsDefined(Resource)) - { - builder.Append(" resource: "); - BicepSerializationHelpers.AppendChildObject(builder, Resource, options, 4, false, " resource: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Options), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" options: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Options)) - { - builder.Append(" options: "); - BicepSerializationHelpers.AppendChildObject(builder, Options, options, 4, false, " options: "); - } - } - - builder.AppendLine(" }"); - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(GraphResourceGetResultCreateOrUpdateContent)} does not support writing '{options.Format}' format."); - } - } - - GraphResourceGetResultCreateOrUpdateContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeGraphResourceGetResultCreateOrUpdateContent(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(GraphResourceGetResultCreateOrUpdateContent)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetResultCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetResultCreateOrUpdateContent.cs deleted file mode 100644 index b4b35b1e14d3..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetResultCreateOrUpdateContent.cs +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Parameters to create and update Cosmos DB Graph resource. - public partial class GraphResourceGetResultCreateOrUpdateContent : TrackedResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The location. - /// The standard JSON format of a Graph resource. - /// is null. - public GraphResourceGetResultCreateOrUpdateContent(AzureLocation location, WritableSubResource resource) : base(location) - { - Argument.AssertNotNull(resource, nameof(resource)); - - Resource = resource; - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The standard JSON format of a Graph resource. - /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. - /// Keeps track of any properties unknown to the library. - internal GraphResourceGetResultCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, WritableSubResource resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) - { - Resource = resource; - Options = options; - Identity = identity; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal GraphResourceGetResultCreateOrUpdateContent() - { - } - - /// The standard JSON format of a Graph resource. - internal WritableSubResource Resource { get; set; } - /// Gets or sets Id. - [WirePath("properties.resource.id")] - public ResourceIdentifier ResourceId - { - get => Resource is null ? default : Resource.Id; - set - { - if (Resource is null) - Resource = new WritableSubResource(); - Resource.Id = value; - } - } - - /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - [WirePath("properties.options")] - public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourcesListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourcesListResult.Serialization.cs deleted file mode 100644 index f00a5061ab48..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourcesListResult.Serialization.cs +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - internal partial class GraphResourcesListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(GraphResourcesListResult)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - GraphResourcesListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(GraphResourcesListResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeGraphResourcesListResult(document.RootElement, options); - } - - internal static GraphResourcesListResult DeserializeGraphResourcesListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(GraphResourceGetResultData.DeserializeGraphResourceGetResultData(item, options)); - } - value = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new GraphResourcesListResult(value ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" value: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Value)) - { - if (Value.Any()) - { - builder.Append(" value: "); - builder.AppendLine("["); - foreach (var item in Value) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); - } - builder.AppendLine(" ]"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(GraphResourcesListResult)} does not support writing '{options.Format}' format."); - } - } - - GraphResourcesListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeGraphResourcesListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(GraphResourcesListResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourcesListResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourcesListResult.cs deleted file mode 100644 index 960002eccee0..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourcesListResult.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The List operation response, that contains the Graph resource and their properties. - internal partial class GraphResourcesListResult - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal GraphResourcesListResult() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// List of Graph resource and their properties. - /// Keeps track of any properties unknown to the library. - internal GraphResourcesListResult(IReadOnlyList value, IDictionary serializedAdditionalRawData) - { - Value = value; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// List of Graph resource and their properties. - public IReadOnlyList Value { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseCreateOrUpdateContent.Serialization.cs index ff46c6e2103b..0bab29173f22 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseCreateOrUpdateContent.Serialization.cs @@ -29,12 +29,6 @@ void IJsonModel.Write(Utf8JsonWriter write } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -116,7 +110,6 @@ internal static GremlinDatabaseCreateOrUpdateContent DeserializeGremlinDatabaseC { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -129,16 +122,6 @@ internal static GremlinDatabaseCreateOrUpdateContent DeserializeGremlinDatabaseC Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -223,7 +206,6 @@ internal static GremlinDatabaseCreateOrUpdateContent DeserializeGremlinDatabaseC location, resource, options0, - identity, serializedAdditionalRawData); } @@ -310,21 +292,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseCreateOrUpdateContent.cs index b30d6c737abd..f3e7fbc4d1d9 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseCreateOrUpdateContent.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseCreateOrUpdateContent.cs @@ -67,13 +67,11 @@ public GremlinDatabaseCreateOrUpdateContent(AzureLocation location, GremlinDatab /// The location. /// The standard JSON format of a Gremlin database. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal GremlinDatabaseCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, GremlinDatabaseResourceInfo resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal GremlinDatabaseCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, GremlinDatabaseResourceInfo resource, CosmosDBCreateUpdateConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -88,8 +86,5 @@ internal GremlinDatabaseCreateOrUpdateContent() /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. [WirePath("properties.options")] public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphCreateOrUpdateContent.Serialization.cs index e3680fed5987..149955c58835 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphCreateOrUpdateContent.Serialization.cs @@ -29,12 +29,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -116,7 +110,6 @@ internal static GremlinGraphCreateOrUpdateContent DeserializeGremlinGraphCreateO { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -129,16 +122,6 @@ internal static GremlinGraphCreateOrUpdateContent DeserializeGremlinGraphCreateO Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -223,7 +206,6 @@ internal static GremlinGraphCreateOrUpdateContent DeserializeGremlinGraphCreateO location, resource, options0, - identity, serializedAdditionalRawData); } @@ -310,21 +292,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphCreateOrUpdateContent.cs index 66f52d20662d..719404a9f423 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphCreateOrUpdateContent.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphCreateOrUpdateContent.cs @@ -67,13 +67,11 @@ public GremlinGraphCreateOrUpdateContent(AzureLocation location, GremlinGraphRes /// The location. /// The standard JSON format of a Gremlin graph. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal GremlinGraphCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, GremlinGraphResourceInfo resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal GremlinGraphCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, GremlinGraphResourceInfo resource, CosmosDBCreateUpdateConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -88,8 +86,5 @@ internal GremlinGraphCreateOrUpdateContent() /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. [WirePath("properties.options")] public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/IssueType.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/IssueType.cs deleted file mode 100644 index ece124deb96d..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/IssueType.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Type of issue. - public readonly partial struct IssueType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public IssueType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string UnknownValue = "Unknown"; - private const string ConfigurationPropagationFailureValue = "ConfigurationPropagationFailure"; - private const string MissingPerimeterConfigurationValue = "MissingPerimeterConfiguration"; - private const string MissingIdentityConfigurationValue = "MissingIdentityConfiguration"; - - /// Unknown issue type. - public static IssueType Unknown { get; } = new IssueType(UnknownValue); - /// An error occurred while applying the network security perimeter (NSP) configuration. - public static IssueType ConfigurationPropagationFailure { get; } = new IssueType(ConfigurationPropagationFailureValue); - /// A network connectivity issue is happening on the resource which could be addressed either by adding new resources to the network security perimeter (NSP) or by modifying access rules. - public static IssueType MissingPerimeterConfiguration { get; } = new IssueType(MissingPerimeterConfigurationValue); - /// An managed identity hasn't been associated with the resource. The resource will still be able to validate inbound traffic from the network security perimeter (NSP) or matching inbound access rules, but it won't be able to perform outbound access as a member of the NSP. - public static IssueType MissingIdentityConfiguration { get; } = new IssueType(MissingIdentityConfigurationValue); - /// Determines if two values are the same. - public static bool operator ==(IssueType left, IssueType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(IssueType left, IssueType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator IssueType(string value) => new IssueType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is IssueType other && Equals(other); - /// - public bool Equals(IssueType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListBackups.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListBackups.Serialization.cs deleted file mode 100644 index 242a9a8c2c49..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListBackups.Serialization.cs +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - internal partial class ListBackups : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ListBackups)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ListBackups IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ListBackups)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeListBackups(document.RootElement, options); - } - - internal static ListBackups DeserializeListBackups(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(CassandraClusterBackupResourceInfo.DeserializeCassandraClusterBackupResourceInfo(item, options)); - } - value = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ListBackups(value ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" value: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Value)) - { - if (Value.Any()) - { - builder.Append(" value: "); - builder.AppendLine("["); - foreach (var item in Value) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); - } - builder.AppendLine(" ]"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(ListBackups)} does not support writing '{options.Format}' format."); - } - } - - ListBackups IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeListBackups(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ListBackups)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListCommands.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListCommands.Serialization.cs deleted file mode 100644 index d16c6979ea3f..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListCommands.Serialization.cs +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - internal partial class ListCommands : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ListCommands)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ListCommands IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ListCommands)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeListCommands(document.RootElement, options); - } - - internal static ListCommands DeserializeListCommands(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(CassandraClusterCommand.DeserializeCassandraClusterCommand(item, options)); - } - value = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ListCommands(value ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" value: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Value)) - { - if (Value.Any()) - { - builder.Append(" value: "); - builder.AppendLine("["); - foreach (var item in Value) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); - } - builder.AppendLine(" ]"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(ListCommands)} does not support writing '{options.Format}' format."); - } - } - - ListCommands IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeListCommands(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ListCommands)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewDefinition.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewDefinition.Serialization.cs deleted file mode 100644 index 4856a1ed72c1..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewDefinition.Serialization.cs +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class MaterializedViewDefinition : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MaterializedViewDefinition)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(SourceCollectionRid)) - { - writer.WritePropertyName("sourceCollectionRid"u8); - writer.WriteStringValue(SourceCollectionRid); - } - writer.WritePropertyName("sourceCollectionId"u8); - writer.WriteStringValue(SourceCollectionId); - writer.WritePropertyName("definition"u8); - writer.WriteStringValue(Definition); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - MaterializedViewDefinition IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MaterializedViewDefinition)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMaterializedViewDefinition(document.RootElement, options); - } - - internal static MaterializedViewDefinition DeserializeMaterializedViewDefinition(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string sourceCollectionRid = default; - string sourceCollectionId = default; - string definition = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("sourceCollectionRid"u8)) - { - sourceCollectionRid = property.Value.GetString(); - continue; - } - if (property.NameEquals("sourceCollectionId"u8)) - { - sourceCollectionId = property.Value.GetString(); - continue; - } - if (property.NameEquals("definition"u8)) - { - definition = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MaterializedViewDefinition(sourceCollectionRid, sourceCollectionId, definition, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SourceCollectionRid), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" sourceCollectionRid: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SourceCollectionRid)) - { - builder.Append(" sourceCollectionRid: "); - if (SourceCollectionRid.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{SourceCollectionRid}'''"); - } - else - { - builder.AppendLine($"'{SourceCollectionRid}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SourceCollectionId), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" sourceCollectionId: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SourceCollectionId)) - { - builder.Append(" sourceCollectionId: "); - if (SourceCollectionId.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{SourceCollectionId}'''"); - } - else - { - builder.AppendLine($"'{SourceCollectionId}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Definition), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" definition: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Definition)) - { - builder.Append(" definition: "); - if (Definition.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Definition}'''"); - } - else - { - builder.AppendLine($"'{Definition}'"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(MaterializedViewDefinition)} does not support writing '{options.Format}' format."); - } - } - - MaterializedViewDefinition IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMaterializedViewDefinition(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MaterializedViewDefinition)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewDefinition.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewDefinition.cs deleted file mode 100644 index b2e51f0324c1..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewDefinition.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Materialized View definition for the container. - public partial class MaterializedViewDefinition - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The name of the source container on which the Materialized View will be created. - /// The definition should be an SQL query which would be used to fetch data from the source container to populate into the Materialized View container. - /// or is null. - public MaterializedViewDefinition(string sourceCollectionId, string definition) - { - Argument.AssertNotNull(sourceCollectionId, nameof(sourceCollectionId)); - Argument.AssertNotNull(definition, nameof(definition)); - - SourceCollectionId = sourceCollectionId; - Definition = definition; - } - - /// Initializes a new instance of . - /// An unique identifier for the source collection. This is a system generated property. - /// The name of the source container on which the Materialized View will be created. - /// The definition should be an SQL query which would be used to fetch data from the source container to populate into the Materialized View container. - /// Keeps track of any properties unknown to the library. - internal MaterializedViewDefinition(string sourceCollectionRid, string sourceCollectionId, string definition, IDictionary serializedAdditionalRawData) - { - SourceCollectionRid = sourceCollectionRid; - SourceCollectionId = sourceCollectionId; - Definition = definition; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal MaterializedViewDefinition() - { - } - - /// An unique identifier for the source collection. This is a system generated property. - [WirePath("sourceCollectionRid")] - public string SourceCollectionRid { get; } - /// The name of the source container on which the Materialized View will be created. - [WirePath("sourceCollectionId")] - public string SourceCollectionId { get; set; } - /// The definition should be an SQL query which would be used to fetch data from the source container to populate into the Materialized View container. - [WirePath("definition")] - public string Definition { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionCreateOrUpdateContent.Serialization.cs index 66a97aabb73c..d3da47a1acb2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionCreateOrUpdateContent.Serialization.cs @@ -29,12 +29,6 @@ void IJsonModel.Write(Utf8JsonWriter wri } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -116,7 +110,6 @@ internal static MongoDBCollectionCreateOrUpdateContent DeserializeMongoDBCollect { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -129,16 +122,6 @@ internal static MongoDBCollectionCreateOrUpdateContent DeserializeMongoDBCollect Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -223,7 +206,6 @@ internal static MongoDBCollectionCreateOrUpdateContent DeserializeMongoDBCollect location, resource, options0, - identity, serializedAdditionalRawData); } @@ -310,21 +292,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionCreateOrUpdateContent.cs index aa5160f84cca..6fbc0d6a18e1 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionCreateOrUpdateContent.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionCreateOrUpdateContent.cs @@ -67,13 +67,11 @@ public MongoDBCollectionCreateOrUpdateContent(AzureLocation location, MongoDBCol /// The location. /// The standard JSON format of a MongoDB collection. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal MongoDBCollectionCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, MongoDBCollectionResourceInfo resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal MongoDBCollectionCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, MongoDBCollectionResourceInfo resource, CosmosDBCreateUpdateConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -88,8 +86,5 @@ internal MongoDBCollectionCreateOrUpdateContent() /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. [WirePath("properties.options")] public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseCreateOrUpdateContent.Serialization.cs index d7cb06e66414..07ec40e4d580 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseCreateOrUpdateContent.Serialization.cs @@ -29,12 +29,6 @@ void IJsonModel.Write(Utf8JsonWriter write } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -116,7 +110,6 @@ internal static MongoDBDatabaseCreateOrUpdateContent DeserializeMongoDBDatabaseC { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -129,16 +122,6 @@ internal static MongoDBDatabaseCreateOrUpdateContent DeserializeMongoDBDatabaseC Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -223,7 +206,6 @@ internal static MongoDBDatabaseCreateOrUpdateContent DeserializeMongoDBDatabaseC location, resource, options0, - identity, serializedAdditionalRawData); } @@ -310,21 +292,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseCreateOrUpdateContent.cs index 2b571cead553..3e49d095be97 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseCreateOrUpdateContent.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseCreateOrUpdateContent.cs @@ -67,13 +67,11 @@ public MongoDBDatabaseCreateOrUpdateContent(AzureLocation location, MongoDBDatab /// The location. /// The standard JSON format of a MongoDB database. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal MongoDBDatabaseCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, MongoDBDatabaseResourceInfo resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal MongoDBDatabaseCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, MongoDBDatabaseResourceInfo resource, CosmosDBCreateUpdateConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -88,8 +86,5 @@ internal MongoDBDatabaseCreateOrUpdateContent() /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. [WirePath("properties.options")] public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeter.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeter.Serialization.cs deleted file mode 100644 index 0f1a348e6a32..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeter.Serialization.cs +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class NetworkSecurityPerimeter : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NetworkSecurityPerimeter)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Id)) - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (Optional.IsDefined(PerimeterGuid)) - { - writer.WritePropertyName("perimeterGuid"u8); - writer.WriteStringValue(PerimeterGuid.Value); - } - if (Optional.IsDefined(Location)) - { - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - NetworkSecurityPerimeter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NetworkSecurityPerimeter)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNetworkSecurityPerimeter(document.RootElement, options); - } - - internal static NetworkSecurityPerimeter DeserializeNetworkSecurityPerimeter(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - Guid? perimeterGuid = default; - AzureLocation? location = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("perimeterGuid"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - perimeterGuid = property.Value.GetGuid(); - continue; - } - if (property.NameEquals("location"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new NetworkSecurityPerimeter(id, perimeterGuid, location, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PerimeterGuid), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" perimeterGuid: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(PerimeterGuid)) - { - builder.Append(" perimeterGuid: "); - builder.AppendLine($"'{PerimeterGuid.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" location: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Location)) - { - builder.Append(" location: "); - builder.AppendLine($"'{Location.Value.ToString()}'"); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(NetworkSecurityPerimeter)} does not support writing '{options.Format}' format."); - } - } - - NetworkSecurityPerimeter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeNetworkSecurityPerimeter(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(NetworkSecurityPerimeter)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationListResult.Serialization.cs deleted file mode 100644 index 941563248e65..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationListResult.Serialization.cs +++ /dev/null @@ -1,208 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - internal partial class NetworkSecurityPerimeterConfigurationListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationListResult)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink.AbsoluteUri); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - NetworkSecurityPerimeterConfigurationListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationListResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNetworkSecurityPerimeterConfigurationListResult(document.RootElement, options); - } - - internal static NetworkSecurityPerimeterConfigurationListResult DeserializeNetworkSecurityPerimeterConfigurationListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - Uri nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(NetworkSecurityPerimeterConfigurationData.DeserializeNetworkSecurityPerimeterConfigurationData(item, options)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - nextLink = new Uri(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new NetworkSecurityPerimeterConfigurationListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" value: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Value)) - { - if (Value.Any()) - { - builder.Append(" value: "); - builder.AppendLine("["); - foreach (var item in Value) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" nextLink: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(NextLink)) - { - builder.Append(" nextLink: "); - builder.AppendLine($"'{NextLink.AbsoluteUri}'"); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationListResult)} does not support writing '{options.Format}' format."); - } - } - - NetworkSecurityPerimeterConfigurationListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeNetworkSecurityPerimeterConfigurationListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationListResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationProperties.Serialization.cs deleted file mode 100644 index 52e5510825bb..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationProperties.Serialization.cs +++ /dev/null @@ -1,304 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class NetworkSecurityPerimeterConfigurationProperties : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationProperties)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - if (options.Format != "W" && Optional.IsCollectionDefined(ProvisioningIssues)) - { - writer.WritePropertyName("provisioningIssues"u8); - writer.WriteStartArray(); - foreach (var item in ProvisioningIssues) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(NetworkSecurityPerimeter)) - { - writer.WritePropertyName("networkSecurityPerimeter"u8); - writer.WriteObjectValue(NetworkSecurityPerimeter, options); - } - if (Optional.IsDefined(ResourceAssociation)) - { - writer.WritePropertyName("resourceAssociation"u8); - writer.WriteObjectValue(ResourceAssociation, options); - } - if (Optional.IsDefined(Profile)) - { - writer.WritePropertyName("profile"u8); - writer.WriteObjectValue(Profile, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - NetworkSecurityPerimeterConfigurationProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationProperties)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNetworkSecurityPerimeterConfigurationProperties(document.RootElement, options); - } - - internal static NetworkSecurityPerimeterConfigurationProperties DeserializeNetworkSecurityPerimeterConfigurationProperties(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - NetworkSecurityPerimeterConfigurationProvisioningState? provisioningState = default; - IReadOnlyList provisioningIssues = default; - NetworkSecurityPerimeter networkSecurityPerimeter = default; - ResourceAssociation resourceAssociation = default; - NetworkSecurityProfile profile = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("provisioningState"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new NetworkSecurityPerimeterConfigurationProvisioningState(property.Value.GetString()); - continue; - } - if (property.NameEquals("provisioningIssues"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ProvisioningIssue.DeserializeProvisioningIssue(item, options)); - } - provisioningIssues = array; - continue; - } - if (property.NameEquals("networkSecurityPerimeter"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - networkSecurityPerimeter = NetworkSecurityPerimeter.DeserializeNetworkSecurityPerimeter(property.Value, options); - continue; - } - if (property.NameEquals("resourceAssociation"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resourceAssociation = ResourceAssociation.DeserializeResourceAssociation(property.Value, options); - continue; - } - if (property.NameEquals("profile"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - profile = NetworkSecurityProfile.DeserializeNetworkSecurityProfile(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new NetworkSecurityPerimeterConfigurationProperties( - provisioningState, - provisioningIssues ?? new ChangeTrackingList(), - networkSecurityPerimeter, - resourceAssociation, - profile, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" provisioningState: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ProvisioningState)) - { - builder.Append(" provisioningState: "); - builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningIssues), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" provisioningIssues: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(ProvisioningIssues)) - { - if (ProvisioningIssues.Any()) - { - builder.Append(" provisioningIssues: "); - builder.AppendLine("["); - foreach (var item in ProvisioningIssues) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " provisioningIssues: "); - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NetworkSecurityPerimeter), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" networkSecurityPerimeter: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(NetworkSecurityPerimeter)) - { - builder.Append(" networkSecurityPerimeter: "); - BicepSerializationHelpers.AppendChildObject(builder, NetworkSecurityPerimeter, options, 2, false, " networkSecurityPerimeter: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ResourceAssociation), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" resourceAssociation: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ResourceAssociation)) - { - builder.Append(" resourceAssociation: "); - BicepSerializationHelpers.AppendChildObject(builder, ResourceAssociation, options, 2, false, " resourceAssociation: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Profile), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" profile: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Profile)) - { - builder.Append(" profile: "); - BicepSerializationHelpers.AppendChildObject(builder, Profile, options, 2, false, " profile: "); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationProperties)} does not support writing '{options.Format}' format."); - } - } - - NetworkSecurityPerimeterConfigurationProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeNetworkSecurityPerimeterConfigurationProperties(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationProperties)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationProperties.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationProperties.cs deleted file mode 100644 index 0ed13065c6b1..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationProperties.cs +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Network security configuration properties. - public partial class NetworkSecurityPerimeterConfigurationProperties - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public NetworkSecurityPerimeterConfigurationProperties() - { - ProvisioningIssues = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Provisioning state of a network security perimeter configuration that is being created or updated. - /// List of provisioning issues, if any. - /// Information about a network security perimeter (NSP). - /// Information about resource association. - /// Network security perimeter configuration profile. - /// Keeps track of any properties unknown to the library. - internal NetworkSecurityPerimeterConfigurationProperties(NetworkSecurityPerimeterConfigurationProvisioningState? provisioningState, IReadOnlyList provisioningIssues, NetworkSecurityPerimeter networkSecurityPerimeter, ResourceAssociation resourceAssociation, NetworkSecurityProfile profile, IDictionary serializedAdditionalRawData) - { - ProvisioningState = provisioningState; - ProvisioningIssues = provisioningIssues; - NetworkSecurityPerimeter = networkSecurityPerimeter; - ResourceAssociation = resourceAssociation; - Profile = profile; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Provisioning state of a network security perimeter configuration that is being created or updated. - [WirePath("provisioningState")] - public NetworkSecurityPerimeterConfigurationProvisioningState? ProvisioningState { get; } - /// List of provisioning issues, if any. - [WirePath("provisioningIssues")] - public IReadOnlyList ProvisioningIssues { get; } - /// Information about a network security perimeter (NSP). - [WirePath("networkSecurityPerimeter")] - public NetworkSecurityPerimeter NetworkSecurityPerimeter { get; set; } - /// Information about resource association. - [WirePath("resourceAssociation")] - public ResourceAssociation ResourceAssociation { get; set; } - /// Network security perimeter configuration profile. - [WirePath("profile")] - public NetworkSecurityProfile Profile { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationProvisioningState.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationProvisioningState.cs deleted file mode 100644 index e8ebf200638a..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationProvisioningState.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Provisioning state of a network security perimeter configuration that is being created or updated. - public readonly partial struct NetworkSecurityPerimeterConfigurationProvisioningState : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public NetworkSecurityPerimeterConfigurationProvisioningState(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string SucceededValue = "Succeeded"; - private const string CreatingValue = "Creating"; - private const string UpdatingValue = "Updating"; - private const string DeletingValue = "Deleting"; - private const string AcceptedValue = "Accepted"; - private const string FailedValue = "Failed"; - private const string CanceledValue = "Canceled"; - - /// Succeeded. - public static NetworkSecurityPerimeterConfigurationProvisioningState Succeeded { get; } = new NetworkSecurityPerimeterConfigurationProvisioningState(SucceededValue); - /// Creating. - public static NetworkSecurityPerimeterConfigurationProvisioningState Creating { get; } = new NetworkSecurityPerimeterConfigurationProvisioningState(CreatingValue); - /// Updating. - public static NetworkSecurityPerimeterConfigurationProvisioningState Updating { get; } = new NetworkSecurityPerimeterConfigurationProvisioningState(UpdatingValue); - /// Deleting. - public static NetworkSecurityPerimeterConfigurationProvisioningState Deleting { get; } = new NetworkSecurityPerimeterConfigurationProvisioningState(DeletingValue); - /// Accepted. - public static NetworkSecurityPerimeterConfigurationProvisioningState Accepted { get; } = new NetworkSecurityPerimeterConfigurationProvisioningState(AcceptedValue); - /// Failed. - public static NetworkSecurityPerimeterConfigurationProvisioningState Failed { get; } = new NetworkSecurityPerimeterConfigurationProvisioningState(FailedValue); - /// Canceled. - public static NetworkSecurityPerimeterConfigurationProvisioningState Canceled { get; } = new NetworkSecurityPerimeterConfigurationProvisioningState(CanceledValue); - /// Determines if two values are the same. - public static bool operator ==(NetworkSecurityPerimeterConfigurationProvisioningState left, NetworkSecurityPerimeterConfigurationProvisioningState right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(NetworkSecurityPerimeterConfigurationProvisioningState left, NetworkSecurityPerimeterConfigurationProvisioningState right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator NetworkSecurityPerimeterConfigurationProvisioningState(string value) => new NetworkSecurityPerimeterConfigurationProvisioningState(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is NetworkSecurityPerimeterConfigurationProvisioningState other && Equals(other); - /// - public bool Equals(NetworkSecurityPerimeterConfigurationProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityProfile.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityProfile.Serialization.cs deleted file mode 100644 index 154b9b9f4e36..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityProfile.Serialization.cs +++ /dev/null @@ -1,339 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class NetworkSecurityProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NetworkSecurityProfile)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (Optional.IsDefined(AccessRulesVersion)) - { - writer.WritePropertyName("accessRulesVersion"u8); - writer.WriteNumberValue(AccessRulesVersion.Value); - } - if (Optional.IsCollectionDefined(AccessRules)) - { - writer.WritePropertyName("accessRules"u8); - writer.WriteStartArray(); - foreach (var item in AccessRules) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(DiagnosticSettingsVersion)) - { - writer.WritePropertyName("diagnosticSettingsVersion"u8); - writer.WriteNumberValue(DiagnosticSettingsVersion.Value); - } - if (Optional.IsCollectionDefined(EnabledLogCategories)) - { - writer.WritePropertyName("enabledLogCategories"u8); - writer.WriteStartArray(); - foreach (var item in EnabledLogCategories) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - NetworkSecurityProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NetworkSecurityProfile)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNetworkSecurityProfile(document.RootElement, options); - } - - internal static NetworkSecurityProfile DeserializeNetworkSecurityProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string name = default; - int? accessRulesVersion = default; - IList accessRules = default; - int? diagnosticSettingsVersion = default; - IList enabledLogCategories = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("accessRulesVersion"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - accessRulesVersion = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("accessRules"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(AccessRule.DeserializeAccessRule(item, options)); - } - accessRules = array; - continue; - } - if (property.NameEquals("diagnosticSettingsVersion"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - diagnosticSettingsVersion = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("enabledLogCategories"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - enabledLogCategories = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new NetworkSecurityProfile( - name, - accessRulesVersion, - accessRules ?? new ChangeTrackingList(), - diagnosticSettingsVersion, - enabledLogCategories ?? new ChangeTrackingList(), - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AccessRulesVersion), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" accessRulesVersion: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(AccessRulesVersion)) - { - builder.Append(" accessRulesVersion: "); - builder.AppendLine($"{AccessRulesVersion.Value}"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AccessRules), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" accessRules: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(AccessRules)) - { - if (AccessRules.Any()) - { - builder.Append(" accessRules: "); - builder.AppendLine("["); - foreach (var item in AccessRules) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " accessRules: "); - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DiagnosticSettingsVersion), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" diagnosticSettingsVersion: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(DiagnosticSettingsVersion)) - { - builder.Append(" diagnosticSettingsVersion: "); - builder.AppendLine($"{DiagnosticSettingsVersion.Value}"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnabledLogCategories), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" enabledLogCategories: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(EnabledLogCategories)) - { - if (EnabledLogCategories.Any()) - { - builder.Append(" enabledLogCategories: "); - builder.AppendLine("["); - foreach (var item in EnabledLogCategories) - { - if (item == null) - { - builder.Append("null"); - continue; - } - if (item.Contains(Environment.NewLine)) - { - builder.AppendLine(" '''"); - builder.AppendLine($"{item}'''"); - } - else - { - builder.AppendLine($" '{item}'"); - } - } - builder.AppendLine(" ]"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(NetworkSecurityProfile)} does not support writing '{options.Format}' format."); - } - } - - NetworkSecurityProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeNetworkSecurityProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(NetworkSecurityProfile)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityProfile.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityProfile.cs deleted file mode 100644 index 7bef32097d83..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityProfile.cs +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Network security perimeter configuration profile. - public partial class NetworkSecurityProfile - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public NetworkSecurityProfile() - { - AccessRules = new ChangeTrackingList(); - EnabledLogCategories = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Name of the profile. - /// Current access rules version. - /// List of Access Rules. - /// Current diagnostic settings version. - /// List of log categories that are enabled. - /// Keeps track of any properties unknown to the library. - internal NetworkSecurityProfile(string name, int? accessRulesVersion, IList accessRules, int? diagnosticSettingsVersion, IList enabledLogCategories, IDictionary serializedAdditionalRawData) - { - Name = name; - AccessRulesVersion = accessRulesVersion; - AccessRules = accessRules; - DiagnosticSettingsVersion = diagnosticSettingsVersion; - EnabledLogCategories = enabledLogCategories; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Name of the profile. - [WirePath("name")] - public string Name { get; set; } - /// Current access rules version. - [WirePath("accessRulesVersion")] - public int? AccessRulesVersion { get; set; } - /// List of Access Rules. - [WirePath("accessRules")] - public IList AccessRules { get; } - /// Current diagnostic settings version. - [WirePath("diagnosticSettingsVersion")] - public int? DiagnosticSettingsVersion { get; set; } - /// List of log categories that are enabled. - [WirePath("enabledLogCategories")] - public IList EnabledLogCategories { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfo.Serialization.cs deleted file mode 100644 index a572464131fc..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfo.Serialization.cs +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class PhysicalPartitionStorageInfo : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PhysicalPartitionStorageInfo)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(Id)) - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W" && Optional.IsDefined(StorageInKB)) - { - writer.WritePropertyName("storageInKB"u8); - writer.WriteNumberValue(StorageInKB.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - PhysicalPartitionStorageInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PhysicalPartitionStorageInfo)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializePhysicalPartitionStorageInfo(document.RootElement, options); - } - - internal static PhysicalPartitionStorageInfo DeserializePhysicalPartitionStorageInfo(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string id = default; - double? storageInKB = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("storageInKB"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - storageInKB = property.Value.GetDouble(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new PhysicalPartitionStorageInfo(id, storageInKB, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - if (Id.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Id}'''"); - } - else - { - builder.AppendLine($"'{Id}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(StorageInKB), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" storageInKB: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(StorageInKB)) - { - builder.Append(" storageInKB: "); - builder.AppendLine($"'{StorageInKB.Value.ToString()}'"); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(PhysicalPartitionStorageInfo)} does not support writing '{options.Format}' format."); - } - } - - PhysicalPartitionStorageInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializePhysicalPartitionStorageInfo(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(PhysicalPartitionStorageInfo)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfoCollection.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfoCollection.Serialization.cs deleted file mode 100644 index ed2bb4b36431..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfoCollection.Serialization.cs +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class PhysicalPartitionStorageInfoCollection : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PhysicalPartitionStorageInfoCollection)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsCollectionDefined(PhysicalPartitionStorageInfoCollectionValue)) - { - writer.WritePropertyName("physicalPartitionStorageInfoCollection"u8); - writer.WriteStartArray(); - foreach (var item in PhysicalPartitionStorageInfoCollectionValue) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - PhysicalPartitionStorageInfoCollection IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PhysicalPartitionStorageInfoCollection)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializePhysicalPartitionStorageInfoCollection(document.RootElement, options); - } - - internal static PhysicalPartitionStorageInfoCollection DeserializePhysicalPartitionStorageInfoCollection(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList physicalPartitionStorageInfoCollection = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("physicalPartitionStorageInfoCollection"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(PhysicalPartitionStorageInfo.DeserializePhysicalPartitionStorageInfo(item, options)); - } - physicalPartitionStorageInfoCollection = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new PhysicalPartitionStorageInfoCollection(physicalPartitionStorageInfoCollection ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PhysicalPartitionStorageInfoCollectionValue), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" physicalPartitionStorageInfoCollection: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(PhysicalPartitionStorageInfoCollectionValue)) - { - if (PhysicalPartitionStorageInfoCollectionValue.Any()) - { - builder.Append(" physicalPartitionStorageInfoCollection: "); - builder.AppendLine("["); - foreach (var item in PhysicalPartitionStorageInfoCollectionValue) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " physicalPartitionStorageInfoCollection: "); - } - builder.AppendLine(" ]"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(PhysicalPartitionStorageInfoCollection)} does not support writing '{options.Format}' format."); - } - } - - PhysicalPartitionStorageInfoCollection IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializePhysicalPartitionStorageInfoCollection(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(PhysicalPartitionStorageInfoCollection)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfoCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfoCollection.cs deleted file mode 100644 index 0daaa283f1aa..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfoCollection.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// List of physical partitions and their properties returned by a merge operation. - public partial class PhysicalPartitionStorageInfoCollection - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal PhysicalPartitionStorageInfoCollection() - { - PhysicalPartitionStorageInfoCollectionValue = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// List of physical partitions and their properties. - /// Keeps track of any properties unknown to the library. - internal PhysicalPartitionStorageInfoCollection(IReadOnlyList physicalPartitionStorageInfoCollectionValue, IDictionary serializedAdditionalRawData) - { - PhysicalPartitionStorageInfoCollectionValue = physicalPartitionStorageInfoCollectionValue; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// List of physical partitions and their properties. - [WirePath("physicalPartitionStorageInfoCollection")] - public IReadOnlyList PhysicalPartitionStorageInfoCollectionValue { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoProperties.Serialization.cs deleted file mode 100644 index 6bc181c170b0..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoProperties.Serialization.cs +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - internal partial class PhysicalPartitionThroughputInfoProperties : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoProperties)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(PhysicalPartitionThroughputInfo)) - { - writer.WritePropertyName("physicalPartitionThroughputInfo"u8); - writer.WriteStartArray(); - foreach (var item in PhysicalPartitionThroughputInfo) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - PhysicalPartitionThroughputInfoProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoProperties)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializePhysicalPartitionThroughputInfoProperties(document.RootElement, options); - } - - internal static PhysicalPartitionThroughputInfoProperties DeserializePhysicalPartitionThroughputInfoProperties(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IList physicalPartitionThroughputInfo = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("physicalPartitionThroughputInfo"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(PhysicalPartitionThroughputInfoResource.DeserializePhysicalPartitionThroughputInfoResource(item, options)); - } - physicalPartitionThroughputInfo = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new PhysicalPartitionThroughputInfoProperties(physicalPartitionThroughputInfo ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PhysicalPartitionThroughputInfo), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" physicalPartitionThroughputInfo: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(PhysicalPartitionThroughputInfo)) - { - if (PhysicalPartitionThroughputInfo.Any()) - { - builder.Append(" physicalPartitionThroughputInfo: "); - builder.AppendLine("["); - foreach (var item in PhysicalPartitionThroughputInfo) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " physicalPartitionThroughputInfo: "); - } - builder.AppendLine(" ]"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoProperties)} does not support writing '{options.Format}' format."); - } - } - - PhysicalPartitionThroughputInfoProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializePhysicalPartitionThroughputInfoProperties(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoProperties)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoProperties.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoProperties.cs deleted file mode 100644 index 97162b467507..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoProperties.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The properties of an Azure Cosmos DB PhysicalPartitionThroughputInfoProperties object. - internal partial class PhysicalPartitionThroughputInfoProperties - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public PhysicalPartitionThroughputInfoProperties() - { - PhysicalPartitionThroughputInfo = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Array of physical partition throughput info objects. - /// Keeps track of any properties unknown to the library. - internal PhysicalPartitionThroughputInfoProperties(IList physicalPartitionThroughputInfo, IDictionary serializedAdditionalRawData) - { - PhysicalPartitionThroughputInfo = physicalPartitionThroughputInfo; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Array of physical partition throughput info objects. - [WirePath("physicalPartitionThroughputInfo")] - public IList PhysicalPartitionThroughputInfo { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResource.Serialization.cs deleted file mode 100644 index f3f7e055ab13..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResource.Serialization.cs +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class PhysicalPartitionThroughputInfoResource : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoResource)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - if (Optional.IsDefined(Throughput)) - { - writer.WritePropertyName("throughput"u8); - writer.WriteNumberValue(Throughput.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - PhysicalPartitionThroughputInfoResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoResource)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializePhysicalPartitionThroughputInfoResource(document.RootElement, options); - } - - internal static PhysicalPartitionThroughputInfoResource DeserializePhysicalPartitionThroughputInfoResource(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string id = default; - double? throughput = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("throughput"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - throughput = property.Value.GetDouble(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new PhysicalPartitionThroughputInfoResource(id, throughput, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - if (Id.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Id}'''"); - } - else - { - builder.AppendLine($"'{Id}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Throughput), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" throughput: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Throughput)) - { - builder.Append(" throughput: "); - builder.AppendLine($"'{Throughput.Value.ToString()}'"); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoResource)} does not support writing '{options.Format}' format."); - } - } - - PhysicalPartitionThroughputInfoResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializePhysicalPartitionThroughputInfoResource(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoResource)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResult.Serialization.cs deleted file mode 100644 index fb2383870ae5..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResult.Serialization.cs +++ /dev/null @@ -1,409 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class PhysicalPartitionThroughputInfoResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoResult)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Resource)) - { - writer.WritePropertyName("resource"u8); - writer.WriteObjectValue(Resource, options); - } - writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - PhysicalPartitionThroughputInfoResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializePhysicalPartitionThroughputInfoResult(document.RootElement, options); - } - - internal static PhysicalPartitionThroughputInfoResult DeserializePhysicalPartitionThroughputInfoResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ManagedServiceIdentity identity = default; - IDictionary tags = default; - AzureLocation location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - PhysicalPartitionThroughputInfoResultPropertiesResource resource = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("location"u8)) - { - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("resource"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resource = PhysicalPartitionThroughputInfoResultPropertiesResource.DeserializePhysicalPartitionThroughputInfoResultPropertiesResource(property0.Value, options); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new PhysicalPartitionThroughputInfoResult( - id, - name, - type, - systemData, - tags ?? new ChangeTrackingDictionary(), - location, - resource, - identity, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" location: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" location: "); - builder.AppendLine($"'{Location.ToString()}'"); - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" tags: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Tags)) - { - if (Tags.Any()) - { - builder.Append(" tags: "); - builder.AppendLine("{"); - foreach (var item in Tags) - { - builder.Append($" '{item.Key}': "); - if (item.Value == null) - { - builder.Append("null"); - continue; - } - if (item.Value.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{item.Value}'''"); - } - else - { - builder.AppendLine($"'{item.Value}'"); - } - } - builder.AppendLine(" }"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.Append(" properties:"); - builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("ResourcePhysicalPartitionThroughputInfo", out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" resource: "); - builder.AppendLine("{"); - builder.AppendLine(" resource: {"); - builder.Append(" physicalPartitionThroughputInfo: "); - builder.AppendLine(propertyOverride); - builder.AppendLine(" }"); - builder.AppendLine(" }"); - } - else - { - if (Optional.IsDefined(Resource)) - { - builder.Append(" resource: "); - BicepSerializationHelpers.AppendChildObject(builder, Resource, options, 4, false, " resource: "); - } - } - - builder.AppendLine(" }"); - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoResult)} does not support writing '{options.Format}' format."); - } - } - - PhysicalPartitionThroughputInfoResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializePhysicalPartitionThroughputInfoResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResult.cs deleted file mode 100644 index 8bba9011413b..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResult.cs +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// An Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. - public partial class PhysicalPartitionThroughputInfoResult : TrackedResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The location. - public PhysicalPartitionThroughputInfoResult(AzureLocation location) : base(location) - { - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// properties of physical partition throughput info. - /// Identity for the resource. - /// Keeps track of any properties unknown to the library. - internal PhysicalPartitionThroughputInfoResult(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, PhysicalPartitionThroughputInfoResultPropertiesResource resource, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) - { - Resource = resource; - Identity = identity; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal PhysicalPartitionThroughputInfoResult() - { - } - - /// properties of physical partition throughput info. - internal PhysicalPartitionThroughputInfoResultPropertiesResource Resource { get; set; } - /// Array of physical partition throughput info objects. - [WirePath("properties.resource.physicalPartitionThroughputInfo")] - public IList ResourcePhysicalPartitionThroughputInfo - { - get - { - if (Resource is null) - Resource = new PhysicalPartitionThroughputInfoResultPropertiesResource(); - return Resource.PhysicalPartitionThroughputInfo; - } - } - - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResultPropertiesResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResultPropertiesResource.Serialization.cs deleted file mode 100644 index 1cdc443d18f8..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResultPropertiesResource.Serialization.cs +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - internal partial class PhysicalPartitionThroughputInfoResultPropertiesResource : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoResultPropertiesResource)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(PhysicalPartitionThroughputInfo)) - { - writer.WritePropertyName("physicalPartitionThroughputInfo"u8); - writer.WriteStartArray(); - foreach (var item in PhysicalPartitionThroughputInfo) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - PhysicalPartitionThroughputInfoResultPropertiesResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoResultPropertiesResource)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializePhysicalPartitionThroughputInfoResultPropertiesResource(document.RootElement, options); - } - - internal static PhysicalPartitionThroughputInfoResultPropertiesResource DeserializePhysicalPartitionThroughputInfoResultPropertiesResource(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IList physicalPartitionThroughputInfo = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("physicalPartitionThroughputInfo"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(PhysicalPartitionThroughputInfoResource.DeserializePhysicalPartitionThroughputInfoResource(item, options)); - } - physicalPartitionThroughputInfo = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new PhysicalPartitionThroughputInfoResultPropertiesResource(physicalPartitionThroughputInfo ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PhysicalPartitionThroughputInfo), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" physicalPartitionThroughputInfo: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(PhysicalPartitionThroughputInfo)) - { - if (PhysicalPartitionThroughputInfo.Any()) - { - builder.Append(" physicalPartitionThroughputInfo: "); - builder.AppendLine("["); - foreach (var item in PhysicalPartitionThroughputInfo) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " physicalPartitionThroughputInfo: "); - } - builder.AppendLine(" ]"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoResultPropertiesResource)} does not support writing '{options.Format}' format."); - } - } - - PhysicalPartitionThroughputInfoResultPropertiesResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializePhysicalPartitionThroughputInfoResultPropertiesResource(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoResultPropertiesResource)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResultPropertiesResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResultPropertiesResource.cs deleted file mode 100644 index ffa08db0780d..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResultPropertiesResource.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// properties of physical partition throughput info. - internal partial class PhysicalPartitionThroughputInfoResultPropertiesResource : PhysicalPartitionThroughputInfoProperties - { - /// Initializes a new instance of . - public PhysicalPartitionThroughputInfoResultPropertiesResource() - { - } - - /// Initializes a new instance of . - /// Array of physical partition throughput info objects. - /// Keeps track of any properties unknown to the library. - internal PhysicalPartitionThroughputInfoResultPropertiesResource(IList physicalPartitionThroughputInfo, IDictionary serializedAdditionalRawData) : base(physicalPartitionThroughputInfo, serializedAdditionalRawData) - { - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssue.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssue.Serialization.cs deleted file mode 100644 index 3ad4d9f142b2..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssue.Serialization.cs +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class ProvisioningIssue : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ProvisioningIssue)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W" && Optional.IsDefined(Properties)) - { - writer.WritePropertyName("properties"u8); - writer.WriteObjectValue(Properties, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ProvisioningIssue IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ProvisioningIssue)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeProvisioningIssue(document.RootElement, options); - } - - internal static ProvisioningIssue DeserializeProvisioningIssue(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string name = default; - ProvisioningIssueProperties properties = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - properties = ProvisioningIssueProperties.DeserializeProvisioningIssueProperties(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ProvisioningIssue(name, properties, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Properties), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" properties: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Properties)) - { - builder.Append(" properties: "); - BicepSerializationHelpers.AppendChildObject(builder, Properties, options, 2, false, " properties: "); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(ProvisioningIssue)} does not support writing '{options.Format}' format."); - } - } - - ProvisioningIssue IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeProvisioningIssue(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ProvisioningIssue)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssue.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssue.cs deleted file mode 100644 index 4f32a2bb5d5f..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssue.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Describes a provisioning issue for a network security perimeter configuration. - public partial class ProvisioningIssue - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal ProvisioningIssue() - { - } - - /// Initializes a new instance of . - /// Name of the issue. - /// Details of a provisioning issue for a network security perimeter (NSP) configuration. Resource providers should generate separate provisioning issue elements for each separate issue detected, and include a meaningful and distinctive description, as well as any appropriate suggestedResourceIds and suggestedAccessRules. - /// Keeps track of any properties unknown to the library. - internal ProvisioningIssue(string name, ProvisioningIssueProperties properties, IDictionary serializedAdditionalRawData) - { - Name = name; - Properties = properties; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Name of the issue. - [WirePath("name")] - public string Name { get; } - /// Details of a provisioning issue for a network security perimeter (NSP) configuration. Resource providers should generate separate provisioning issue elements for each separate issue detected, and include a meaningful and distinctive description, as well as any appropriate suggestedResourceIds and suggestedAccessRules. - [WirePath("properties")] - public ProvisioningIssueProperties Properties { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssueProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssueProperties.Serialization.cs deleted file mode 100644 index 5cfce516a6f9..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssueProperties.Serialization.cs +++ /dev/null @@ -1,343 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class ProvisioningIssueProperties : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ProvisioningIssueProperties)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(IssueType)) - { - writer.WritePropertyName("issueType"u8); - writer.WriteStringValue(IssueType.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(Severity)) - { - writer.WritePropertyName("severity"u8); - writer.WriteStringValue(Severity.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(Description)) - { - writer.WritePropertyName("description"u8); - writer.WriteStringValue(Description); - } - if (options.Format != "W" && Optional.IsCollectionDefined(SuggestedResourceIds)) - { - writer.WritePropertyName("suggestedResourceIds"u8); - writer.WriteStartArray(); - foreach (var item in SuggestedResourceIds) - { - if (item == null) - { - writer.WriteNullValue(); - continue; - } - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsCollectionDefined(SuggestedAccessRules)) - { - writer.WritePropertyName("suggestedAccessRules"u8); - writer.WriteStartArray(); - foreach (var item in SuggestedAccessRules) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ProvisioningIssueProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ProvisioningIssueProperties)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeProvisioningIssueProperties(document.RootElement, options); - } - - internal static ProvisioningIssueProperties DeserializeProvisioningIssueProperties(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IssueType? issueType = default; - Severity? severity = default; - string description = default; - IReadOnlyList suggestedResourceIds = default; - IReadOnlyList suggestedAccessRules = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("issueType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - issueType = new IssueType(property.Value.GetString()); - continue; - } - if (property.NameEquals("severity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - severity = new Severity(property.Value.GetString()); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("suggestedResourceIds"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - if (item.ValueKind == JsonValueKind.Null) - { - array.Add(null); - } - else - { - array.Add(new ResourceIdentifier(item.GetString())); - } - } - suggestedResourceIds = array; - continue; - } - if (property.NameEquals("suggestedAccessRules"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(AccessRule.DeserializeAccessRule(item, options)); - } - suggestedAccessRules = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ProvisioningIssueProperties( - issueType, - severity, - description, - suggestedResourceIds ?? new ChangeTrackingList(), - suggestedAccessRules ?? new ChangeTrackingList(), - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IssueType), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" issueType: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(IssueType)) - { - builder.Append(" issueType: "); - builder.AppendLine($"'{IssueType.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Severity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" severity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Severity)) - { - builder.Append(" severity: "); - builder.AppendLine($"'{Severity.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Description), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" description: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Description)) - { - builder.Append(" description: "); - if (Description.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Description}'''"); - } - else - { - builder.AppendLine($"'{Description}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SuggestedResourceIds), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" suggestedResourceIds: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(SuggestedResourceIds)) - { - if (SuggestedResourceIds.Any()) - { - builder.Append(" suggestedResourceIds: "); - builder.AppendLine("["); - foreach (var item in SuggestedResourceIds) - { - if (item == null) - { - builder.Append("null"); - continue; - } - builder.AppendLine($" '{item.ToString()}'"); - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SuggestedAccessRules), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" suggestedAccessRules: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(SuggestedAccessRules)) - { - if (SuggestedAccessRules.Any()) - { - builder.Append(" suggestedAccessRules: "); - builder.AppendLine("["); - foreach (var item in SuggestedAccessRules) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " suggestedAccessRules: "); - } - builder.AppendLine(" ]"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(ProvisioningIssueProperties)} does not support writing '{options.Format}' format."); - } - } - - ProvisioningIssueProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeProvisioningIssueProperties(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ProvisioningIssueProperties)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssueProperties.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssueProperties.cs deleted file mode 100644 index bcbdbd08f583..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssueProperties.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Details of a provisioning issue for a network security perimeter (NSP) configuration. Resource providers should generate separate provisioning issue elements for each separate issue detected, and include a meaningful and distinctive description, as well as any appropriate suggestedResourceIds and suggestedAccessRules. - public partial class ProvisioningIssueProperties - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal ProvisioningIssueProperties() - { - SuggestedResourceIds = new ChangeTrackingList(); - SuggestedAccessRules = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Type of issue. - /// Severity of the issue. - /// Description of the issue. - /// Fully qualified resource IDs of suggested resources that can be associated to the network security perimeter (NSP) to remediate the issue. - /// Access rules that can be added to the network security profile (NSP) to remediate the issue. - /// Keeps track of any properties unknown to the library. - internal ProvisioningIssueProperties(IssueType? issueType, Severity? severity, string description, IReadOnlyList suggestedResourceIds, IReadOnlyList suggestedAccessRules, IDictionary serializedAdditionalRawData) - { - IssueType = issueType; - Severity = severity; - Description = description; - SuggestedResourceIds = suggestedResourceIds; - SuggestedAccessRules = suggestedAccessRules; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Type of issue. - [WirePath("issueType")] - public IssueType? IssueType { get; } - /// Severity of the issue. - [WirePath("severity")] - public Severity? Severity { get; } - /// Description of the issue. - [WirePath("description")] - public string Description { get; } - /// Fully qualified resource IDs of suggested resources that can be associated to the network security perimeter (NSP) to remediate the issue. - [WirePath("suggestedResourceIds")] - public IReadOnlyList SuggestedResourceIds { get; } - /// Access rules that can be added to the network security profile (NSP) to remediate the issue. - [WirePath("suggestedAccessRules")] - public IReadOnlyList SuggestedAccessRules { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputParameters.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputParameters.Serialization.cs deleted file mode 100644 index 1163bc237047..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputParameters.Serialization.cs +++ /dev/null @@ -1,397 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class RedistributeThroughputParameters : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RedistributeThroughputParameters)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - writer.WritePropertyName("resource"u8); - writer.WriteObjectValue(Resource, options); - writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - RedistributeThroughputParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RedistributeThroughputParameters)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRedistributeThroughputParameters(document.RootElement, options); - } - - internal static RedistributeThroughputParameters DeserializeRedistributeThroughputParameters(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ManagedServiceIdentity identity = default; - IDictionary tags = default; - AzureLocation location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - RedistributeThroughputPropertiesResource resource = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("location"u8)) - { - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("resource"u8)) - { - resource = RedistributeThroughputPropertiesResource.DeserializeRedistributeThroughputPropertiesResource(property0.Value, options); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new RedistributeThroughputParameters( - id, - name, - type, - systemData, - tags ?? new ChangeTrackingDictionary(), - location, - resource, - identity, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" location: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" location: "); - builder.AppendLine($"'{Location.ToString()}'"); - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" tags: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Tags)) - { - if (Tags.Any()) - { - builder.Append(" tags: "); - builder.AppendLine("{"); - foreach (var item in Tags) - { - builder.Append($" '{item.Key}': "); - if (item.Value == null) - { - builder.Append("null"); - continue; - } - if (item.Value.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{item.Value}'''"); - } - else - { - builder.AppendLine($"'{item.Value}'"); - } - } - builder.AppendLine(" }"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.Append(" properties:"); - builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Resource), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" resource: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Resource)) - { - builder.Append(" resource: "); - BicepSerializationHelpers.AppendChildObject(builder, Resource, options, 4, false, " resource: "); - } - } - - builder.AppendLine(" }"); - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(RedistributeThroughputParameters)} does not support writing '{options.Format}' format."); - } - } - - RedistributeThroughputParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeRedistributeThroughputParameters(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(RedistributeThroughputParameters)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputParameters.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputParameters.cs deleted file mode 100644 index 57defd98b0ce..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputParameters.cs +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Cosmos DB redistribute throughput parameters object. - public partial class RedistributeThroughputParameters : TrackedResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The location. - /// The standard JSON format of a resource throughput. - /// is null. - public RedistributeThroughputParameters(AzureLocation location, RedistributeThroughputPropertiesResource resource) : base(location) - { - Argument.AssertNotNull(resource, nameof(resource)); - - Resource = resource; - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The standard JSON format of a resource throughput. - /// Identity for the resource. - /// Keeps track of any properties unknown to the library. - internal RedistributeThroughputParameters(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, RedistributeThroughputPropertiesResource resource, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) - { - Resource = resource; - Identity = identity; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal RedistributeThroughputParameters() - { - } - - /// The standard JSON format of a resource throughput. - [WirePath("properties.resource")] - public RedistributeThroughputPropertiesResource Resource { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputPropertiesResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputPropertiesResource.Serialization.cs deleted file mode 100644 index 7ef27772ab3f..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputPropertiesResource.Serialization.cs +++ /dev/null @@ -1,232 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class RedistributeThroughputPropertiesResource : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RedistributeThroughputPropertiesResource)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("throughputPolicy"u8); - writer.WriteStringValue(ThroughputPolicy.ToString()); - writer.WritePropertyName("targetPhysicalPartitionThroughputInfo"u8); - writer.WriteStartArray(); - foreach (var item in TargetPhysicalPartitionThroughputInfo) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - writer.WritePropertyName("sourcePhysicalPartitionThroughputInfo"u8); - writer.WriteStartArray(); - foreach (var item in SourcePhysicalPartitionThroughputInfo) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - RedistributeThroughputPropertiesResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RedistributeThroughputPropertiesResource)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRedistributeThroughputPropertiesResource(document.RootElement, options); - } - - internal static RedistributeThroughputPropertiesResource DeserializeRedistributeThroughputPropertiesResource(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ThroughputPolicyType throughputPolicy = default; - IList targetPhysicalPartitionThroughputInfo = default; - IList sourcePhysicalPartitionThroughputInfo = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("throughputPolicy"u8)) - { - throughputPolicy = new ThroughputPolicyType(property.Value.GetString()); - continue; - } - if (property.NameEquals("targetPhysicalPartitionThroughputInfo"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(PhysicalPartitionThroughputInfoResource.DeserializePhysicalPartitionThroughputInfoResource(item, options)); - } - targetPhysicalPartitionThroughputInfo = array; - continue; - } - if (property.NameEquals("sourcePhysicalPartitionThroughputInfo"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(PhysicalPartitionThroughputInfoResource.DeserializePhysicalPartitionThroughputInfoResource(item, options)); - } - sourcePhysicalPartitionThroughputInfo = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new RedistributeThroughputPropertiesResource(throughputPolicy, targetPhysicalPartitionThroughputInfo, sourcePhysicalPartitionThroughputInfo, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ThroughputPolicy), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" throughputPolicy: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" throughputPolicy: "); - builder.AppendLine($"'{ThroughputPolicy.ToString()}'"); - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TargetPhysicalPartitionThroughputInfo), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" targetPhysicalPartitionThroughputInfo: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(TargetPhysicalPartitionThroughputInfo)) - { - if (TargetPhysicalPartitionThroughputInfo.Any()) - { - builder.Append(" targetPhysicalPartitionThroughputInfo: "); - builder.AppendLine("["); - foreach (var item in TargetPhysicalPartitionThroughputInfo) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " targetPhysicalPartitionThroughputInfo: "); - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SourcePhysicalPartitionThroughputInfo), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" sourcePhysicalPartitionThroughputInfo: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(SourcePhysicalPartitionThroughputInfo)) - { - if (SourcePhysicalPartitionThroughputInfo.Any()) - { - builder.Append(" sourcePhysicalPartitionThroughputInfo: "); - builder.AppendLine("["); - foreach (var item in SourcePhysicalPartitionThroughputInfo) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " sourcePhysicalPartitionThroughputInfo: "); - } - builder.AppendLine(" ]"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(RedistributeThroughputPropertiesResource)} does not support writing '{options.Format}' format."); - } - } - - RedistributeThroughputPropertiesResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeRedistributeThroughputPropertiesResource(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(RedistributeThroughputPropertiesResource)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputPropertiesResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputPropertiesResource.cs deleted file mode 100644 index 976ba582e211..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputPropertiesResource.cs +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Resource to redistribute throughput for Azure Cosmos DB resource. - public partial class RedistributeThroughputPropertiesResource - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// ThroughputPolicy to apply for throughput redistribution. - /// Array of PhysicalPartitionThroughputInfoResource objects. - /// Array of PhysicalPartitionThroughputInfoResource objects. - /// or is null. - public RedistributeThroughputPropertiesResource(ThroughputPolicyType throughputPolicy, IEnumerable targetPhysicalPartitionThroughputInfo, IEnumerable sourcePhysicalPartitionThroughputInfo) - { - Argument.AssertNotNull(targetPhysicalPartitionThroughputInfo, nameof(targetPhysicalPartitionThroughputInfo)); - Argument.AssertNotNull(sourcePhysicalPartitionThroughputInfo, nameof(sourcePhysicalPartitionThroughputInfo)); - - ThroughputPolicy = throughputPolicy; - TargetPhysicalPartitionThroughputInfo = targetPhysicalPartitionThroughputInfo.ToList(); - SourcePhysicalPartitionThroughputInfo = sourcePhysicalPartitionThroughputInfo.ToList(); - } - - /// Initializes a new instance of . - /// ThroughputPolicy to apply for throughput redistribution. - /// Array of PhysicalPartitionThroughputInfoResource objects. - /// Array of PhysicalPartitionThroughputInfoResource objects. - /// Keeps track of any properties unknown to the library. - internal RedistributeThroughputPropertiesResource(ThroughputPolicyType throughputPolicy, IList targetPhysicalPartitionThroughputInfo, IList sourcePhysicalPartitionThroughputInfo, IDictionary serializedAdditionalRawData) - { - ThroughputPolicy = throughputPolicy; - TargetPhysicalPartitionThroughputInfo = targetPhysicalPartitionThroughputInfo; - SourcePhysicalPartitionThroughputInfo = sourcePhysicalPartitionThroughputInfo; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal RedistributeThroughputPropertiesResource() - { - } - - /// ThroughputPolicy to apply for throughput redistribution. - [WirePath("throughputPolicy")] - public ThroughputPolicyType ThroughputPolicy { get; set; } - /// Array of PhysicalPartitionThroughputInfoResource objects. - [WirePath("targetPhysicalPartitionThroughputInfo")] - public IList TargetPhysicalPartitionThroughputInfo { get; } - /// Array of PhysicalPartitionThroughputInfoResource objects. - [WirePath("sourcePhysicalPartitionThroughputInfo")] - public IList SourcePhysicalPartitionThroughputInfo { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceAssociation.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceAssociation.Serialization.cs deleted file mode 100644 index a61d7bd79944..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceAssociation.Serialization.cs +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class ResourceAssociation : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ResourceAssociation)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (Optional.IsDefined(AccessMode)) - { - writer.WritePropertyName("accessMode"u8); - writer.WriteStringValue(AccessMode.Value.ToString()); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ResourceAssociation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ResourceAssociation)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeResourceAssociation(document.RootElement, options); - } - - internal static ResourceAssociation DeserializeResourceAssociation(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string name = default; - ResourceAssociationAccessMode? accessMode = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("accessMode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - accessMode = new ResourceAssociationAccessMode(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ResourceAssociation(name, accessMode, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AccessMode), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" accessMode: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(AccessMode)) - { - builder.Append(" accessMode: "); - builder.AppendLine($"'{AccessMode.Value.ToString()}'"); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(ResourceAssociation)} does not support writing '{options.Format}' format."); - } - } - - ResourceAssociation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeResourceAssociation(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ResourceAssociation)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceAssociationAccessMode.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceAssociationAccessMode.cs deleted file mode 100644 index 91728a906cc3..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceAssociationAccessMode.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Access mode of the resource association. - public readonly partial struct ResourceAssociationAccessMode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ResourceAssociationAccessMode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string EnforcedValue = "Enforced"; - private const string LearningValue = "Learning"; - private const string AuditValue = "Audit"; - - /// Enforced access mode - traffic to the resource that failed access checks is blocked. - public static ResourceAssociationAccessMode Enforced { get; } = new ResourceAssociationAccessMode(EnforcedValue); - /// Learning access mode - traffic to the resource is enabled for analysis but not blocked. - public static ResourceAssociationAccessMode Learning { get; } = new ResourceAssociationAccessMode(LearningValue); - /// Audit access mode - traffic to the resource that fails access checks is logged but not blocked. - public static ResourceAssociationAccessMode Audit { get; } = new ResourceAssociationAccessMode(AuditValue); - /// Determines if two values are the same. - public static bool operator ==(ResourceAssociationAccessMode left, ResourceAssociationAccessMode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ResourceAssociationAccessMode left, ResourceAssociationAccessMode right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ResourceAssociationAccessMode(string value) => new ResourceAssociationAccessMode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ResourceAssociationAccessMode other && Equals(other); - /// - public bool Equals(ResourceAssociationAccessMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.Serialization.cs index ae926e9fc922..2b68debde754 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.Serialization.cs @@ -95,11 +95,6 @@ void IJsonModel.Write(Utf8Jso writer.WritePropertyName("createMode"u8); writer.WriteStringValue(CreateMode.Value.ToString()); } - if (Optional.IsDefined(MaterializedViewDefinition)) - { - writer.WritePropertyName("materializedViewDefinition"u8); - writer.WriteObjectValue(MaterializedViewDefinition, options); - } if (Optional.IsCollectionDefined(ComputedProperties)) { writer.WritePropertyName("computedProperties"u8); @@ -162,7 +157,6 @@ internal static RestorableSqlContainerPropertiesResourceContainer DeserializeRes long? analyticalStorageTtl = default; ResourceRestoreParameters restoreParameters = default; CosmosDBAccountCreateMode? createMode = default; - MaterializedViewDefinition materializedViewDefinition = default; IList computedProperties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -282,15 +276,6 @@ internal static RestorableSqlContainerPropertiesResourceContainer DeserializeRes createMode = new CosmosDBAccountCreateMode(property.Value.GetString()); continue; } - if (property.NameEquals("materializedViewDefinition"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - materializedViewDefinition = MaterializedViewDefinition.DeserializeMaterializedViewDefinition(property.Value, options); - continue; - } if (property.NameEquals("computedProperties"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -322,7 +307,6 @@ internal static RestorableSqlContainerPropertiesResourceContainer DeserializeRes analyticalStorageTtl, restoreParameters, createMode, - materializedViewDefinition, computedProperties ?? new ChangeTrackingList(), serializedAdditionalRawData, self, @@ -579,21 +563,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MaterializedViewDefinition), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" materializedViewDefinition: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(MaterializedViewDefinition)) - { - builder.Append(" materializedViewDefinition: "); - BicepSerializationHelpers.AppendChildObject(builder, MaterializedViewDefinition, options, 2, false, " materializedViewDefinition: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ComputedProperties), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.cs index 4c8b5028942d..7d4e4fbcc13a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.cs @@ -32,14 +32,13 @@ public RestorableSqlContainerPropertiesResourceContainer(string containerName) : /// Analytical TTL. /// Parameters to indicate the information about the restore. /// Enum to indicate the mode of resource creation. - /// The configuration for defining Materialized Views. This must be specified only for creating a Materialized View container. /// List of computed properties. /// Keeps track of any properties unknown to the library. /// A system generated property that specifies the addressable path of the container resource. /// A system generated property. A unique identifier. /// A system generated property that denotes the last updated timestamp of the resource. /// A system generated property representing the resource etag required for optimistic concurrency control. - internal RestorableSqlContainerPropertiesResourceContainer(string containerName, CosmosDBIndexingPolicy indexingPolicy, CosmosDBContainerPartitionKey partitionKey, int? defaultTtl, CosmosDBUniqueKeyPolicy uniqueKeyPolicy, ConflictResolutionPolicy conflictResolutionPolicy, CosmosDBClientEncryptionPolicy clientEncryptionPolicy, long? analyticalStorageTtl, ResourceRestoreParameters restoreParameters, CosmosDBAccountCreateMode? createMode, MaterializedViewDefinition materializedViewDefinition, IList computedProperties, IDictionary serializedAdditionalRawData, string self, string rid, float? timestamp, ETag? etag) : base(containerName, indexingPolicy, partitionKey, defaultTtl, uniqueKeyPolicy, conflictResolutionPolicy, clientEncryptionPolicy, analyticalStorageTtl, restoreParameters, createMode, materializedViewDefinition, computedProperties, serializedAdditionalRawData) + internal RestorableSqlContainerPropertiesResourceContainer(string containerName, CosmosDBIndexingPolicy indexingPolicy, CosmosDBContainerPartitionKey partitionKey, int? defaultTtl, CosmosDBUniqueKeyPolicy uniqueKeyPolicy, ConflictResolutionPolicy conflictResolutionPolicy, CosmosDBClientEncryptionPolicy clientEncryptionPolicy, long? analyticalStorageTtl, ResourceRestoreParameters restoreParameters, CosmosDBAccountCreateMode? createMode, IList computedProperties, IDictionary serializedAdditionalRawData, string self, string rid, float? timestamp, ETag? etag) : base(containerName, indexingPolicy, partitionKey, defaultTtl, uniqueKeyPolicy, conflictResolutionPolicy, clientEncryptionPolicy, analyticalStorageTtl, restoreParameters, createMode, computedProperties, serializedAdditionalRawData) { Self = self; Rid = rid; diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputParameters.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputParameters.Serialization.cs deleted file mode 100644 index 2adaa73f9dd4..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputParameters.Serialization.cs +++ /dev/null @@ -1,402 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class RetrieveThroughputParameters : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RetrieveThroughputParameters)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - writer.WritePropertyName("resource"u8); - writer.WriteObjectValue(Resource, options); - writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - RetrieveThroughputParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RetrieveThroughputParameters)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRetrieveThroughputParameters(document.RootElement, options); - } - - internal static RetrieveThroughputParameters DeserializeRetrieveThroughputParameters(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ManagedServiceIdentity identity = default; - IDictionary tags = default; - AzureLocation location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - RetrieveThroughputPropertiesResource resource = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("location"u8)) - { - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("resource"u8)) - { - resource = RetrieveThroughputPropertiesResource.DeserializeRetrieveThroughputPropertiesResource(property0.Value, options); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new RetrieveThroughputParameters( - id, - name, - type, - systemData, - tags ?? new ChangeTrackingDictionary(), - location, - resource, - identity, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" location: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" location: "); - builder.AppendLine($"'{Location.ToString()}'"); - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" tags: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Tags)) - { - if (Tags.Any()) - { - builder.Append(" tags: "); - builder.AppendLine("{"); - foreach (var item in Tags) - { - builder.Append($" '{item.Key}': "); - if (item.Value == null) - { - builder.Append("null"); - continue; - } - if (item.Value.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{item.Value}'''"); - } - else - { - builder.AppendLine($"'{item.Value}'"); - } - } - builder.AppendLine(" }"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.Append(" properties:"); - builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("ResourcePhysicalPartitionIds", out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" resource: "); - builder.AppendLine("{"); - builder.AppendLine(" resource: {"); - builder.Append(" physicalPartitionIds: "); - builder.AppendLine(propertyOverride); - builder.AppendLine(" }"); - builder.AppendLine(" }"); - } - else - { - if (Optional.IsDefined(Resource)) - { - builder.Append(" resource: "); - BicepSerializationHelpers.AppendChildObject(builder, Resource, options, 4, false, " resource: "); - } - } - - builder.AppendLine(" }"); - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(RetrieveThroughputParameters)} does not support writing '{options.Format}' format."); - } - } - - RetrieveThroughputParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeRetrieveThroughputParameters(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(RetrieveThroughputParameters)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputParameters.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputParameters.cs deleted file mode 100644 index f9a7b72442b1..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputParameters.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Cosmos DB retrieve throughput parameters object. - public partial class RetrieveThroughputParameters : TrackedResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The location. - /// The standard JSON format of a resource throughput. - /// is null. - public RetrieveThroughputParameters(AzureLocation location, RetrieveThroughputPropertiesResource resource) : base(location) - { - Argument.AssertNotNull(resource, nameof(resource)); - - Resource = resource; - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The standard JSON format of a resource throughput. - /// Identity for the resource. - /// Keeps track of any properties unknown to the library. - internal RetrieveThroughputParameters(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, RetrieveThroughputPropertiesResource resource, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) - { - Resource = resource; - Identity = identity; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal RetrieveThroughputParameters() - { - } - - /// The standard JSON format of a resource throughput. - internal RetrieveThroughputPropertiesResource Resource { get; set; } - /// Array of PhysicalPartitionId objects. - [WirePath("properties.resource.physicalPartitionIds")] - public IList ResourcePhysicalPartitionIds - { - get => Resource is null ? default : Resource.PhysicalPartitionIds; - set => Resource = new RetrieveThroughputPropertiesResource(value); - } - - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputPropertiesResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputPropertiesResource.Serialization.cs deleted file mode 100644 index ad10bd2bd2cb..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputPropertiesResource.Serialization.cs +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class RetrieveThroughputPropertiesResource : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RetrieveThroughputPropertiesResource)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("physicalPartitionIds"u8); - writer.WriteStartArray(); - foreach (var item in PhysicalPartitionIds) - { - JsonSerializer.Serialize(writer, item); - } - writer.WriteEndArray(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - RetrieveThroughputPropertiesResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RetrieveThroughputPropertiesResource)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRetrieveThroughputPropertiesResource(document.RootElement, options); - } - - internal static RetrieveThroughputPropertiesResource DeserializeRetrieveThroughputPropertiesResource(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IList physicalPartitionIds = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("physicalPartitionIds"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(JsonSerializer.Deserialize(item.GetRawText())); - } - physicalPartitionIds = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new RetrieveThroughputPropertiesResource(physicalPartitionIds, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PhysicalPartitionIds), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" physicalPartitionIds: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(PhysicalPartitionIds)) - { - if (PhysicalPartitionIds.Any()) - { - builder.Append(" physicalPartitionIds: "); - builder.AppendLine("["); - foreach (var item in PhysicalPartitionIds) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " physicalPartitionIds: "); - } - builder.AppendLine(" ]"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(RetrieveThroughputPropertiesResource)} does not support writing '{options.Format}' format."); - } - } - - RetrieveThroughputPropertiesResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeRetrieveThroughputPropertiesResource(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(RetrieveThroughputPropertiesResource)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ScheduledEventStrategy.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ScheduledEventStrategy.cs deleted file mode 100644 index 1055fc3b25ce..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ScheduledEventStrategy.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// How the nodes in the cluster react to scheduled events. - public readonly partial struct ScheduledEventStrategy : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ScheduledEventStrategy(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string IgnoreValue = "Ignore"; - private const string StopAnyValue = "StopAny"; - private const string StopByRackValue = "StopByRack"; - - /// Ignore. - public static ScheduledEventStrategy Ignore { get; } = new ScheduledEventStrategy(IgnoreValue); - /// StopAny. - public static ScheduledEventStrategy StopAny { get; } = new ScheduledEventStrategy(StopAnyValue); - /// StopByRack. - public static ScheduledEventStrategy StopByRack { get; } = new ScheduledEventStrategy(StopByRackValue); - /// Determines if two values are the same. - public static bool operator ==(ScheduledEventStrategy left, ScheduledEventStrategy right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ScheduledEventStrategy left, ScheduledEventStrategy right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ScheduledEventStrategy(string value) => new ScheduledEventStrategy(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ScheduledEventStrategy other && Equals(other); - /// - public bool Equals(ScheduledEventStrategy other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Severity.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Severity.cs deleted file mode 100644 index bec88dffd8a4..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Severity.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Severity of the issue. - public readonly partial struct Severity : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public Severity(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string WarningValue = "Warning"; - private const string ErrorValue = "Error"; - - /// Warning. - public static Severity Warning { get; } = new Severity(WarningValue); - /// Error. - public static Severity Error { get; } = new Severity(ErrorValue); - /// Determines if two values are the same. - public static bool operator ==(Severity left, Severity right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(Severity left, Severity right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator Severity(string value) => new Severity(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is Severity other && Equals(other); - /// - public bool Equals(Severity other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPolicyType.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPolicyType.cs deleted file mode 100644 index 1f7d2bc10e90..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPolicyType.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// ThroughputPolicy to apply for throughput redistribution. - public readonly partial struct ThroughputPolicyType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ThroughputPolicyType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string NoneValue = "none"; - private const string EqualValue = "equal"; - private const string CustomValue = "custom"; - - /// none. - public static ThroughputPolicyType None { get; } = new ThroughputPolicyType(NoneValue); - /// equal. - public static ThroughputPolicyType Equal { get; } = new ThroughputPolicyType(EqualValue); - /// custom. - public static ThroughputPolicyType Custom { get; } = new ThroughputPolicyType(CustomValue); - /// Determines if two values are the same. - public static bool operator ==(ThroughputPolicyType left, ThroughputPolicyType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ThroughputPolicyType left, ThroughputPolicyType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ThroughputPolicyType(string value) => new ThroughputPolicyType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ThroughputPolicyType other && Equals(other); - /// - public bool Equals(ThroughputPolicyType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolAccountsListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolAccountsListResult.Serialization.cs deleted file mode 100644 index b25cf83d836c..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolAccountsListResult.Serialization.cs +++ /dev/null @@ -1,212 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - internal partial class ThroughputPoolAccountsListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ThroughputPoolAccountsListResult)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ThroughputPoolAccountsListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ThroughputPoolAccountsListResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeThroughputPoolAccountsListResult(document.RootElement, options); - } - - internal static ThroughputPoolAccountsListResult DeserializeThroughputPoolAccountsListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - string nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(CosmosDBThroughputPoolAccountData.DeserializeCosmosDBThroughputPoolAccountData(item, options)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ThroughputPoolAccountsListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" value: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Value)) - { - if (Value.Any()) - { - builder.Append(" value: "); - builder.AppendLine("["); - foreach (var item in Value) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" nextLink: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(NextLink)) - { - builder.Append(" nextLink: "); - if (NextLink.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{NextLink}'''"); - } - else - { - builder.AppendLine($"'{NextLink}'"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(ThroughputPoolAccountsListResult)} does not support writing '{options.Format}' format."); - } - } - - ThroughputPoolAccountsListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeThroughputPoolAccountsListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ThroughputPoolAccountsListResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolsListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolsListResult.Serialization.cs deleted file mode 100644 index 7cca36703583..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolsListResult.Serialization.cs +++ /dev/null @@ -1,212 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - internal partial class ThroughputPoolsListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ThroughputPoolsListResult)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ThroughputPoolsListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ThroughputPoolsListResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeThroughputPoolsListResult(document.RootElement, options); - } - - internal static ThroughputPoolsListResult DeserializeThroughputPoolsListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - string nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(CosmosDBThroughputPoolData.DeserializeCosmosDBThroughputPoolData(item, options)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ThroughputPoolsListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" value: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Value)) - { - if (Value.Any()) - { - builder.Append(" value: "); - builder.AppendLine("["); - foreach (var item in Value) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" nextLink: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(NextLink)) - { - builder.Append(" nextLink: "); - if (NextLink.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{NextLink}'''"); - } - else - { - builder.AppendLine($"'{NextLink}'"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(ThroughputPoolsListResult)} does not support writing '{options.Format}' format."); - } - } - - ThroughputPoolsListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeThroughputPoolsListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ThroughputPoolsListResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsUpdateData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsUpdateData.Serialization.cs index 2a6222569248..c5d39460d301 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsUpdateData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsUpdateData.Serialization.cs @@ -29,12 +29,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -111,7 +105,6 @@ internal static ThroughputSettingsUpdateData DeserializeThroughputSettingsUpdate { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -123,16 +116,6 @@ internal static ThroughputSettingsUpdateData DeserializeThroughputSettingsUpdate Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -207,7 +190,6 @@ internal static ThroughputSettingsUpdateData DeserializeThroughputSettingsUpdate tags ?? new ChangeTrackingDictionary(), location, resource, - identity, serializedAdditionalRawData); } @@ -294,21 +276,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsUpdateData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsUpdateData.cs index 499a10c81fc2..bbebf2c8ea00 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsUpdateData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsUpdateData.cs @@ -66,12 +66,10 @@ public ThroughputSettingsUpdateData(AzureLocation location, ThroughputSettingsRe /// The tags. /// The location. /// The standard JSON format of a resource throughput. - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal ThroughputSettingsUpdateData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ThroughputSettingsResourceInfo resource, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal ThroughputSettingsUpdateData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ThroughputSettingsResourceInfo resource, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -83,8 +81,5 @@ internal ThroughputSettingsUpdateData() /// The standard JSON format of a resource throughput. [WirePath("properties.resource")] public ThroughputSettingsResourceInfo Resource { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownDataTransferDataSourceSink.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownDataTransferDataSourceSink.cs deleted file mode 100644 index a8a2c1cc8e3a..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownDataTransferDataSourceSink.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Unknown version of DataTransferDataSourceSink. - internal partial class UnknownDataTransferDataSourceSink : DataTransferDataSourceSink - { - /// Initializes a new instance of . - /// - /// Keeps track of any properties unknown to the library. - internal UnknownDataTransferDataSourceSink(DataTransferComponent component, IDictionary serializedAdditionalRawData) : base(component, serializedAdditionalRawData) - { - Component = component; - } - - /// Initializes a new instance of for deserialization. - internal UnknownDataTransferDataSourceSink() - { - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionCollection.cs index ee997ce5ea4c..c446cd5d5ee8 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string c /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string collectionName, Ca /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancellation /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken canc /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string collectionName, Can /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string collectionName, CancellationToken ca /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExis /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionData.Serialization.cs index 9dd32c56d83c..cf0757e4ef1e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionData.Serialization.cs @@ -30,12 +30,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -120,7 +114,6 @@ internal static MongoDBCollectionData DeserializeMongoDBCollectionData(JsonEleme { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -133,16 +126,6 @@ internal static MongoDBCollectionData DeserializeMongoDBCollectionData(JsonEleme Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -231,7 +214,6 @@ internal static MongoDBCollectionData DeserializeMongoDBCollectionData(JsonEleme location, resource, options0, - identity, serializedAdditionalRawData); } @@ -318,21 +300,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionData.cs index 452d855493a9..58cfa7149b2b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionData.cs @@ -66,13 +66,11 @@ public MongoDBCollectionData(AzureLocation location) : base(location) /// The location. /// /// - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal MongoDBCollectionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedMongoDBCollectionResourceInfo resource, MongoDBCollectionPropertiesConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal MongoDBCollectionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedMongoDBCollectionResourceInfo resource, MongoDBCollectionPropertiesConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -87,8 +85,5 @@ internal MongoDBCollectionData() /// Gets or sets the options. [WirePath("properties.options")] public MongoDBCollectionPropertiesConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionResource.cs index ddb2971eeeb3..8fa2fec09395 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionResource.cs @@ -111,7 +111,7 @@ public virtual MongoDBCollectionThroughputSettingResource GetMongoDBCollectionTh /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -151,7 +151,7 @@ public virtual async Task> GetAsync(Cancella /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -191,7 +191,7 @@ public virtual Response Get(CancellationToken cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -233,7 +233,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -321,7 +321,7 @@ public virtual async Task> UpdateAsync(W /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -354,98 +354,6 @@ public virtual ArmOperation Update(WaitUntil waitUnti } } - /// - /// Merges the partitions of a MongoDB Collection - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/partitionMerge - /// - /// - /// Operation Id - /// MongoDBResources_ListMongoDBCollectionPartitionMerge - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters for the merge operation. - /// The cancellation token to use. - /// is null. - public virtual async Task> GetMongoDBCollectionPartitionMergeAsync(WaitUntil waitUntil, MergeParameters mergeParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - - using var scope = _mongoDBCollectionMongoDBResourcesClientDiagnostics.CreateScope("MongoDBCollectionResource.GetMongoDBCollectionPartitionMerge"); - scope.Start(); - try - { - var response = await _mongoDBCollectionMongoDBResourcesRestClient.ListMongoDBCollectionPartitionMergeAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, mergeParameters, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new PhysicalPartitionStorageInfoCollectionOperationSource(), _mongoDBCollectionMongoDBResourcesClientDiagnostics, Pipeline, _mongoDBCollectionMongoDBResourcesRestClient.CreateListMongoDBCollectionPartitionMergeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, mergeParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Merges the partitions of a MongoDB Collection - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/partitionMerge - /// - /// - /// Operation Id - /// MongoDBResources_ListMongoDBCollectionPartitionMerge - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters for the merge operation. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation GetMongoDBCollectionPartitionMerge(WaitUntil waitUntil, MergeParameters mergeParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - - using var scope = _mongoDBCollectionMongoDBResourcesClientDiagnostics.CreateScope("MongoDBCollectionResource.GetMongoDBCollectionPartitionMerge"); - scope.Start(); - try - { - var response = _mongoDBCollectionMongoDBResourcesRestClient.ListMongoDBCollectionPartitionMerge(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, mergeParameters, cancellationToken); - var operation = new CosmosDBArmOperation(new PhysicalPartitionStorageInfoCollectionOperationSource(), _mongoDBCollectionMongoDBResourcesClientDiagnostics, Pipeline, _mongoDBCollectionMongoDBResourcesRestClient.CreateListMongoDBCollectionPartitionMergeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, mergeParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - /// /// Retrieves continuous backup information for a Mongodb collection. /// @@ -459,7 +367,7 @@ public virtual ArmOperation GetMongoDBCo /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -505,7 +413,7 @@ public virtual async Task> RetrieveConti /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -551,7 +459,7 @@ public virtual ArmOperation RetrieveContinuousBackupI /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -613,7 +521,7 @@ public virtual async Task> AddTagAsync(strin /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -675,7 +583,7 @@ public virtual Response AddTag(string key, string val /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -732,7 +640,7 @@ public virtual async Task> SetTagsAsync(IDic /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -789,7 +697,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -849,7 +757,7 @@ public virtual async Task> RemoveTagAsync(st /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionThroughputSettingResource.cs index 8ef371b7d6fa..11c9863cea21 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionThroughputSettingResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(Cancella /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -230,7 +230,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -263,190 +263,6 @@ public virtual ArmOperation CreateOr } } - /// - /// Retrieve throughput distribution for an Azure Cosmos DB MongoDB container - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/retrieveThroughputDistribution - /// - /// - /// Operation Id - /// MongoDBResources_MongoDBContainerRetrieveThroughputDistribution - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for retrieving throughput distribution for the current MongoDB container. - /// The cancellation token to use. - /// is null. - public virtual async Task> MongoDBContainerRetrieveThroughputDistributionAsync(WaitUntil waitUntil, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var scope = _mongoDBCollectionThroughputSettingMongoDBResourcesClientDiagnostics.CreateScope("MongoDBCollectionThroughputSettingResource.MongoDBContainerRetrieveThroughputDistribution"); - scope.Start(); - try - { - var response = await _mongoDBCollectionThroughputSettingMongoDBResourcesRestClient.MongoDBContainerRetrieveThroughputDistributionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _mongoDBCollectionThroughputSettingMongoDBResourcesClientDiagnostics, Pipeline, _mongoDBCollectionThroughputSettingMongoDBResourcesRestClient.CreateMongoDBContainerRetrieveThroughputDistributionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieve throughput distribution for an Azure Cosmos DB MongoDB container - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/retrieveThroughputDistribution - /// - /// - /// Operation Id - /// MongoDBResources_MongoDBContainerRetrieveThroughputDistribution - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for retrieving throughput distribution for the current MongoDB container. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation MongoDBContainerRetrieveThroughputDistribution(WaitUntil waitUntil, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var scope = _mongoDBCollectionThroughputSettingMongoDBResourcesClientDiagnostics.CreateScope("MongoDBCollectionThroughputSettingResource.MongoDBContainerRetrieveThroughputDistribution"); - scope.Start(); - try - { - var response = _mongoDBCollectionThroughputSettingMongoDBResourcesRestClient.MongoDBContainerRetrieveThroughputDistribution(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters, cancellationToken); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _mongoDBCollectionThroughputSettingMongoDBResourcesClientDiagnostics, Pipeline, _mongoDBCollectionThroughputSettingMongoDBResourcesRestClient.CreateMongoDBContainerRetrieveThroughputDistributionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Redistribute throughput for an Azure Cosmos DB MongoDB container - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/redistributeThroughput - /// - /// - /// Operation Id - /// MongoDBResources_MongoDBContainerRedistributeThroughput - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for redistributing throughput for the current MongoDB container. - /// The cancellation token to use. - /// is null. - public virtual async Task> MongoDBContainerRedistributeThroughputAsync(WaitUntil waitUntil, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - - using var scope = _mongoDBCollectionThroughputSettingMongoDBResourcesClientDiagnostics.CreateScope("MongoDBCollectionThroughputSettingResource.MongoDBContainerRedistributeThroughput"); - scope.Start(); - try - { - var response = await _mongoDBCollectionThroughputSettingMongoDBResourcesRestClient.MongoDBContainerRedistributeThroughputAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _mongoDBCollectionThroughputSettingMongoDBResourcesClientDiagnostics, Pipeline, _mongoDBCollectionThroughputSettingMongoDBResourcesRestClient.CreateMongoDBContainerRedistributeThroughputRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Redistribute throughput for an Azure Cosmos DB MongoDB container - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/redistributeThroughput - /// - /// - /// Operation Id - /// MongoDBResources_MongoDBContainerRedistributeThroughput - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for redistributing throughput for the current MongoDB container. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation MongoDBContainerRedistributeThroughput(WaitUntil waitUntil, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - - using var scope = _mongoDBCollectionThroughputSettingMongoDBResourcesClientDiagnostics.CreateScope("MongoDBCollectionThroughputSettingResource.MongoDBContainerRedistributeThroughput"); - scope.Start(); - try - { - var response = _mongoDBCollectionThroughputSettingMongoDBResourcesRestClient.MongoDBContainerRedistributeThroughput(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters, cancellationToken); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _mongoDBCollectionThroughputSettingMongoDBResourcesClientDiagnostics, Pipeline, _mongoDBCollectionThroughputSettingMongoDBResourcesRestClient.CreateMongoDBContainerRedistributeThroughputRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - /// /// Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale /// @@ -460,7 +276,7 @@ public virtual ArmOperation MongoDBContai /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -502,7 +318,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -544,7 +360,7 @@ public virtual ArmOperation MigrateM /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -586,7 +402,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -628,7 +444,7 @@ public virtual ArmOperation MigrateM /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -690,7 +506,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -752,7 +568,7 @@ public virtual Response AddTag(strin /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -809,7 +625,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -866,7 +682,7 @@ public virtual Response SetTags(IDic /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -926,7 +742,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseCollection.cs index 7d7e3691b307..0354565fd03e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateA /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wa /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string dat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string databaseName, Cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(CancellationTo /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string databaseName, Cance /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string databaseName, CancellationToken canc /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExists /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseData.Serialization.cs index d18b18b64154..2f4459c8f3bd 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseData.Serialization.cs @@ -30,12 +30,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -120,7 +114,6 @@ internal static MongoDBDatabaseData DeserializeMongoDBDatabaseData(JsonElement e { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -133,16 +126,6 @@ internal static MongoDBDatabaseData DeserializeMongoDBDatabaseData(JsonElement e Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -231,7 +214,6 @@ internal static MongoDBDatabaseData DeserializeMongoDBDatabaseData(JsonElement e location, resource, options0, - identity, serializedAdditionalRawData); } @@ -318,21 +300,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseData.cs index 3963cf6b2ff2..fb4d46632fa2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseData.cs @@ -66,13 +66,11 @@ public MongoDBDatabaseData(AzureLocation location) : base(location) /// The location. /// /// - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal MongoDBDatabaseData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedMongoDBDatabaseResourceInfo resource, MongoDBDatabasePropertiesConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal MongoDBDatabaseData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedMongoDBDatabaseResourceInfo resource, MongoDBDatabasePropertiesConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -87,8 +85,5 @@ internal MongoDBDatabaseData() /// Gets or sets the options. [WirePath("properties.options")] public MongoDBDatabasePropertiesConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseResource.cs index dcc165b61c55..88f37ed9dd40 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseResource.cs @@ -117,7 +117,7 @@ public virtual MongoDBCollectionCollection GetMongoDBCollections() /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -148,7 +148,7 @@ public virtual async Task> GetMongoDBCollect /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -179,7 +179,7 @@ public virtual Response GetMongoDBCollection(string c /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -219,7 +219,7 @@ public virtual async Task> GetAsync(Cancellati /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -259,7 +259,7 @@ public virtual Response Get(CancellationToken cancellat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -301,7 +301,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -343,7 +343,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -389,7 +389,7 @@ public virtual async Task> UpdateAsync(Wai /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -422,98 +422,6 @@ public virtual ArmOperation Update(WaitUntil waitUntil, } } - /// - /// Merges the partitions of a MongoDB database - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/partitionMerge - /// - /// - /// Operation Id - /// MongoDBResources_MongoDBDatabasePartitionMerge - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters for the merge operation. - /// The cancellation token to use. - /// is null. - public virtual async Task> MongoDBDatabasePartitionMergeAsync(WaitUntil waitUntil, MergeParameters mergeParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - - using var scope = _mongoDBDatabaseMongoDBResourcesClientDiagnostics.CreateScope("MongoDBDatabaseResource.MongoDBDatabasePartitionMerge"); - scope.Start(); - try - { - var response = await _mongoDBDatabaseMongoDBResourcesRestClient.MongoDBDatabasePartitionMergeAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, mergeParameters, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new PhysicalPartitionStorageInfoCollectionOperationSource(), _mongoDBDatabaseMongoDBResourcesClientDiagnostics, Pipeline, _mongoDBDatabaseMongoDBResourcesRestClient.CreateMongoDBDatabasePartitionMergeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, mergeParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Merges the partitions of a MongoDB database - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/partitionMerge - /// - /// - /// Operation Id - /// MongoDBResources_MongoDBDatabasePartitionMerge - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters for the merge operation. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation MongoDBDatabasePartitionMerge(WaitUntil waitUntil, MergeParameters mergeParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - - using var scope = _mongoDBDatabaseMongoDBResourcesClientDiagnostics.CreateScope("MongoDBDatabaseResource.MongoDBDatabasePartitionMerge"); - scope.Start(); - try - { - var response = _mongoDBDatabaseMongoDBResourcesRestClient.MongoDBDatabasePartitionMerge(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, mergeParameters, cancellationToken); - var operation = new CosmosDBArmOperation(new PhysicalPartitionStorageInfoCollectionOperationSource(), _mongoDBDatabaseMongoDBResourcesClientDiagnostics, Pipeline, _mongoDBDatabaseMongoDBResourcesRestClient.CreateMongoDBDatabasePartitionMergeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, mergeParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - /// /// Add a tag to the current resource. /// @@ -527,7 +435,7 @@ public virtual ArmOperation MongoDBDatab /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -589,7 +497,7 @@ public virtual async Task> AddTagAsync(string /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -651,7 +559,7 @@ public virtual Response AddTag(string key, string value /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -708,7 +616,7 @@ public virtual async Task> SetTagsAsync(IDicti /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -765,7 +673,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -825,7 +733,7 @@ public virtual async Task> RemoveTagAsync(stri /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseThroughputSettingResource.cs index ddf6835e2fdf..22a2a647e4c4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseThroughputSettingResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(Cancellati /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -229,7 +229,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation CreateOrUp /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -317,7 +317,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation MigrateMon /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -401,7 +401,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -430,190 +430,6 @@ public virtual ArmOperation MigrateMon } } - /// - /// Retrieve throughput distribution for an Azure Cosmos DB MongoDB database - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution - /// - /// - /// Operation Id - /// MongoDBResources_MongoDBDatabaseRetrieveThroughputDistribution - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for retrieving throughput distribution for the current MongoDB database. - /// The cancellation token to use. - /// is null. - public virtual async Task> MongoDBDatabaseRetrieveThroughputDistributionAsync(WaitUntil waitUntil, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var scope = _mongoDBDatabaseThroughputSettingMongoDBResourcesClientDiagnostics.CreateScope("MongoDBDatabaseThroughputSettingResource.MongoDBDatabaseRetrieveThroughputDistribution"); - scope.Start(); - try - { - var response = await _mongoDBDatabaseThroughputSettingMongoDBResourcesRestClient.MongoDBDatabaseRetrieveThroughputDistributionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _mongoDBDatabaseThroughputSettingMongoDBResourcesClientDiagnostics, Pipeline, _mongoDBDatabaseThroughputSettingMongoDBResourcesRestClient.CreateMongoDBDatabaseRetrieveThroughputDistributionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieve throughput distribution for an Azure Cosmos DB MongoDB database - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution - /// - /// - /// Operation Id - /// MongoDBResources_MongoDBDatabaseRetrieveThroughputDistribution - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for retrieving throughput distribution for the current MongoDB database. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation MongoDBDatabaseRetrieveThroughputDistribution(WaitUntil waitUntil, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var scope = _mongoDBDatabaseThroughputSettingMongoDBResourcesClientDiagnostics.CreateScope("MongoDBDatabaseThroughputSettingResource.MongoDBDatabaseRetrieveThroughputDistribution"); - scope.Start(); - try - { - var response = _mongoDBDatabaseThroughputSettingMongoDBResourcesRestClient.MongoDBDatabaseRetrieveThroughputDistribution(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters, cancellationToken); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _mongoDBDatabaseThroughputSettingMongoDBResourcesClientDiagnostics, Pipeline, _mongoDBDatabaseThroughputSettingMongoDBResourcesRestClient.CreateMongoDBDatabaseRetrieveThroughputDistributionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Redistribute throughput for an Azure Cosmos DB MongoDB database - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/redistributeThroughput - /// - /// - /// Operation Id - /// MongoDBResources_MongoDBDatabaseRedistributeThroughput - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for redistributing throughput for the current MongoDB database. - /// The cancellation token to use. - /// is null. - public virtual async Task> MongoDBDatabaseRedistributeThroughputAsync(WaitUntil waitUntil, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - - using var scope = _mongoDBDatabaseThroughputSettingMongoDBResourcesClientDiagnostics.CreateScope("MongoDBDatabaseThroughputSettingResource.MongoDBDatabaseRedistributeThroughput"); - scope.Start(); - try - { - var response = await _mongoDBDatabaseThroughputSettingMongoDBResourcesRestClient.MongoDBDatabaseRedistributeThroughputAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _mongoDBDatabaseThroughputSettingMongoDBResourcesClientDiagnostics, Pipeline, _mongoDBDatabaseThroughputSettingMongoDBResourcesRestClient.CreateMongoDBDatabaseRedistributeThroughputRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Redistribute throughput for an Azure Cosmos DB MongoDB database - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/redistributeThroughput - /// - /// - /// Operation Id - /// MongoDBResources_MongoDBDatabaseRedistributeThroughput - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for redistributing throughput for the current MongoDB database. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation MongoDBDatabaseRedistributeThroughput(WaitUntil waitUntil, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - - using var scope = _mongoDBDatabaseThroughputSettingMongoDBResourcesClientDiagnostics.CreateScope("MongoDBDatabaseThroughputSettingResource.MongoDBDatabaseRedistributeThroughput"); - scope.Start(); - try - { - var response = _mongoDBDatabaseThroughputSettingMongoDBResourcesRestClient.MongoDBDatabaseRedistributeThroughput(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters, cancellationToken); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _mongoDBDatabaseThroughputSettingMongoDBResourcesClientDiagnostics, Pipeline, _mongoDBDatabaseThroughputSettingMongoDBResourcesRestClient.CreateMongoDBDatabaseRedistributeThroughputRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - /// /// Add a tag to the current resource. /// @@ -627,7 +443,7 @@ public virtual ArmOperation MongoDBDataba /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -689,7 +505,7 @@ public virtual async Task> Ad /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -751,7 +567,7 @@ public virtual Response AddTag(string /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -808,7 +624,7 @@ public virtual async Task> Se /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -865,7 +681,7 @@ public virtual Response SetTags(IDicti /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -925,7 +741,7 @@ public virtual async Task> Re /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBRoleDefinitionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBRoleDefinitionCollection.cs index bb07112b7d5a..7e9d68e0db18 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBRoleDefinitionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBRoleDefinitionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrU /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUn /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(stri /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string mongoRoleDefin /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancella /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string mongoRoleDefinition /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string mongoRoleDefinitionId, CancellationT /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIf /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBRoleDefinitionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBRoleDefinitionResource.cs index b4abdcf03341..0250af9614d3 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBRoleDefinitionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBRoleDefinitionResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(Canc /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken can /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> UpdateAsy /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBUserDefinitionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBUserDefinitionCollection.cs index a1c55ce0710f..f8f524f47297 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBUserDefinitionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBUserDefinitionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrU /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUn /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(stri /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string mongoUserDefin /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancella /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string mongoUserDefinition /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string mongoUserDefinitionId, CancellationT /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIf /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBUserDefinitionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBUserDefinitionResource.cs index 44a91c404b34..784e304541c3 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBUserDefinitionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBUserDefinitionResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(Canc /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken can /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> UpdateAsy /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs deleted file mode 100644 index 555f5dcfe433..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs +++ /dev/null @@ -1,395 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetNetworkSecurityPerimeterConfigurations method from an instance of . - /// - public partial class NetworkSecurityPerimeterConfigurationCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _networkSecurityPerimeterConfigurationClientDiagnostics; - private readonly NetworkSecurityPerimeterConfigurationsRestOperations _networkSecurityPerimeterConfigurationRestClient; - - /// Initializes a new instance of the class for mocking. - protected NetworkSecurityPerimeterConfigurationCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal NetworkSecurityPerimeterConfigurationCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _networkSecurityPerimeterConfigurationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", NetworkSecurityPerimeterConfigurationResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(NetworkSecurityPerimeterConfigurationResource.ResourceType, out string networkSecurityPerimeterConfigurationApiVersion); - _networkSecurityPerimeterConfigurationRestClient = new NetworkSecurityPerimeterConfigurationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, networkSecurityPerimeterConfigurationApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != CosmosDBAccountResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, CosmosDBAccountResource.ResourceType), nameof(id)); - } - - /// - /// Gets effective Network Security Perimeter Configuration for association - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name for Network Security Perimeter configuration. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(networkSecurityPerimeterConfigurationName, nameof(networkSecurityPerimeterConfigurationName)); - - using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationCollection.Get"); - scope.Start(); - try - { - var response = await _networkSecurityPerimeterConfigurationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, networkSecurityPerimeterConfigurationName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new NetworkSecurityPerimeterConfigurationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets effective Network Security Perimeter Configuration for association - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name for Network Security Perimeter configuration. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(networkSecurityPerimeterConfigurationName, nameof(networkSecurityPerimeterConfigurationName)); - - using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationCollection.Get"); - scope.Start(); - try - { - var response = _networkSecurityPerimeterConfigurationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, networkSecurityPerimeterConfigurationName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new NetworkSecurityPerimeterConfigurationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets list of effective Network Security Perimeter Configuration for cosmos db account - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_List - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _networkSecurityPerimeterConfigurationRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _networkSecurityPerimeterConfigurationRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkSecurityPerimeterConfigurationResource(Client, NetworkSecurityPerimeterConfigurationData.DeserializeNetworkSecurityPerimeterConfigurationData(e)), _networkSecurityPerimeterConfigurationClientDiagnostics, Pipeline, "NetworkSecurityPerimeterConfigurationCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Gets list of effective Network Security Perimeter Configuration for cosmos db account - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_List - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _networkSecurityPerimeterConfigurationRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _networkSecurityPerimeterConfigurationRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkSecurityPerimeterConfigurationResource(Client, NetworkSecurityPerimeterConfigurationData.DeserializeNetworkSecurityPerimeterConfigurationData(e)), _networkSecurityPerimeterConfigurationClientDiagnostics, Pipeline, "NetworkSecurityPerimeterConfigurationCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name for Network Security Perimeter configuration. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(networkSecurityPerimeterConfigurationName, nameof(networkSecurityPerimeterConfigurationName)); - - using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationCollection.Exists"); - scope.Start(); - try - { - var response = await _networkSecurityPerimeterConfigurationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, networkSecurityPerimeterConfigurationName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name for Network Security Perimeter configuration. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(networkSecurityPerimeterConfigurationName, nameof(networkSecurityPerimeterConfigurationName)); - - using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationCollection.Exists"); - scope.Start(); - try - { - var response = _networkSecurityPerimeterConfigurationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, networkSecurityPerimeterConfigurationName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name for Network Security Perimeter configuration. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(networkSecurityPerimeterConfigurationName, nameof(networkSecurityPerimeterConfigurationName)); - - using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _networkSecurityPerimeterConfigurationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, networkSecurityPerimeterConfigurationName, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new NetworkSecurityPerimeterConfigurationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name for Network Security Perimeter configuration. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(networkSecurityPerimeterConfigurationName, nameof(networkSecurityPerimeterConfigurationName)); - - using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationCollection.GetIfExists"); - scope.Start(); - try - { - var response = _networkSecurityPerimeterConfigurationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, networkSecurityPerimeterConfigurationName, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new NetworkSecurityPerimeterConfigurationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationData.Serialization.cs deleted file mode 100644 index 0505e42a6b88..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationData.Serialization.cs +++ /dev/null @@ -1,268 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class NetworkSecurityPerimeterConfigurationData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationData)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Properties)) - { - writer.WritePropertyName("properties"u8); - writer.WriteObjectValue(Properties, options); - } - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - NetworkSecurityPerimeterConfigurationData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNetworkSecurityPerimeterConfigurationData(document.RootElement, options); - } - - internal static NetworkSecurityPerimeterConfigurationData DeserializeNetworkSecurityPerimeterConfigurationData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - NetworkSecurityPerimeterConfigurationProperties properties = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - properties = NetworkSecurityPerimeterConfigurationProperties.DeserializeNetworkSecurityPerimeterConfigurationProperties(property.Value, options); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new NetworkSecurityPerimeterConfigurationData( - id, - name, - type, - systemData, - properties, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Properties), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" properties: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Properties)) - { - builder.Append(" properties: "); - BicepSerializationHelpers.AppendChildObject(builder, Properties, options, 2, false, " properties: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationData)} does not support writing '{options.Format}' format."); - } - } - - NetworkSecurityPerimeterConfigurationData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeNetworkSecurityPerimeterConfigurationData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationResource.Serialization.cs deleted file mode 100644 index cccb44eece95..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class NetworkSecurityPerimeterConfigurationResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - NetworkSecurityPerimeterConfigurationData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - NetworkSecurityPerimeterConfigurationData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs deleted file mode 100644 index cd74e30cd91c..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs +++ /dev/null @@ -1,255 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A Class representing a NetworkSecurityPerimeterConfiguration along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetNetworkSecurityPerimeterConfigurationResource method. - /// Otherwise you can get one from its parent resource using the GetNetworkSecurityPerimeterConfiguration method. - /// - public partial class NetworkSecurityPerimeterConfigurationResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The accountName. - /// The networkSecurityPerimeterConfigurationName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string networkSecurityPerimeterConfigurationName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _networkSecurityPerimeterConfigurationClientDiagnostics; - private readonly NetworkSecurityPerimeterConfigurationsRestOperations _networkSecurityPerimeterConfigurationRestClient; - private readonly NetworkSecurityPerimeterConfigurationData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.DocumentDB/databaseAccounts/networkSecurityPerimeterConfigurations"; - - /// Initializes a new instance of the class for mocking. - protected NetworkSecurityPerimeterConfigurationResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal NetworkSecurityPerimeterConfigurationResource(ArmClient client, NetworkSecurityPerimeterConfigurationData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal NetworkSecurityPerimeterConfigurationResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _networkSecurityPerimeterConfigurationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string networkSecurityPerimeterConfigurationApiVersion); - _networkSecurityPerimeterConfigurationRestClient = new NetworkSecurityPerimeterConfigurationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, networkSecurityPerimeterConfigurationApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual NetworkSecurityPerimeterConfigurationData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Gets effective Network Security Perimeter Configuration for association - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationResource.Get"); - scope.Start(); - try - { - var response = await _networkSecurityPerimeterConfigurationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new NetworkSecurityPerimeterConfigurationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets effective Network Security Perimeter Configuration for association - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationResource.Get"); - scope.Start(); - try - { - var response = _networkSecurityPerimeterConfigurationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new NetworkSecurityPerimeterConfigurationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Refreshes any information about the association. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}/reconcile - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_Reconcile - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task ReconcileAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationResource.Reconcile"); - scope.Start(); - try - { - var response = await _networkSecurityPerimeterConfigurationRestClient.ReconcileAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(_networkSecurityPerimeterConfigurationClientDiagnostics, Pipeline, _networkSecurityPerimeterConfigurationRestClient.CreateReconcileRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Refreshes any information about the association. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}/reconcile - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_Reconcile - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Reconcile(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationResource.Reconcile"); - scope.Start(); - try - { - var response = _networkSecurityPerimeterConfigurationRestClient.Reconcile(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new CosmosDBArmOperation(_networkSecurityPerimeterConfigurationClientDiagnostics, Pipeline, _networkSecurityPerimeterConfigurationRestClient.CreateReconcileRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraClustersRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraClustersRestOperations.cs index 37c9c1c9f375..7ab5f1aa16f4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraClustersRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraClustersRestOperations.cs @@ -32,7 +32,7 @@ public CassandraClustersRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-08-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -65,7 +65,7 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) } /// List all managed Cassandra clusters in this subscription. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -90,7 +90,7 @@ public async Task> ListBySubscriptionAsync( } /// List all managed Cassandra clusters in this subscription. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -147,7 +147,7 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str } /// List all managed Cassandra clusters in this resource group. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// or is null. @@ -174,7 +174,7 @@ public async Task> ListByResourceGroupAsync } /// List all managed Cassandra clusters in this resource group. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// or is null. @@ -235,7 +235,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get the properties of a managed Cassandra cluster. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// The cancellation token to use. @@ -266,7 +266,7 @@ public async Task> GetAsync(string subscriptionId } /// Get the properties of a managed Cassandra cluster. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// The cancellation token to use. @@ -331,7 +331,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Deletes a managed Cassandra cluster. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// The cancellation token to use. @@ -356,7 +356,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Deletes a managed Cassandra cluster. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// The cancellation token to use. @@ -419,7 +419,7 @@ internal HttpMessage CreateCreateUpdateRequest(string subscriptionId, string res } /// Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To update only some properties, use PATCH. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// The properties specifying the desired state of the managed Cassandra cluster. @@ -446,7 +446,7 @@ public async Task CreateUpdateAsync(string subscriptionId, string reso } /// Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To update only some properties, use PATCH. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// The properties specifying the desired state of the managed Cassandra cluster. @@ -511,7 +511,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } /// Updates some of the properties of a managed Cassandra cluster. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// Parameters to provide for specifying the managed Cassandra cluster. @@ -538,7 +538,7 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr } /// Updates some of the properties of a managed Cassandra cluster. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// Parameters to provide for specifying the managed Cassandra cluster. @@ -605,7 +605,7 @@ internal HttpMessage CreateInvokeCommandRequest(string subscriptionId, string re } /// Invoke a command like nodetool for cassandra maintenance. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// Specification which command to run where. @@ -631,7 +631,7 @@ public async Task InvokeCommandAsync(string subscriptionId, string res } /// Invoke a command like nodetool for cassandra maintenance. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// Specification which command to run where. @@ -656,395 +656,7 @@ public Response InvokeCommand(string subscriptionId, string resourceGroupName, s } } - internal RequestUriBuilder CreateListCommandRequestUri(string subscriptionId, string resourceGroupName, string clusterName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/cassandraClusters/", false); - uri.AppendPath(clusterName, true); - uri.AppendPath("/commands", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListCommandRequest(string subscriptionId, string resourceGroupName, string clusterName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/cassandraClusters/", false); - uri.AppendPath(clusterName, true); - uri.AppendPath("/commands", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List all commands currently running on ring info. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Managed Cassandra cluster name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListCommandAsync(string subscriptionId, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - - using var message = CreateListCommandRequest(subscriptionId, resourceGroupName, clusterName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ListCommands value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ListCommands.DeserializeListCommands(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List all commands currently running on ring info. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Managed Cassandra cluster name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListCommand(string subscriptionId, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - - using var message = CreateListCommandRequest(subscriptionId, resourceGroupName, clusterName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ListCommands value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ListCommands.DeserializeListCommands(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetCommandAsyncRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string commandId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/cassandraClusters/", false); - uri.AppendPath(clusterName, true); - uri.AppendPath("/commands/", false); - uri.AppendPath(commandId, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetCommandAsyncRequest(string subscriptionId, string resourceGroupName, string clusterName, string commandId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/cassandraClusters/", false); - uri.AppendPath(clusterName, true); - uri.AppendPath("/commands/", false); - uri.AppendPath(commandId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get details about a specified command that was run asynchronously. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Managed Cassandra cluster name. - /// Managed Cassandra cluster command id. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetCommandAsyncAsync(string subscriptionId, string resourceGroupName, string clusterName, string commandId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - Argument.AssertNotNullOrEmpty(commandId, nameof(commandId)); - - using var message = CreateGetCommandAsyncRequest(subscriptionId, resourceGroupName, clusterName, commandId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ListCommands value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ListCommands.DeserializeListCommands(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get details about a specified command that was run asynchronously. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Managed Cassandra cluster name. - /// Managed Cassandra cluster command id. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response GetCommandAsync(string subscriptionId, string resourceGroupName, string clusterName, string commandId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - Argument.AssertNotNullOrEmpty(commandId, nameof(commandId)); - - using var message = CreateGetCommandAsyncRequest(subscriptionId, resourceGroupName, clusterName, commandId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ListCommands value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ListCommands.DeserializeListCommands(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListBackupsRequestUri(string subscriptionId, string resourceGroupName, string clusterName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/cassandraClusters/", false); - uri.AppendPath(clusterName, true); - uri.AppendPath("/backups", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListBackupsRequest(string subscriptionId, string resourceGroupName, string clusterName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/cassandraClusters/", false); - uri.AppendPath(clusterName, true); - uri.AppendPath("/backups", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List the backups of this cluster that are available to restore. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Managed Cassandra cluster name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListBackupsAsync(string subscriptionId, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - - using var message = CreateListBackupsRequest(subscriptionId, resourceGroupName, clusterName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ListBackups value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = Models.ListBackups.DeserializeListBackups(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List the backups of this cluster that are available to restore. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Managed Cassandra cluster name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListBackups(string subscriptionId, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - - using var message = CreateListBackupsRequest(subscriptionId, resourceGroupName, clusterName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ListBackups value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = Models.ListBackups.DeserializeListBackups(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetBackupRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string backupId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/cassandraClusters/", false); - uri.AppendPath(clusterName, true); - uri.AppendPath("/backups/", false); - uri.AppendPath(backupId, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetBackupRequest(string subscriptionId, string resourceGroupName, string clusterName, string backupId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/cassandraClusters/", false); - uri.AppendPath(clusterName, true); - uri.AppendPath("/backups/", false); - uri.AppendPath(backupId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get the properties of an individual backup of this cluster that is available to restore. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Managed Cassandra cluster name. - /// Id of a restorable backup of a Cassandra cluster. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetBackupAsync(string subscriptionId, string resourceGroupName, string clusterName, string backupId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - Argument.AssertNotNullOrEmpty(backupId, nameof(backupId)); - - using var message = CreateGetBackupRequest(subscriptionId, resourceGroupName, clusterName, backupId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CassandraClusterBackupResourceInfo value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CassandraClusterBackupResourceInfo.DeserializeCassandraClusterBackupResourceInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get the properties of an individual backup of this cluster that is available to restore. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Managed Cassandra cluster name. - /// Id of a restorable backup of a Cassandra cluster. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response GetBackup(string subscriptionId, string resourceGroupName, string clusterName, string backupId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - Argument.AssertNotNullOrEmpty(backupId, nameof(backupId)); - - using var message = CreateGetBackupRequest(subscriptionId, resourceGroupName, clusterName, backupId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CassandraClusterBackupResourceInfo value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CassandraClusterBackupResourceInfo.DeserializeCassandraClusterBackupResourceInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDeallocateRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string xMsForceDeallocate) + internal RequestUriBuilder CreateDeallocateRequestUri(string subscriptionId, string resourceGroupName, string clusterName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1059,7 +671,7 @@ internal RequestUriBuilder CreateDeallocateRequestUri(string subscriptionId, str return uri; } - internal HttpMessage CreateDeallocateRequest(string subscriptionId, string resourceGroupName, string clusterName, string xMsForceDeallocate) + internal HttpMessage CreateDeallocateRequest(string subscriptionId, string resourceGroupName, string clusterName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1075,30 +687,25 @@ internal HttpMessage CreateDeallocateRequest(string subscriptionId, string resou uri.AppendPath("/deallocate", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; - if (xMsForceDeallocate != null) - { - request.Headers.Add("x-ms-force-deallocate", xMsForceDeallocate); - } request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; } /// Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated cluster. Use Start to restart the cluster. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. - /// Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of Cluster Type Production might cause data loss. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task DeallocateAsync(string subscriptionId, string resourceGroupName, string clusterName, string xMsForceDeallocate = null, CancellationToken cancellationToken = default) + public async Task DeallocateAsync(string subscriptionId, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - using var message = CreateDeallocateRequest(subscriptionId, resourceGroupName, clusterName, xMsForceDeallocate); + using var message = CreateDeallocateRequest(subscriptionId, resourceGroupName, clusterName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -1110,20 +717,19 @@ public async Task DeallocateAsync(string subscriptionId, string resour } /// Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated cluster. Use Start to restart the cluster. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. - /// Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of Cluster Type Production might cause data loss. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Deallocate(string subscriptionId, string resourceGroupName, string clusterName, string xMsForceDeallocate = null, CancellationToken cancellationToken = default) + public Response Deallocate(string subscriptionId, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - using var message = CreateDeallocateRequest(subscriptionId, resourceGroupName, clusterName, xMsForceDeallocate); + using var message = CreateDeallocateRequest(subscriptionId, resourceGroupName, clusterName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -1171,7 +777,7 @@ internal HttpMessage CreateStartRequest(string subscriptionId, string resourceGr } /// Start the Managed Cassandra Cluster and Associated Data Centers. Start will start the host virtual machine of this cluster with reserved data disk. This won't do anything on an already running cluster. Use Deallocate to deallocate the cluster. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// The cancellation token to use. @@ -1195,7 +801,7 @@ public async Task StartAsync(string subscriptionId, string resourceGro } /// Start the Managed Cassandra Cluster and Associated Data Centers. Start will start the host virtual machine of this cluster with reserved data disk. This won't do anything on an already running cluster. Use Deallocate to deallocate the cluster. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// The cancellation token to use. @@ -1255,7 +861,7 @@ internal HttpMessage CreateStatusRequest(string subscriptionId, string resourceG } /// Gets the CPU, memory, and disk usage statistics for each Cassandra node in a cluster. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// The cancellation token to use. @@ -1284,7 +890,7 @@ public async Task> StatusAsync(string sub } /// Gets the CPU, memory, and disk usage statistics for each Cassandra node in a cluster. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// The cancellation token to use. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraDataCentersRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraDataCentersRestOperations.cs index e114b44fe1d2..c4b3174b49bf 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraDataCentersRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraDataCentersRestOperations.cs @@ -32,7 +32,7 @@ public CassandraDataCentersRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-08-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// List all data centers in a particular managed Cassandra cluster. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> ListAsync(string subs } /// List all data centers in a particular managed Cassandra cluster. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// The cancellation token to use. @@ -169,7 +169,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get the properties of a managed Cassandra data center. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// Data center name in a managed Cassandra cluster. @@ -202,7 +202,7 @@ public async Task> GetAsync(string subscriptio } /// Get the properties of a managed Cassandra data center. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// Data center name in a managed Cassandra cluster. @@ -273,7 +273,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Delete a managed Cassandra data center. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// Data center name in a managed Cassandra cluster. @@ -300,7 +300,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Delete a managed Cassandra data center. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// Data center name in a managed Cassandra cluster. @@ -369,7 +369,7 @@ internal HttpMessage CreateCreateUpdateRequest(string subscriptionId, string res } /// Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some properties, use PATCH. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// Data center name in a managed Cassandra cluster. @@ -398,7 +398,7 @@ public async Task CreateUpdateAsync(string subscriptionId, string reso } /// Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some properties, use PATCH. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// Data center name in a managed Cassandra cluster. @@ -469,7 +469,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } /// Update some of the properties of a managed Cassandra data center. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// Data center name in a managed Cassandra cluster. @@ -498,7 +498,7 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr } /// Update some of the properties of a managed Cassandra data center. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// Data center name in a managed Cassandra cluster. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraResourcesRestOperations.cs index f86f4c50afc7..57a2579460c5 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraResourcesRestOperations.cs @@ -32,7 +32,7 @@ public CassandraResourcesRestOperations(HttpPipeline pipeline, string applicatio { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-08-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListCassandraKeyspacesRequest(string subscriptionId, } /// Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> ListCassandraKeyspacesA } /// Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -169,7 +169,7 @@ internal HttpMessage CreateGetCassandraKeyspaceRequest(string subscriptionId, st } /// Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -202,7 +202,7 @@ public async Task> GetCassandraKeyspaceAsync(str } /// Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -277,7 +277,7 @@ internal HttpMessage CreateCreateUpdateCassandraKeyspaceRequest(string subscript } /// Create or update an Azure Cosmos DB Cassandra keyspace. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -306,7 +306,7 @@ public async Task CreateUpdateCassandraKeyspaceAsync(string subscripti } /// Create or update an Azure Cosmos DB Cassandra keyspace. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -372,7 +372,7 @@ internal HttpMessage CreateDeleteCassandraKeyspaceRequest(string subscriptionId, } /// Deletes an existing Azure Cosmos DB Cassandra keyspace. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -399,7 +399,7 @@ public async Task DeleteCassandraKeyspaceAsync(string subscriptionId, } /// Deletes an existing Azure Cosmos DB Cassandra keyspace. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -466,7 +466,7 @@ internal HttpMessage CreateGetCassandraKeyspaceThroughputRequest(string subscrip } /// Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -499,7 +499,7 @@ public async Task> GetCassandraKeyspaceThroughpu } /// Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -576,7 +576,7 @@ internal HttpMessage CreateUpdateCassandraKeyspaceThroughputRequest(string subsc } /// Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -605,7 +605,7 @@ public async Task UpdateCassandraKeyspaceThroughputAsync(string subscr } /// Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -674,7 +674,7 @@ internal HttpMessage CreateMigrateCassandraKeyspaceToAutoscaleRequest(string sub } /// Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -701,7 +701,7 @@ public async Task MigrateCassandraKeyspaceToAutoscaleAsync(string subs } /// Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -768,7 +768,7 @@ internal HttpMessage CreateMigrateCassandraKeyspaceToManualThroughputRequest(str } /// Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -795,7 +795,7 @@ public async Task MigrateCassandraKeyspaceToManualThroughputAsync(stri } /// Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -862,7 +862,7 @@ internal HttpMessage CreateListCassandraTablesRequest(string subscriptionId, str } /// Lists the Cassandra table under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -893,7 +893,7 @@ public async Task> ListCassandraTablesAsync(s } /// Lists the Cassandra table under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -966,7 +966,7 @@ internal HttpMessage CreateGetCassandraTableRequest(string subscriptionId, strin } /// Gets the Cassandra table under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1001,7 +1001,7 @@ public async Task> GetCassandraTableAsync(string su } /// Gets the Cassandra table under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1082,7 +1082,7 @@ internal HttpMessage CreateCreateUpdateCassandraTableRequest(string subscription } /// Create or update an Azure Cosmos DB Cassandra Table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1113,7 +1113,7 @@ public async Task CreateUpdateCassandraTableAsync(string subscriptionI } /// Create or update an Azure Cosmos DB Cassandra Table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1185,7 +1185,7 @@ internal HttpMessage CreateDeleteCassandraTableRequest(string subscriptionId, st } /// Deletes an existing Azure Cosmos DB Cassandra table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1214,7 +1214,7 @@ public async Task DeleteCassandraTableAsync(string subscriptionId, str } /// Deletes an existing Azure Cosmos DB Cassandra table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1287,7 +1287,7 @@ internal HttpMessage CreateGetCassandraTableThroughputRequest(string subscriptio } /// Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1322,7 +1322,7 @@ public async Task> GetCassandraTableThroughputAs } /// Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1405,7 +1405,7 @@ internal HttpMessage CreateUpdateCassandraTableThroughputRequest(string subscrip } /// Update RUs per second of an Azure Cosmos DB Cassandra table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1436,7 +1436,7 @@ public async Task UpdateCassandraTableThroughputAsync(string subscript } /// Update RUs per second of an Azure Cosmos DB Cassandra table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1511,7 +1511,7 @@ internal HttpMessage CreateMigrateCassandraTableToAutoscaleRequest(string subscr } /// Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1540,7 +1540,7 @@ public async Task MigrateCassandraTableToAutoscaleAsync(string subscri } /// Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1613,7 +1613,7 @@ internal HttpMessage CreateMigrateCassandraTableToManualThroughputRequest(string } /// Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1642,7 +1642,7 @@ public async Task MigrateCassandraTableToManualThroughputAsync(string } /// Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1669,856 +1669,5 @@ public Response MigrateCassandraTableToManualThroughput(string subscriptionId, s throw new RequestFailedException(message.Response); } } - - internal RequestUriBuilder CreateListCassandraViewsRequestUri(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/cassandraKeyspaces/", false); - uri.AppendPath(keyspaceName, true); - uri.AppendPath("/views", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListCassandraViewsRequest(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/cassandraKeyspaces/", false); - uri.AppendPath(keyspaceName, true); - uri.AppendPath("/views", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists the Cassandra materialized views under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB keyspace name. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListCassandraViewsAsync(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - - using var message = CreateListCassandraViewsRequest(subscriptionId, resourceGroupName, accountName, keyspaceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CassandraViewListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CassandraViewListResult.DeserializeCassandraViewListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists the Cassandra materialized views under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB keyspace name. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response ListCassandraViews(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - - using var message = CreateListCassandraViewsRequest(subscriptionId, resourceGroupName, accountName, keyspaceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CassandraViewListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CassandraViewListResult.DeserializeCassandraViewListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetCassandraViewRequestUri(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/cassandraKeyspaces/", false); - uri.AppendPath(keyspaceName, true); - uri.AppendPath("/views/", false); - uri.AppendPath(viewName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetCassandraViewRequest(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/cassandraKeyspaces/", false); - uri.AppendPath(keyspaceName, true); - uri.AppendPath("/views/", false); - uri.AppendPath(viewName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets the Cassandra view under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB keyspace name. - /// Cosmos DB view name. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task> GetCassandraViewAsync(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var message = CreateGetCassandraViewRequest(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CassandraViewGetResultData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CassandraViewGetResultData.DeserializeCassandraViewGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((CassandraViewGetResultData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the Cassandra view under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB keyspace name. - /// Cosmos DB view name. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response GetCassandraView(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var message = CreateGetCassandraViewRequest(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CassandraViewGetResultData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CassandraViewGetResultData.DeserializeCassandraViewGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((CassandraViewGetResultData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCreateUpdateCassandraViewRequestUri(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CassandraViewGetResultCreateOrUpdateContent content) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/cassandraKeyspaces/", false); - uri.AppendPath(keyspaceName, true); - uri.AppendPath("/views/", false); - uri.AppendPath(viewName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCreateUpdateCassandraViewRequest(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CassandraViewGetResultCreateOrUpdateContent content) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/cassandraKeyspaces/", false); - uri.AppendPath(keyspaceName, true); - uri.AppendPath("/views/", false); - uri.AppendPath(viewName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; - _userAgent.Apply(message); - return message; - } - - /// Create or update an Azure Cosmos DB Cassandra View. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB keyspace name. - /// Cosmos DB view name. - /// The parameters to provide for the current Cassandra View. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task CreateUpdateCassandraViewAsync(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CassandraViewGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCreateUpdateCassandraViewRequest(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Create or update an Azure Cosmos DB Cassandra View. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB keyspace name. - /// Cosmos DB view name. - /// The parameters to provide for the current Cassandra View. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response CreateUpdateCassandraView(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CassandraViewGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCreateUpdateCassandraViewRequest(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDeleteCassandraViewRequestUri(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/cassandraKeyspaces/", false); - uri.AppendPath(keyspaceName, true); - uri.AppendPath("/views/", false); - uri.AppendPath(viewName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateDeleteCassandraViewRequest(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/cassandraKeyspaces/", false); - uri.AppendPath(keyspaceName, true); - uri.AppendPath("/views/", false); - uri.AppendPath(viewName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - _userAgent.Apply(message); - return message; - } - - /// Deletes an existing Azure Cosmos DB Cassandra view. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB keyspace name. - /// Cosmos DB view name. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task DeleteCassandraViewAsync(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var message = CreateDeleteCassandraViewRequest(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Deletes an existing Azure Cosmos DB Cassandra view. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB keyspace name. - /// Cosmos DB view name. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response DeleteCassandraView(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var message = CreateDeleteCassandraViewRequest(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetCassandraViewThroughputRequestUri(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/cassandraKeyspaces/", false); - uri.AppendPath(keyspaceName, true); - uri.AppendPath("/views/", false); - uri.AppendPath(viewName, true); - uri.AppendPath("/throughputSettings/default", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetCassandraViewThroughputRequest(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/cassandraKeyspaces/", false); - uri.AppendPath(keyspaceName, true); - uri.AppendPath("/views/", false); - uri.AppendPath(viewName, true); - uri.AppendPath("/throughputSettings/default", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB keyspace name. - /// Cosmos DB view name. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task> GetCassandraViewThroughputAsync(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var message = CreateGetCassandraViewThroughputRequest(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ThroughputSettingData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ThroughputSettingData.DeserializeThroughputSettingData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ThroughputSettingData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB keyspace name. - /// Cosmos DB view name. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response GetCassandraViewThroughput(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var message = CreateGetCassandraViewThroughputRequest(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ThroughputSettingData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ThroughputSettingData.DeserializeThroughputSettingData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ThroughputSettingData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateUpdateCassandraViewThroughputRequestUri(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, ThroughputSettingsUpdateData data) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/cassandraKeyspaces/", false); - uri.AppendPath(keyspaceName, true); - uri.AppendPath("/views/", false); - uri.AppendPath(viewName, true); - uri.AppendPath("/throughputSettings/default", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateUpdateCassandraViewThroughputRequest(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, ThroughputSettingsUpdateData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/cassandraKeyspaces/", false); - uri.AppendPath(keyspaceName, true); - uri.AppendPath("/views/", false); - uri.AppendPath(viewName, true); - uri.AppendPath("/throughputSettings/default", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Update RUs per second of an Azure Cosmos DB Cassandra view. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB keyspace name. - /// Cosmos DB view name. - /// The RUs per second of the parameters to provide for the current Cassandra view. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task UpdateCassandraViewThroughputAsync(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, ThroughputSettingsUpdateData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateUpdateCassandraViewThroughputRequest(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Update RUs per second of an Azure Cosmos DB Cassandra view. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB keyspace name. - /// Cosmos DB view name. - /// The RUs per second of the parameters to provide for the current Cassandra view. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response UpdateCassandraViewThroughput(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, ThroughputSettingsUpdateData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateUpdateCassandraViewThroughputRequest(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateMigrateCassandraViewToAutoscaleRequestUri(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/cassandraKeyspaces/", false); - uri.AppendPath(keyspaceName, true); - uri.AppendPath("/views/", false); - uri.AppendPath(viewName, true); - uri.AppendPath("/throughputSettings/default/migrateToAutoscale", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateMigrateCassandraViewToAutoscaleRequest(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/cassandraKeyspaces/", false); - uri.AppendPath(keyspaceName, true); - uri.AppendPath("/views/", false); - uri.AppendPath(viewName, true); - uri.AppendPath("/throughputSettings/default/migrateToAutoscale", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB keyspace name. - /// Cosmos DB view name. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task MigrateCassandraViewToAutoscaleAsync(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var message = CreateMigrateCassandraViewToAutoscaleRequest(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB keyspace name. - /// Cosmos DB view name. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response MigrateCassandraViewToAutoscale(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var message = CreateMigrateCassandraViewToAutoscaleRequest(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateMigrateCassandraViewToManualThroughputRequestUri(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/cassandraKeyspaces/", false); - uri.AppendPath(keyspaceName, true); - uri.AppendPath("/views/", false); - uri.AppendPath(viewName, true); - uri.AppendPath("/throughputSettings/default/migrateToManualThroughput", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateMigrateCassandraViewToManualThroughputRequest(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/cassandraKeyspaces/", false); - uri.AppendPath(keyspaceName, true); - uri.AppendPath("/views/", false); - uri.AppendPath(viewName, true); - uri.AppendPath("/throughputSettings/default/migrateToManualThroughput", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB keyspace name. - /// Cosmos DB view name. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task MigrateCassandraViewToManualThroughputAsync(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var message = CreateMigrateCassandraViewToManualThroughputRequest(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB keyspace name. - /// Cosmos DB view name. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response MigrateCassandraViewToManualThroughput(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var message = CreateMigrateCassandraViewToManualThroughputRequest(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionPartitionRegionRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionPartitionRegionRestOperations.cs index 43bbb97dd5b6..ddae9fd15a80 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionPartitionRegionRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionPartitionRegionRestOperations.cs @@ -32,7 +32,7 @@ public CollectionPartitionRegionRestOperations(HttpPipeline pipeline, string app { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-08-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -87,7 +87,7 @@ internal HttpMessage CreateListMetricsRequest(string subscriptionId, string reso } /// Retrieves the metrics determined by the given filter for the given collection and region, split by partition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB region, with spaces between words and each word capitalized. @@ -124,7 +124,7 @@ public async Task> ListMetricsAsync(string s } /// Retrieves the metrics determined by the given filter for the given collection and region, split by partition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB region, with spaces between words and each word capitalized. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionPartitionRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionPartitionRestOperations.cs index 83fb5bb662b6..a54b197d305f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionPartitionRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionPartitionRestOperations.cs @@ -32,7 +32,7 @@ public CollectionPartitionRestOperations(HttpPipeline pipeline, string applicati { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-08-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -83,7 +83,7 @@ internal HttpMessage CreateListMetricsRequest(string subscriptionId, string reso } /// Retrieves the metrics determined by the given filter for the given collection, split by partition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -118,7 +118,7 @@ public async Task> ListMetricsAsync(string s } /// Retrieves the metrics determined by the given filter for the given collection, split by partition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -205,7 +205,7 @@ internal HttpMessage CreateListUsagesRequest(string subscriptionId, string resou } /// Retrieves the usages (most recent storage data) for the given collection, split by partition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -239,7 +239,7 @@ public async Task> ListUsagesAsync(string subscr } /// Retrieves the usages (most recent storage data) for the given collection, split by partition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionRegionRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionRegionRestOperations.cs index 2ce913c43c8c..12a4df5ff964 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionRegionRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionRegionRestOperations.cs @@ -32,7 +32,7 @@ public CollectionRegionRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-08-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -87,7 +87,7 @@ internal HttpMessage CreateListMetricsRequest(string subscriptionId, string reso } /// Retrieves the metrics determined by the given filter for the given database account, collection and region. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB region, with spaces between words and each word capitalized. @@ -124,7 +124,7 @@ public async Task> ListMetricsAsync(string su } /// Retrieves the metrics determined by the given filter for the given database account, collection and region. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB region, with spaces between words and each word capitalized. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionRestOperations.cs index 4c5b28b60cd1..c31a6a5d43bb 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionRestOperations.cs @@ -32,7 +32,7 @@ public CollectionRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-08-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -83,7 +83,7 @@ internal HttpMessage CreateListMetricsRequest(string subscriptionId, string reso } /// Retrieves the metrics determined by the given filter for the given database account and collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -118,7 +118,7 @@ public async Task> ListMetricsAsync(string su } /// Retrieves the metrics determined by the given filter for the given database account and collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -205,7 +205,7 @@ internal HttpMessage CreateListUsagesRequest(string subscriptionId, string resou } /// Retrieves the usages (most recent storage data) for the given collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -239,7 +239,7 @@ public async Task> ListUsagesAsync(string subscri } /// Retrieves the usages (most recent storage data) for the given collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -317,7 +317,7 @@ internal HttpMessage CreateListMetricDefinitionsRequest(string subscriptionId, s } /// Retrieves metric definitions for the given collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -350,7 +350,7 @@ public async Task> ListMetricDefin } /// Retrieves metric definitions for the given collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DataTransferJobsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DataTransferJobsRestOperations.cs deleted file mode 100644 index 23d2c6492585..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DataTransferJobsRestOperations.cs +++ /dev/null @@ -1,837 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - internal partial class DataTransferJobsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of DataTransferJobsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public DataTransferJobsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string accountName, string jobName, DataTransferJobGetResultCreateOrUpdateContent content) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/dataTransferJobs/", false); - uri.AppendPath(jobName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string accountName, string jobName, DataTransferJobGetResultCreateOrUpdateContent content) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/dataTransferJobs/", false); - uri.AppendPath(jobName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; - _userAgent.Apply(message); - return message; - } - - /// Creates a Data Transfer Job. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Name of the Data Transfer Job. - /// The to use. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> CreateAsync(string subscriptionId, string resourceGroupName, string accountName, string jobName, DataTransferJobGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, accountName, jobName, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobGetResultData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Creates a Data Transfer Job. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Name of the Data Transfer Job. - /// The to use. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string accountName, string jobName, DataTransferJobGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, accountName, jobName, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobGetResultData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string accountName, string jobName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/dataTransferJobs/", false); - uri.AppendPath(jobName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string accountName, string jobName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/dataTransferJobs/", false); - uri.AppendPath(jobName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get a Data Transfer Job. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string accountName, string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, accountName, jobName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobGetResultData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((DataTransferJobGetResultData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get a Data Transfer Job. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string accountName, string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, accountName, jobName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobGetResultData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((DataTransferJobGetResultData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreatePauseRequestUri(string subscriptionId, string resourceGroupName, string accountName, string jobName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/dataTransferJobs/", false); - uri.AppendPath(jobName, true); - uri.AppendPath("/pause", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreatePauseRequest(string subscriptionId, string resourceGroupName, string accountName, string jobName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/dataTransferJobs/", false); - uri.AppendPath(jobName, true); - uri.AppendPath("/pause", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Pause a Data Transfer Job. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> PauseAsync(string subscriptionId, string resourceGroupName, string accountName, string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var message = CreatePauseRequest(subscriptionId, resourceGroupName, accountName, jobName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobGetResultData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Pause a Data Transfer Job. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Pause(string subscriptionId, string resourceGroupName, string accountName, string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var message = CreatePauseRequest(subscriptionId, resourceGroupName, accountName, jobName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobGetResultData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateResumeRequestUri(string subscriptionId, string resourceGroupName, string accountName, string jobName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/dataTransferJobs/", false); - uri.AppendPath(jobName, true); - uri.AppendPath("/resume", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateResumeRequest(string subscriptionId, string resourceGroupName, string accountName, string jobName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/dataTransferJobs/", false); - uri.AppendPath(jobName, true); - uri.AppendPath("/resume", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Resumes a Data Transfer Job. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> ResumeAsync(string subscriptionId, string resourceGroupName, string accountName, string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var message = CreateResumeRequest(subscriptionId, resourceGroupName, accountName, jobName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobGetResultData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Resumes a Data Transfer Job. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Resume(string subscriptionId, string resourceGroupName, string accountName, string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var message = CreateResumeRequest(subscriptionId, resourceGroupName, accountName, jobName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobGetResultData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCancelRequestUri(string subscriptionId, string resourceGroupName, string accountName, string jobName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/dataTransferJobs/", false); - uri.AppendPath(jobName, true); - uri.AppendPath("/cancel", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCancelRequest(string subscriptionId, string resourceGroupName, string accountName, string jobName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/dataTransferJobs/", false); - uri.AppendPath(jobName, true); - uri.AppendPath("/cancel", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Cancels a Data Transfer Job. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> CancelAsync(string subscriptionId, string resourceGroupName, string accountName, string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var message = CreateCancelRequest(subscriptionId, resourceGroupName, accountName, jobName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobGetResultData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Cancels a Data Transfer Job. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Cancel(string subscriptionId, string resourceGroupName, string accountName, string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var message = CreateCancelRequest(subscriptionId, resourceGroupName, accountName, jobName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobGetResultData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCompleteRequestUri(string subscriptionId, string resourceGroupName, string accountName, string jobName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/dataTransferJobs/", false); - uri.AppendPath(jobName, true); - uri.AppendPath("/complete", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCompleteRequest(string subscriptionId, string resourceGroupName, string accountName, string jobName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/dataTransferJobs/", false); - uri.AppendPath(jobName, true); - uri.AppendPath("/complete", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Completes a Data Transfer Online Job. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> CompleteAsync(string subscriptionId, string resourceGroupName, string accountName, string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var message = CreateCompleteRequest(subscriptionId, resourceGroupName, accountName, jobName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobGetResultData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Completes a Data Transfer Online Job. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Complete(string subscriptionId, string resourceGroupName, string accountName, string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var message = CreateCompleteRequest(subscriptionId, resourceGroupName, accountName, jobName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobGetResultData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListByDatabaseAccountRequestUri(string subscriptionId, string resourceGroupName, string accountName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/dataTransferJobs", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListByDatabaseAccountRequest(string subscriptionId, string resourceGroupName, string accountName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/dataTransferJobs", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get a list of Data Transfer jobs. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByDatabaseAccountAsync(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateListByDatabaseAccountRequest(subscriptionId, resourceGroupName, accountName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobFeedResults value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DataTransferJobFeedResults.DeserializeDataTransferJobFeedResults(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get a list of Data Transfer jobs. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByDatabaseAccount(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateListByDatabaseAccountRequest(subscriptionId, resourceGroupName, accountName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobFeedResults value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DataTransferJobFeedResults.DeserializeDataTransferJobFeedResults(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListByDatabaseAccountNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string accountName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListByDatabaseAccountNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string accountName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get a list of Data Transfer jobs. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByDatabaseAccountNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateListByDatabaseAccountNextPageRequest(nextLink, subscriptionId, resourceGroupName, accountName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobFeedResults value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DataTransferJobFeedResults.DeserializeDataTransferJobFeedResults(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get a list of Data Transfer jobs. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByDatabaseAccountNextPage(string nextLink, string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateListByDatabaseAccountNextPageRequest(nextLink, subscriptionId, resourceGroupName, accountName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobFeedResults value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DataTransferJobFeedResults.DeserializeDataTransferJobFeedResults(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseAccountRegionRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseAccountRegionRestOperations.cs index 0f7889b8f2ab..6ecf271447a3 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseAccountRegionRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseAccountRegionRestOperations.cs @@ -32,7 +32,7 @@ public DatabaseAccountRegionRestOperations(HttpPipeline pipeline, string applica { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-08-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -79,7 +79,7 @@ internal HttpMessage CreateListMetricsRequest(string subscriptionId, string reso } /// Retrieves the metrics determined by the given filter for the given database account and region. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB region, with spaces between words and each word capitalized. @@ -112,7 +112,7 @@ public async Task> ListMetricsAsync(string su } /// Retrieves the metrics determined by the given filter for the given database account and region. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB region, with spaces between words and each word capitalized. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseAccountsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseAccountsRestOperations.cs index 95689de3d1f5..19827abd4d7d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseAccountsRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseAccountsRestOperations.cs @@ -32,7 +32,7 @@ public DatabaseAccountsRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-08-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -71,7 +71,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Retrieves the properties of an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> GetAsync(string subscriptionId, } /// Retrieves the properties of an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -171,7 +171,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } /// Updates the properties of an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The parameters to provide for the current database account. @@ -197,7 +197,7 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr } /// Updates the properties of an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The parameters to provide for the current database account. @@ -261,7 +261,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The parameters to provide for the current database account. @@ -287,7 +287,7 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } /// Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The parameters to provide for the current database account. @@ -346,7 +346,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Deletes an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -371,7 +371,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Deletes an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -435,7 +435,7 @@ internal HttpMessage CreateFailoverPriorityChangeRequest(string subscriptionId, } /// Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The new failover policies for the database account. @@ -462,7 +462,7 @@ public async Task FailoverPriorityChangeAsync(string subscriptionId, s } /// Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The new failover policies for the database account. @@ -517,7 +517,7 @@ internal HttpMessage CreateListRequest(string subscriptionId) } /// Lists all the Azure Cosmos DB database accounts available under the subscription. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -542,7 +542,7 @@ public async Task> ListAsync(string subscri } /// Lists all the Azure Cosmos DB database accounts available under the subscription. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -599,7 +599,7 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str } /// Lists all the Azure Cosmos DB database accounts available under the given resource group. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// or is null. @@ -626,7 +626,7 @@ public async Task> ListByResourceGroupAsync } /// Lists all the Azure Cosmos DB database accounts available under the given resource group. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// or is null. @@ -689,7 +689,7 @@ internal HttpMessage CreateListKeysRequest(string subscriptionId, string resourc } /// Lists the access keys for the specified Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -718,7 +718,7 @@ public async Task> ListKeysAsync(string subscri } /// Lists the access keys for the specified Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -783,7 +783,7 @@ internal HttpMessage CreateListConnectionStringsRequest(string subscriptionId, s } /// Lists the connection strings for the specified Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -812,7 +812,7 @@ public async Task> ListConn } /// Lists the connection strings for the specified Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -881,7 +881,7 @@ internal HttpMessage CreateOfflineRegionRequest(string subscriptionId, string re } /// Offline the specified region for the specified Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB region to offline for the database account. @@ -908,7 +908,7 @@ public async Task OfflineRegionAsync(string subscriptionId, string res } /// Offline the specified region for the specified Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB region to offline for the database account. @@ -975,7 +975,7 @@ internal HttpMessage CreateOnlineRegionRequest(string subscriptionId, string res } /// Online the specified region for the specified Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB region to online for the database account. @@ -1002,7 +1002,7 @@ public async Task OnlineRegionAsync(string subscriptionId, string reso } /// Online the specified region for the specified Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB region to online for the database account. @@ -1065,7 +1065,7 @@ internal HttpMessage CreateListReadOnlyKeysRequest(string subscriptionId, string } /// Lists the read-only access keys for the specified Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -1094,7 +1094,7 @@ public async Task> ListReadOnlyKeysAsyn } /// Lists the read-only access keys for the specified Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -1162,7 +1162,7 @@ internal HttpMessage CreateRegenerateKeyRequest(string subscriptionId, string re } /// Regenerates an access key for the specified Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The name of the key to regenerate. @@ -1189,7 +1189,7 @@ public async Task RegenerateKeyAsync(string subscriptionId, string res } /// Regenerates an access key for the specified Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The name of the key to regenerate. @@ -1335,7 +1335,7 @@ internal HttpMessage CreateListMetricsRequest(string subscriptionId, string reso } /// Retrieves the metrics determined by the given filter for the given database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. @@ -1366,7 +1366,7 @@ public async Task> ListMetricsAsync(string su } /// Retrieves the metrics determined by the given filter for the given database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. @@ -1441,7 +1441,7 @@ internal HttpMessage CreateListUsagesRequest(string subscriptionId, string resou } /// Retrieves the usages (most recent data) for the given database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). @@ -1471,7 +1471,7 @@ public async Task> ListUsagesAsync(string subscri } /// Retrieves the usages (most recent data) for the given database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). @@ -1537,7 +1537,7 @@ internal HttpMessage CreateListMetricDefinitionsRequest(string subscriptionId, s } /// Retrieves metric definitions for the given database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -1566,7 +1566,7 @@ public async Task> ListMetricDefin } /// Retrieves metric definitions for the given database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseRestOperations.cs index 1fbf628f825b..80d11c2e3939 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseRestOperations.cs @@ -32,7 +32,7 @@ public DatabaseRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-08-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -79,7 +79,7 @@ internal HttpMessage CreateListMetricsRequest(string subscriptionId, string reso } /// Retrieves the metrics determined by the given filter for the given database account and database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -112,7 +112,7 @@ public async Task> ListMetricsAsync(string su } /// Retrieves the metrics determined by the given filter for the given database account and database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -193,7 +193,7 @@ internal HttpMessage CreateListUsagesRequest(string subscriptionId, string resou } /// Retrieves the usages (most recent data) for the given database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -225,7 +225,7 @@ public async Task> ListUsagesAsync(string subscri } /// Retrieves the usages (most recent data) for the given database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -297,7 +297,7 @@ internal HttpMessage CreateListMetricDefinitionsRequest(string subscriptionId, s } /// Retrieves metric definitions for the given database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -328,7 +328,7 @@ public async Task> ListMetricDefin } /// Retrieves metric definitions for the given database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/GraphResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/GraphResourcesRestOperations.cs deleted file mode 100644 index 3c4e3daee46f..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/GraphResourcesRestOperations.cs +++ /dev/null @@ -1,430 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - internal partial class GraphResourcesRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of GraphResourcesRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public GraphResourcesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateListGraphsRequestUri(string subscriptionId, string resourceGroupName, string accountName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/graphs", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListGraphsRequest(string subscriptionId, string resourceGroupName, string accountName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/graphs", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists the graphs under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListGraphsAsync(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateListGraphsRequest(subscriptionId, resourceGroupName, accountName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - GraphResourcesListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = GraphResourcesListResult.DeserializeGraphResourcesListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists the graphs under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListGraphs(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateListGraphsRequest(subscriptionId, resourceGroupName, accountName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - GraphResourcesListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = GraphResourcesListResult.DeserializeGraphResourcesListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetGraphRequestUri(string subscriptionId, string resourceGroupName, string accountName, string graphName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/graphs/", false); - uri.AppendPath(graphName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetGraphRequest(string subscriptionId, string resourceGroupName, string accountName, string graphName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/graphs/", false); - uri.AppendPath(graphName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB graph resource name. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetGraphAsync(string subscriptionId, string resourceGroupName, string accountName, string graphName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - - using var message = CreateGetGraphRequest(subscriptionId, resourceGroupName, accountName, graphName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - GraphResourceGetResultData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = GraphResourceGetResultData.DeserializeGraphResourceGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((GraphResourceGetResultData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB graph resource name. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response GetGraph(string subscriptionId, string resourceGroupName, string accountName, string graphName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - - using var message = CreateGetGraphRequest(subscriptionId, resourceGroupName, accountName, graphName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - GraphResourceGetResultData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = GraphResourceGetResultData.DeserializeGraphResourceGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((GraphResourceGetResultData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCreateUpdateGraphRequestUri(string subscriptionId, string resourceGroupName, string accountName, string graphName, GraphResourceGetResultCreateOrUpdateContent content) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/graphs/", false); - uri.AppendPath(graphName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCreateUpdateGraphRequest(string subscriptionId, string resourceGroupName, string accountName, string graphName, GraphResourceGetResultCreateOrUpdateContent content) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/graphs/", false); - uri.AppendPath(graphName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; - _userAgent.Apply(message); - return message; - } - - /// Create or update an Azure Cosmos DB Graph. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB graph resource name. - /// The parameters to provide for the current graph. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateUpdateGraphAsync(string subscriptionId, string resourceGroupName, string accountName, string graphName, GraphResourceGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCreateUpdateGraphRequest(subscriptionId, resourceGroupName, accountName, graphName, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Create or update an Azure Cosmos DB Graph. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB graph resource name. - /// The parameters to provide for the current graph. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response CreateUpdateGraph(string subscriptionId, string resourceGroupName, string accountName, string graphName, GraphResourceGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCreateUpdateGraphRequest(subscriptionId, resourceGroupName, accountName, graphName, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDeleteGraphResourceRequestUri(string subscriptionId, string resourceGroupName, string accountName, string graphName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/graphs/", false); - uri.AppendPath(graphName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateDeleteGraphResourceRequest(string subscriptionId, string resourceGroupName, string accountName, string graphName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/graphs/", false); - uri.AppendPath(graphName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - _userAgent.Apply(message); - return message; - } - - /// Deletes an existing Azure Cosmos DB Graph Resource. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB graph resource name. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteGraphResourceAsync(string subscriptionId, string resourceGroupName, string accountName, string graphName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - - using var message = CreateDeleteGraphResourceRequest(subscriptionId, resourceGroupName, accountName, graphName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Deletes an existing Azure Cosmos DB Graph Resource. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB graph resource name. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response DeleteGraphResource(string subscriptionId, string resourceGroupName, string accountName, string graphName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - - using var message = CreateDeleteGraphResourceRequest(subscriptionId, resourceGroupName, accountName, graphName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/GremlinResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/GremlinResourcesRestOperations.cs index f7d826a0d2f1..870f8da85d2c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/GremlinResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/GremlinResourcesRestOperations.cs @@ -32,7 +32,7 @@ public GremlinResourcesRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-08-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListGremlinDatabasesRequest(string subscriptionId, st } /// Lists the Gremlin databases under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> ListGremlinDatabasesAsync } /// Lists the Gremlin databases under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -169,7 +169,7 @@ internal HttpMessage CreateGetGremlinDatabaseRequest(string subscriptionId, stri } /// Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -202,7 +202,7 @@ public async Task> GetGremlinDatabaseAsync(string } /// Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -277,7 +277,7 @@ internal HttpMessage CreateCreateUpdateGremlinDatabaseRequest(string subscriptio } /// Create or update an Azure Cosmos DB Gremlin database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -306,7 +306,7 @@ public async Task CreateUpdateGremlinDatabaseAsync(string subscription } /// Create or update an Azure Cosmos DB Gremlin database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -372,7 +372,7 @@ internal HttpMessage CreateDeleteGremlinDatabaseRequest(string subscriptionId, s } /// Deletes an existing Azure Cosmos DB Gremlin database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -399,7 +399,7 @@ public async Task DeleteGremlinDatabaseAsync(string subscriptionId, st } /// Deletes an existing Azure Cosmos DB Gremlin database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -466,7 +466,7 @@ internal HttpMessage CreateGetGremlinDatabaseThroughputRequest(string subscripti } /// Gets the RUs per second of the Gremlin database under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -499,7 +499,7 @@ public async Task> GetGremlinDatabaseThroughputA } /// Gets the RUs per second of the Gremlin database under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -576,7 +576,7 @@ internal HttpMessage CreateUpdateGremlinDatabaseThroughputRequest(string subscri } /// Update RUs per second of an Azure Cosmos DB Gremlin database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -605,7 +605,7 @@ public async Task UpdateGremlinDatabaseThroughputAsync(string subscrip } /// Update RUs per second of an Azure Cosmos DB Gremlin database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -674,7 +674,7 @@ internal HttpMessage CreateMigrateGremlinDatabaseToAutoscaleRequest(string subsc } /// Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -701,7 +701,7 @@ public async Task MigrateGremlinDatabaseToAutoscaleAsync(string subscr } /// Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -768,7 +768,7 @@ internal HttpMessage CreateMigrateGremlinDatabaseToManualThroughputRequest(strin } /// Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -795,7 +795,7 @@ public async Task MigrateGremlinDatabaseToManualThroughputAsync(string } /// Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -862,7 +862,7 @@ internal HttpMessage CreateListGremlinGraphsRequest(string subscriptionId, strin } /// Lists the Gremlin graph under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -893,7 +893,7 @@ public async Task> ListGremlinGraphsAsync(strin } /// Lists the Gremlin graph under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -966,7 +966,7 @@ internal HttpMessage CreateGetGremlinGraphRequest(string subscriptionId, string } /// Gets the Gremlin graph under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1001,7 +1001,7 @@ public async Task> GetGremlinGraphAsync(string subscr } /// Gets the Gremlin graph under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1082,7 +1082,7 @@ internal HttpMessage CreateCreateUpdateGremlinGraphRequest(string subscriptionId } /// Create or update an Azure Cosmos DB Gremlin graph. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1113,7 +1113,7 @@ public async Task CreateUpdateGremlinGraphAsync(string subscriptionId, } /// Create or update an Azure Cosmos DB Gremlin graph. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1185,7 +1185,7 @@ internal HttpMessage CreateDeleteGremlinGraphRequest(string subscriptionId, stri } /// Deletes an existing Azure Cosmos DB Gremlin graph. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1214,7 +1214,7 @@ public async Task DeleteGremlinGraphAsync(string subscriptionId, strin } /// Deletes an existing Azure Cosmos DB Gremlin graph. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1287,7 +1287,7 @@ internal HttpMessage CreateGetGremlinGraphThroughputRequest(string subscriptionI } /// Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1322,7 +1322,7 @@ public async Task> GetGremlinGraphThroughputAsyn } /// Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1405,7 +1405,7 @@ internal HttpMessage CreateUpdateGremlinGraphThroughputRequest(string subscripti } /// Update RUs per second of an Azure Cosmos DB Gremlin graph. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1436,7 +1436,7 @@ public async Task UpdateGremlinGraphThroughputAsync(string subscriptio } /// Update RUs per second of an Azure Cosmos DB Gremlin graph. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1511,7 +1511,7 @@ internal HttpMessage CreateMigrateGremlinGraphToAutoscaleRequest(string subscrip } /// Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1540,7 +1540,7 @@ public async Task MigrateGremlinGraphToAutoscaleAsync(string subscript } /// Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1613,7 +1613,7 @@ internal HttpMessage CreateMigrateGremlinGraphToManualThroughputRequest(string s } /// Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1642,7 +1642,7 @@ public async Task MigrateGremlinGraphToManualThroughputAsync(string su } /// Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1719,7 +1719,7 @@ internal HttpMessage CreateRetrieveContinuousBackupInformationRequest(string sub } /// Retrieves continuous backup information for a gremlin graph. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1750,7 +1750,7 @@ public async Task RetrieveContinuousBackupInformationAsync(string subs } /// Retrieves continuous backup information for a gremlin graph. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/LocationsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/LocationsRestOperations.cs index ea7f7af84c3f..edf8fab568ba 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/LocationsRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/LocationsRestOperations.cs @@ -32,7 +32,7 @@ public LocationsRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-08-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -65,7 +65,7 @@ internal HttpMessage CreateListRequest(string subscriptionId) } /// List Cosmos DB locations and their properties. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -90,7 +90,7 @@ public async Task> ListAsync(string subscri } /// List Cosmos DB locations and their properties. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -145,7 +145,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, AzureLocation locat } /// Get the properties of an existing Cosmos DB location. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The cancellation token to use. /// is null. @@ -173,7 +173,7 @@ public async Task> GetAsync(string subscriptionId } /// Get the properties of an existing Cosmos DB location. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The cancellation token to use. /// is null. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/MongoDBResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/MongoDBResourcesRestOperations.cs index 18b5efa6de60..60e0742764c5 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/MongoDBResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/MongoDBResourcesRestOperations.cs @@ -32,7 +32,7 @@ public MongoDBResourcesRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-08-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListMongoDBDatabasesRequest(string subscriptionId, st } /// Lists the MongoDB databases under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> ListMongoDBDatabasesAsync } /// Lists the MongoDB databases under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -169,7 +169,7 @@ internal HttpMessage CreateGetMongoDBDatabaseRequest(string subscriptionId, stri } /// Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -202,7 +202,7 @@ public async Task> GetMongoDBDatabaseAsync(string } /// Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -277,7 +277,7 @@ internal HttpMessage CreateCreateUpdateMongoDBDatabaseRequest(string subscriptio } /// Create or updates Azure Cosmos DB MongoDB database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -306,7 +306,7 @@ public async Task CreateUpdateMongoDBDatabaseAsync(string subscription } /// Create or updates Azure Cosmos DB MongoDB database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -372,7 +372,7 @@ internal HttpMessage CreateDeleteMongoDBDatabaseRequest(string subscriptionId, s } /// Deletes an existing Azure Cosmos DB MongoDB database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -399,7 +399,7 @@ public async Task DeleteMongoDBDatabaseAsync(string subscriptionId, st } /// Deletes an existing Azure Cosmos DB MongoDB database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -466,7 +466,7 @@ internal HttpMessage CreateGetMongoDBDatabaseThroughputRequest(string subscripti } /// Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -499,7 +499,7 @@ public async Task> GetMongoDBDatabaseThroughputA } /// Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -576,7 +576,7 @@ internal HttpMessage CreateUpdateMongoDBDatabaseThroughputRequest(string subscri } /// Update RUs per second of the an Azure Cosmos DB MongoDB database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -605,7 +605,7 @@ public async Task UpdateMongoDBDatabaseThroughputAsync(string subscrip } /// Update RUs per second of the an Azure Cosmos DB MongoDB database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -674,7 +674,7 @@ internal HttpMessage CreateMigrateMongoDBDatabaseToAutoscaleRequest(string subsc } /// Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -701,7 +701,7 @@ public async Task MigrateMongoDBDatabaseToAutoscaleAsync(string subscr } /// Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -768,7 +768,7 @@ internal HttpMessage CreateMigrateMongoDBDatabaseToManualThroughputRequest(strin } /// Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -795,7 +795,7 @@ public async Task MigrateMongoDBDatabaseToManualThroughputAsync(string } /// Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -821,430 +821,6 @@ public Response MigrateMongoDBDatabaseToManualThroughput(string subscriptionId, } } - internal RequestUriBuilder CreateMongoDBDatabaseRetrieveThroughputDistributionRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RetrieveThroughputParameters retrieveThroughputParameters) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/mongodbDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/throughputSettings/default/retrieveThroughputDistribution", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateMongoDBDatabaseRetrieveThroughputDistributionRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RetrieveThroughputParameters retrieveThroughputParameters) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/mongodbDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/throughputSettings/default/retrieveThroughputDistribution", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(retrieveThroughputParameters, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Retrieve throughput distribution for an Azure Cosmos DB MongoDB database. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// The parameters to provide for retrieving throughput distribution for the current MongoDB database. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task MongoDBDatabaseRetrieveThroughputDistributionAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var message = CreateMongoDBDatabaseRetrieveThroughputDistributionRequest(subscriptionId, resourceGroupName, accountName, databaseName, retrieveThroughputParameters); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Retrieve throughput distribution for an Azure Cosmos DB MongoDB database. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// The parameters to provide for retrieving throughput distribution for the current MongoDB database. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response MongoDBDatabaseRetrieveThroughputDistribution(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var message = CreateMongoDBDatabaseRetrieveThroughputDistributionRequest(subscriptionId, resourceGroupName, accountName, databaseName, retrieveThroughputParameters); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateMongoDBDatabaseRedistributeThroughputRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RedistributeThroughputParameters redistributeThroughputParameters) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/mongodbDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/throughputSettings/default/redistributeThroughput", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateMongoDBDatabaseRedistributeThroughputRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RedistributeThroughputParameters redistributeThroughputParameters) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/mongodbDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/throughputSettings/default/redistributeThroughput", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(redistributeThroughputParameters, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Redistribute throughput for an Azure Cosmos DB MongoDB database. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// The parameters to provide for redistributing throughput for the current MongoDB database. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task MongoDBDatabaseRedistributeThroughputAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - - using var message = CreateMongoDBDatabaseRedistributeThroughputRequest(subscriptionId, resourceGroupName, accountName, databaseName, redistributeThroughputParameters); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Redistribute throughput for an Azure Cosmos DB MongoDB database. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// The parameters to provide for redistributing throughput for the current MongoDB database. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response MongoDBDatabaseRedistributeThroughput(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - - using var message = CreateMongoDBDatabaseRedistributeThroughputRequest(subscriptionId, resourceGroupName, accountName, databaseName, redistributeThroughputParameters); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateMongoDBContainerRetrieveThroughputDistributionRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string collectionName, RetrieveThroughputParameters retrieveThroughputParameters) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/mongodbDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/collections/", false); - uri.AppendPath(collectionName, true); - uri.AppendPath("/throughputSettings/default/retrieveThroughputDistribution", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateMongoDBContainerRetrieveThroughputDistributionRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string collectionName, RetrieveThroughputParameters retrieveThroughputParameters) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/mongodbDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/collections/", false); - uri.AppendPath(collectionName, true); - uri.AppendPath("/throughputSettings/default/retrieveThroughputDistribution", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(retrieveThroughputParameters, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Retrieve throughput distribution for an Azure Cosmos DB MongoDB container. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB collection name. - /// The parameters to provide for retrieving throughput distribution for the current MongoDB container. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task MongoDBContainerRetrieveThroughputDistributionAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string collectionName, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(collectionName, nameof(collectionName)); - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var message = CreateMongoDBContainerRetrieveThroughputDistributionRequest(subscriptionId, resourceGroupName, accountName, databaseName, collectionName, retrieveThroughputParameters); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Retrieve throughput distribution for an Azure Cosmos DB MongoDB container. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB collection name. - /// The parameters to provide for retrieving throughput distribution for the current MongoDB container. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response MongoDBContainerRetrieveThroughputDistribution(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string collectionName, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(collectionName, nameof(collectionName)); - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var message = CreateMongoDBContainerRetrieveThroughputDistributionRequest(subscriptionId, resourceGroupName, accountName, databaseName, collectionName, retrieveThroughputParameters); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateMongoDBContainerRedistributeThroughputRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string collectionName, RedistributeThroughputParameters redistributeThroughputParameters) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/mongodbDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/collections/", false); - uri.AppendPath(collectionName, true); - uri.AppendPath("/throughputSettings/default/redistributeThroughput", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateMongoDBContainerRedistributeThroughputRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string collectionName, RedistributeThroughputParameters redistributeThroughputParameters) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/mongodbDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/collections/", false); - uri.AppendPath(collectionName, true); - uri.AppendPath("/throughputSettings/default/redistributeThroughput", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(redistributeThroughputParameters, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Redistribute throughput for an Azure Cosmos DB MongoDB container. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB collection name. - /// The parameters to provide for redistributing throughput for the current MongoDB container. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task MongoDBContainerRedistributeThroughputAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string collectionName, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(collectionName, nameof(collectionName)); - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - - using var message = CreateMongoDBContainerRedistributeThroughputRequest(subscriptionId, resourceGroupName, accountName, databaseName, collectionName, redistributeThroughputParameters); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Redistribute throughput for an Azure Cosmos DB MongoDB container. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB collection name. - /// The parameters to provide for redistributing throughput for the current MongoDB container. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response MongoDBContainerRedistributeThroughput(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string collectionName, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(collectionName, nameof(collectionName)); - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - - using var message = CreateMongoDBContainerRedistributeThroughputRequest(subscriptionId, resourceGroupName, accountName, databaseName, collectionName, redistributeThroughputParameters); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - internal RequestUriBuilder CreateListMongoDBCollectionsRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName) { var uri = new RawRequestUriBuilder(); @@ -1286,7 +862,7 @@ internal HttpMessage CreateListMongoDBCollectionsRequest(string subscriptionId, } /// Lists the MongoDB collection under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1317,7 +893,7 @@ public async Task> ListMongoDBCollectionsA } /// Lists the MongoDB collection under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1390,7 +966,7 @@ internal HttpMessage CreateGetMongoDBCollectionRequest(string subscriptionId, st } /// Gets the MongoDB collection under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1425,7 +1001,7 @@ public async Task> GetMongoDBCollectionAsync(str } /// Gets the MongoDB collection under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1506,7 +1082,7 @@ internal HttpMessage CreateCreateUpdateMongoDBCollectionRequest(string subscript } /// Create or update an Azure Cosmos DB MongoDB Collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1537,7 +1113,7 @@ public async Task CreateUpdateMongoDBCollectionAsync(string subscripti } /// Create or update an Azure Cosmos DB MongoDB Collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1609,7 +1185,7 @@ internal HttpMessage CreateDeleteMongoDBCollectionRequest(string subscriptionId, } /// Deletes an existing Azure Cosmos DB MongoDB Collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1638,7 +1214,7 @@ public async Task DeleteMongoDBCollectionAsync(string subscriptionId, } /// Deletes an existing Azure Cosmos DB MongoDB Collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1666,218 +1242,6 @@ public Response DeleteMongoDBCollection(string subscriptionId, string resourceGr } } - internal RequestUriBuilder CreateMongoDBDatabasePartitionMergeRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, MergeParameters mergeParameters) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/mongodbDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/partitionMerge", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateMongoDBDatabasePartitionMergeRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, MergeParameters mergeParameters) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/mongodbDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/partitionMerge", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(mergeParameters, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Merges the partitions of a MongoDB database. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// The parameters for the merge operation. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task MongoDBDatabasePartitionMergeAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, MergeParameters mergeParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - - using var message = CreateMongoDBDatabasePartitionMergeRequest(subscriptionId, resourceGroupName, accountName, databaseName, mergeParameters); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Merges the partitions of a MongoDB database. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// The parameters for the merge operation. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response MongoDBDatabasePartitionMerge(string subscriptionId, string resourceGroupName, string accountName, string databaseName, MergeParameters mergeParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - - using var message = CreateMongoDBDatabasePartitionMergeRequest(subscriptionId, resourceGroupName, accountName, databaseName, mergeParameters); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListMongoDBCollectionPartitionMergeRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string collectionName, MergeParameters mergeParameters) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/mongodbDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/collections/", false); - uri.AppendPath(collectionName, true); - uri.AppendPath("/partitionMerge", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListMongoDBCollectionPartitionMergeRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string collectionName, MergeParameters mergeParameters) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/mongodbDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/collections/", false); - uri.AppendPath(collectionName, true); - uri.AppendPath("/partitionMerge", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(mergeParameters, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Merges the partitions of a MongoDB Collection. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB collection name. - /// The parameters for the merge operation. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task ListMongoDBCollectionPartitionMergeAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string collectionName, MergeParameters mergeParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(collectionName, nameof(collectionName)); - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - - using var message = CreateListMongoDBCollectionPartitionMergeRequest(subscriptionId, resourceGroupName, accountName, databaseName, collectionName, mergeParameters); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Merges the partitions of a MongoDB Collection. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB collection name. - /// The parameters for the merge operation. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response ListMongoDBCollectionPartitionMerge(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string collectionName, MergeParameters mergeParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(collectionName, nameof(collectionName)); - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - - using var message = CreateListMongoDBCollectionPartitionMergeRequest(subscriptionId, resourceGroupName, accountName, databaseName, collectionName, mergeParameters); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - internal RequestUriBuilder CreateGetMongoDBCollectionThroughputRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string collectionName) { var uri = new RawRequestUriBuilder(); @@ -1923,7 +1287,7 @@ internal HttpMessage CreateGetMongoDBCollectionThroughputRequest(string subscrip } /// Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1958,7 +1322,7 @@ public async Task> GetMongoDBCollectionThroughpu } /// Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2041,7 +1405,7 @@ internal HttpMessage CreateUpdateMongoDBCollectionThroughputRequest(string subsc } /// Update the RUs per second of an Azure Cosmos DB MongoDB collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2072,7 +1436,7 @@ public async Task UpdateMongoDBCollectionThroughputAsync(string subscr } /// Update the RUs per second of an Azure Cosmos DB MongoDB collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2147,7 +1511,7 @@ internal HttpMessage CreateMigrateMongoDBCollectionToAutoscaleRequest(string sub } /// Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2176,7 +1540,7 @@ public async Task MigrateMongoDBCollectionToAutoscaleAsync(string subs } /// Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2249,7 +1613,7 @@ internal HttpMessage CreateMigrateMongoDBCollectionToManualThroughputRequest(str } /// Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2278,7 +1642,7 @@ public async Task MigrateMongoDBCollectionToManualThroughputAsync(stri } /// Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2345,7 +1709,7 @@ internal HttpMessage CreateGetMongoRoleDefinitionRequest(string subscriptionId, } /// Retrieves the properties of an existing Azure Cosmos DB Mongo Role Definition with the given Id. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The ID for the Role Definition {dbName.roleName}. @@ -2378,7 +1742,7 @@ public async Task> GetMongoRoleDefinitionAsy } /// Retrieves the properties of an existing Azure Cosmos DB Mongo Role Definition with the given Id. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The ID for the Role Definition {dbName.roleName}. @@ -2453,7 +1817,7 @@ internal HttpMessage CreateCreateUpdateMongoRoleDefinitionRequest(string subscri } /// Creates or updates an Azure Cosmos DB Mongo Role Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The ID for the Role Definition {dbName.roleName}. @@ -2482,7 +1846,7 @@ public async Task CreateUpdateMongoRoleDefinitionAsync(string subscrip } /// Creates or updates an Azure Cosmos DB Mongo Role Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The ID for the Role Definition {dbName.roleName}. @@ -2549,7 +1913,7 @@ internal HttpMessage CreateDeleteMongoRoleDefinitionRequest(string subscriptionI } /// Deletes an existing Azure Cosmos DB Mongo Role Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The ID for the Role Definition {dbName.roleName}. @@ -2577,7 +1941,7 @@ public async Task DeleteMongoRoleDefinitionAsync(string subscriptionId } /// Deletes an existing Azure Cosmos DB Mongo Role Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The ID for the Role Definition {dbName.roleName}. @@ -2641,7 +2005,7 @@ internal HttpMessage CreateListMongoRoleDefinitionsRequest(string subscriptionId } /// Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -2670,7 +2034,7 @@ public async Task> ListMongoRoleDefini } /// Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -2737,7 +2101,7 @@ internal HttpMessage CreateGetMongoUserDefinitionRequest(string subscriptionId, } /// Retrieves the properties of an existing Azure Cosmos DB Mongo User Definition with the given Id. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The ID for the User Definition {dbName.userName}. @@ -2770,7 +2134,7 @@ public async Task> GetMongoUserDefinitionAsy } /// Retrieves the properties of an existing Azure Cosmos DB Mongo User Definition with the given Id. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The ID for the User Definition {dbName.userName}. @@ -2845,7 +2209,7 @@ internal HttpMessage CreateCreateUpdateMongoUserDefinitionRequest(string subscri } /// Creates or updates an Azure Cosmos DB Mongo User Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The ID for the User Definition {dbName.userName}. @@ -2874,7 +2238,7 @@ public async Task CreateUpdateMongoUserDefinitionAsync(string subscrip } /// Creates or updates an Azure Cosmos DB Mongo User Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The ID for the User Definition {dbName.userName}. @@ -2941,7 +2305,7 @@ internal HttpMessage CreateDeleteMongoUserDefinitionRequest(string subscriptionI } /// Deletes an existing Azure Cosmos DB Mongo User Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The ID for the User Definition {dbName.userName}. @@ -2969,7 +2333,7 @@ public async Task DeleteMongoUserDefinitionAsync(string subscriptionId } /// Deletes an existing Azure Cosmos DB Mongo User Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The ID for the User Definition {dbName.userName}. @@ -3033,7 +2397,7 @@ internal HttpMessage CreateListMongoUserDefinitionsRequest(string subscriptionId } /// Retrieves the list of all Azure Cosmos DB Mongo User Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -3062,7 +2426,7 @@ public async Task> ListMongoUserDefini } /// Retrieves the list of all Azure Cosmos DB Mongo User Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -3139,7 +2503,7 @@ internal HttpMessage CreateRetrieveContinuousBackupInformationRequest(string sub } /// Retrieves continuous backup information for a Mongodb collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3170,7 +2534,7 @@ public async Task RetrieveContinuousBackupInformationAsync(string subs } /// Retrieves continuous backup information for a Mongodb collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationsRestOperations.cs deleted file mode 100644 index 75eafcfdbb73..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationsRestOperations.cs +++ /dev/null @@ -1,413 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - internal partial class NetworkSecurityPerimeterConfigurationsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of NetworkSecurityPerimeterConfigurationsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public NetworkSecurityPerimeterConfigurationsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string accountName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/networkSecurityPerimeterConfigurations", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string accountName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/networkSecurityPerimeterConfigurations", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets list of effective Network Security Perimeter Configuration for cosmos db account. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, accountName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - NetworkSecurityPerimeterConfigurationListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = NetworkSecurityPerimeterConfigurationListResult.DeserializeNetworkSecurityPerimeterConfigurationListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets list of effective Network Security Perimeter Configuration for cosmos db account. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, accountName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - NetworkSecurityPerimeterConfigurationListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = NetworkSecurityPerimeterConfigurationListResult.DeserializeNetworkSecurityPerimeterConfigurationListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string accountName, string networkSecurityPerimeterConfigurationName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/networkSecurityPerimeterConfigurations/", false); - uri.AppendPath(networkSecurityPerimeterConfigurationName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string accountName, string networkSecurityPerimeterConfigurationName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/networkSecurityPerimeterConfigurations/", false); - uri.AppendPath(networkSecurityPerimeterConfigurationName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets effective Network Security Perimeter Configuration for association. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The name for Network Security Perimeter configuration. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string accountName, string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(networkSecurityPerimeterConfigurationName, nameof(networkSecurityPerimeterConfigurationName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, accountName, networkSecurityPerimeterConfigurationName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - NetworkSecurityPerimeterConfigurationData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = NetworkSecurityPerimeterConfigurationData.DeserializeNetworkSecurityPerimeterConfigurationData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((NetworkSecurityPerimeterConfigurationData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets effective Network Security Perimeter Configuration for association. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The name for Network Security Perimeter configuration. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string accountName, string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(networkSecurityPerimeterConfigurationName, nameof(networkSecurityPerimeterConfigurationName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, accountName, networkSecurityPerimeterConfigurationName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - NetworkSecurityPerimeterConfigurationData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = NetworkSecurityPerimeterConfigurationData.DeserializeNetworkSecurityPerimeterConfigurationData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((NetworkSecurityPerimeterConfigurationData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateReconcileRequestUri(string subscriptionId, string resourceGroupName, string accountName, string networkSecurityPerimeterConfigurationName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/networkSecurityPerimeterConfigurations/", false); - uri.AppendPath(networkSecurityPerimeterConfigurationName, true); - uri.AppendPath("/reconcile", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateReconcileRequest(string subscriptionId, string resourceGroupName, string accountName, string networkSecurityPerimeterConfigurationName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/networkSecurityPerimeterConfigurations/", false); - uri.AppendPath(networkSecurityPerimeterConfigurationName, true); - uri.AppendPath("/reconcile", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Refreshes any information about the association. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The name for Network Security Perimeter configuration. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task ReconcileAsync(string subscriptionId, string resourceGroupName, string accountName, string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(networkSecurityPerimeterConfigurationName, nameof(networkSecurityPerimeterConfigurationName)); - - using var message = CreateReconcileRequest(subscriptionId, resourceGroupName, accountName, networkSecurityPerimeterConfigurationName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Refreshes any information about the association. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The name for Network Security Perimeter configuration. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Reconcile(string subscriptionId, string resourceGroupName, string accountName, string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(networkSecurityPerimeterConfigurationName, nameof(networkSecurityPerimeterConfigurationName)); - - using var message = CreateReconcileRequest(subscriptionId, resourceGroupName, accountName, networkSecurityPerimeterConfigurationName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string accountName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string accountName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets list of effective Network Security Perimeter Configuration for cosmos db account. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, accountName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - NetworkSecurityPerimeterConfigurationListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = NetworkSecurityPerimeterConfigurationListResult.DeserializeNetworkSecurityPerimeterConfigurationListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets list of effective Network Security Perimeter Configuration for cosmos db account. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, accountName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - NetworkSecurityPerimeterConfigurationListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = NetworkSecurityPerimeterConfigurationListResult.DeserializeNetworkSecurityPerimeterConfigurationListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PartitionKeyRangeIdRegionRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PartitionKeyRangeIdRegionRestOperations.cs index 3a9f8b7f7979..86a44b51873d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PartitionKeyRangeIdRegionRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PartitionKeyRangeIdRegionRestOperations.cs @@ -32,7 +32,7 @@ public PartitionKeyRangeIdRegionRestOperations(HttpPipeline pipeline, string app { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-08-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -91,7 +91,7 @@ internal HttpMessage CreateListMetricsRequest(string subscriptionId, string reso } /// Retrieves the metrics determined by the given filter for the given partition key range id and region. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB region, with spaces between words and each word capitalized. @@ -130,7 +130,7 @@ public async Task> ListMetricsAsync(string s } /// Retrieves the metrics determined by the given filter for the given partition key range id and region. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB region, with spaces between words and each word capitalized. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PartitionKeyRangeIdRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PartitionKeyRangeIdRestOperations.cs index 4ec5dc1b5dc5..24e357aebe18 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PartitionKeyRangeIdRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PartitionKeyRangeIdRestOperations.cs @@ -32,7 +32,7 @@ public PartitionKeyRangeIdRestOperations(HttpPipeline pipeline, string applicati { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-08-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -87,7 +87,7 @@ internal HttpMessage CreateListMetricsRequest(string subscriptionId, string reso } /// Retrieves the metrics determined by the given filter for the given partition key range id. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -124,7 +124,7 @@ public async Task> ListMetricsAsync(string s } /// Retrieves the metrics determined by the given filter for the given partition key range id. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileRestOperations.cs index b33d0dbf8f72..2d4ed3b5aa6a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileRestOperations.cs @@ -32,7 +32,7 @@ public PercentileRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-08-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -75,7 +75,7 @@ internal HttpMessage CreateListMetricsRequest(string subscriptionId, string reso } /// Retrieves the metrics determined by the given filter for the given database account. This url is only for PBS and Replication Latency data. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. @@ -106,7 +106,7 @@ public async Task> ListMetricsAsync(string } /// Retrieves the metrics determined by the given filter for the given database account. This url is only for PBS and Replication Latency data. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileSourceTargetRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileSourceTargetRestOperations.cs index cf7823c7b454..a587827b6744 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileSourceTargetRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileSourceTargetRestOperations.cs @@ -32,7 +32,7 @@ public PercentileSourceTargetRestOperations(HttpPipeline pipeline, string applic { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-08-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -83,7 +83,7 @@ internal HttpMessage CreateListMetricsRequest(string subscriptionId, string reso } /// Retrieves the metrics determined by the given filter for the given account, source and target region. This url is only for PBS and Replication Latency data. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Source region from which data is written. Cosmos DB region, with spaces between words and each word capitalized. @@ -118,7 +118,7 @@ public async Task> ListMetricsAsync(string } /// Retrieves the metrics determined by the given filter for the given account, source and target region. This url is only for PBS and Replication Latency data. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Source region from which data is written. Cosmos DB region, with spaces between words and each word capitalized. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileTargetRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileTargetRestOperations.cs index e75329ed2dfc..2dace4fd6801 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileTargetRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileTargetRestOperations.cs @@ -32,7 +32,7 @@ public PercentileTargetRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-08-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -79,7 +79,7 @@ internal HttpMessage CreateListMetricsRequest(string subscriptionId, string reso } /// Retrieves the metrics determined by the given filter for the given account target region. This url is only for PBS and Replication Latency data. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Target region to which data is written. Cosmos DB region, with spaces between words and each word capitalized. @@ -112,7 +112,7 @@ public async Task> ListMetricsAsync(string } /// Retrieves the metrics determined by the given filter for the given account target region. This url is only for PBS and Replication Latency data. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Target region to which data is written. Cosmos DB region, with spaces between words and each word capitalized. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs index c2a9794bf6f0..d7a76ff4bd51 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs @@ -32,7 +32,7 @@ public PrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-08-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListByDatabaseAccountRequest(string subscriptionId, s } /// List all private endpoint connections on a Cosmos DB account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> ListByD } /// List all private endpoint connections on a Cosmos DB account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -169,7 +169,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Gets a private endpoint connection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The name of the private endpoint connection. @@ -202,7 +202,7 @@ public async Task> GetAsync(stri } /// Gets a private endpoint connection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The name of the private endpoint connection. @@ -277,7 +277,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Approve or reject a private endpoint connection with a given name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The name of the private endpoint connection. @@ -306,7 +306,7 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } /// Approve or reject a private endpoint connection with a given name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The name of the private endpoint connection. @@ -373,7 +373,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Deletes a private endpoint connection with a given name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The name of the private endpoint connection. @@ -400,7 +400,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Deletes a private endpoint connection with a given name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The name of the private endpoint connection. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs index db278d29df8e..7b89062b00f2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs @@ -32,7 +32,7 @@ public PrivateLinkResourcesRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-08-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListByDatabaseAccountRequest(string subscriptionId, s } /// Gets the private link resources that need to be created for a Cosmos DB account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> ListByDatabas } /// Gets the private link resources that need to be created for a Cosmos DB account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -169,7 +169,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Gets the private link resources that need to be created for a Cosmos DB account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The name of the private link resource. @@ -202,7 +202,7 @@ public async Task> GetAsync(string sub } /// Gets the private link resources that need to be created for a Cosmos DB account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The name of the private link resource. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableDatabaseAccountsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableDatabaseAccountsRestOperations.cs index 3079cb29a7ec..b19d7b9c2fee 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableDatabaseAccountsRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableDatabaseAccountsRestOperations.cs @@ -32,7 +32,7 @@ public RestorableDatabaseAccountsRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-08-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -69,7 +69,7 @@ internal HttpMessage CreateListByLocationRequest(string subscriptionId, AzureLoc } /// Lists all the restorable Azure Cosmos DB database accounts available under the subscription and in a region. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The cancellation token to use. /// is null. @@ -95,7 +95,7 @@ public async Task> ListByLocation } /// Lists all the restorable Azure Cosmos DB database accounts available under the subscription and in a region. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The cancellation token to use. /// is null. @@ -149,7 +149,7 @@ internal HttpMessage CreateListRequest(string subscriptionId) } /// Lists all the restorable Azure Cosmos DB database accounts available under the subscription. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -174,7 +174,7 @@ public async Task> ListAsync(stri } /// Lists all the restorable Azure Cosmos DB database accounts available under the subscription. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -233,7 +233,7 @@ internal HttpMessage CreateGetByLocationRequest(string subscriptionId, AzureLoca } /// Retrieves the properties of an existing Azure Cosmos DB restorable database account. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The cancellation token to use. @@ -262,7 +262,7 @@ public async Task> GetByLocationAsync(st } /// Retrieves the properties of an existing Azure Cosmos DB restorable database account. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The cancellation token to use. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinDatabasesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinDatabasesRestOperations.cs index 198c935563f5..2bbfc142769f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinDatabasesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinDatabasesRestOperations.cs @@ -32,7 +32,7 @@ public RestorableGremlinDatabasesRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-08-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation loca } /// Show the event feed of all mutations done on all the Azure Cosmos DB Gremlin databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The cancellation token to use. @@ -100,7 +100,7 @@ public async Task> ListAsync(stri } /// Show the event feed of all mutations done on all the Azure Cosmos DB Gremlin databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The cancellation token to use. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinGraphsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinGraphsRestOperations.cs index cc0c17ab09ba..109fe2d41786 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinGraphsRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinGraphsRestOperations.cs @@ -32,7 +32,7 @@ public RestorableGremlinGraphsRestOperations(HttpPipeline pipeline, string appli { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-08-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -97,7 +97,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation loca } /// Show the event feed of all mutations done on all the Azure Cosmos DB Gremlin graphs under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The resource ID of the Gremlin database. @@ -127,7 +127,7 @@ public async Task> ListAsync(string } /// Show the event feed of all mutations done on all the Azure Cosmos DB Gremlin graphs under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The resource ID of the Gremlin database. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinResourcesRestOperations.cs index 7d77385228c0..035bb50f8656 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinResourcesRestOperations.cs @@ -32,7 +32,7 @@ public RestorableGremlinResourcesRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-08-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -89,7 +89,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation loca } /// Return a list of gremlin database and graphs combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The location where the restorable resources are located. @@ -118,7 +118,7 @@ public async Task> ListAsync(stri } /// Return a list of gremlin database and graphs combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The location where the restorable resources are located. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbCollectionsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbCollectionsRestOperations.cs index 245d89c8938f..f041586c9ec2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbCollectionsRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbCollectionsRestOperations.cs @@ -32,7 +32,7 @@ public RestorableMongodbCollectionsRestOperations(HttpPipeline pipeline, string { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-08-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -97,7 +97,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation loca } /// Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB collections under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The resource ID of the MongoDB database. @@ -127,7 +127,7 @@ public async Task> ListAsync(st } /// Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB collections under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The resource ID of the MongoDB database. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbDatabasesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbDatabasesRestOperations.cs index d2050697309f..4daf43973b2a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbDatabasesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbDatabasesRestOperations.cs @@ -32,7 +32,7 @@ public RestorableMongodbDatabasesRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-08-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation loca } /// Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The cancellation token to use. @@ -100,7 +100,7 @@ public async Task> ListAsync(stri } /// Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The cancellation token to use. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbResourcesRestOperations.cs index 668cb3e6382e..d4dfe5329b06 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbResourcesRestOperations.cs @@ -32,7 +32,7 @@ public RestorableMongodbResourcesRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-08-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -89,7 +89,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation loca } /// Return a list of database and collection combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The location where the restorable resources are located. @@ -118,7 +118,7 @@ public async Task> ListAsync(stri } /// Return a list of database and collection combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The location where the restorable resources are located. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlContainersRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlContainersRestOperations.cs index a64786530374..c50701617648 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlContainersRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlContainersRestOperations.cs @@ -32,7 +32,7 @@ public RestorableSqlContainersRestOperations(HttpPipeline pipeline, string appli { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-08-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -97,7 +97,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation loca } /// Show the event feed of all mutations done on all the Azure Cosmos DB SQL containers under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The resource ID of the SQL database. @@ -127,7 +127,7 @@ public async Task> ListAsync(string } /// Show the event feed of all mutations done on all the Azure Cosmos DB SQL containers under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The resource ID of the SQL database. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlDatabasesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlDatabasesRestOperations.cs index dc72044aaf63..8e37c4cce000 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlDatabasesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlDatabasesRestOperations.cs @@ -32,7 +32,7 @@ public RestorableSqlDatabasesRestOperations(HttpPipeline pipeline, string applic { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-08-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation loca } /// Show the event feed of all mutations done on all the Azure Cosmos DB SQL databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The cancellation token to use. @@ -100,7 +100,7 @@ public async Task> ListAsync(string s } /// Show the event feed of all mutations done on all the Azure Cosmos DB SQL databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The cancellation token to use. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlResourcesRestOperations.cs index c049d5f1d039..07832d48efc1 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlResourcesRestOperations.cs @@ -32,7 +32,7 @@ public RestorableSqlResourcesRestOperations(HttpPipeline pipeline, string applic { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-08-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -89,7 +89,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation loca } /// Return a list of database and container combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The location where the restorable resources are located. @@ -118,7 +118,7 @@ public async Task> ListAsync(string s } /// Return a list of database and container combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The location where the restorable resources are located. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableTableResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableTableResourcesRestOperations.cs index 3287cd3e7756..2e77c1a2cb7f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableTableResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableTableResourcesRestOperations.cs @@ -32,7 +32,7 @@ public RestorableTableResourcesRestOperations(HttpPipeline pipeline, string appl { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-08-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -89,7 +89,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation loca } /// Return a list of tables that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The location where the restorable resources are located. @@ -118,7 +118,7 @@ public async Task> ListAsync(string } /// Return a list of tables that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The location where the restorable resources are located. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableTablesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableTablesRestOperations.cs index 03a782605338..fc0ae60cc440 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableTablesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableTablesRestOperations.cs @@ -32,7 +32,7 @@ public RestorableTablesRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-08-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -89,7 +89,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation loca } /// Show the event feed of all mutations done on all the Azure Cosmos DB Tables. This helps in scenario where table was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// Restorable Tables event feed start time. @@ -118,7 +118,7 @@ public async Task> ListAsync(string subscri } /// Show the event feed of all mutations done on all the Azure Cosmos DB Tables. This helps in scenario where table was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// Restorable Tables event feed start time. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ServiceRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ServiceRestOperations.cs index c0f17bb98994..fc36d766d006 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ServiceRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ServiceRestOperations.cs @@ -32,7 +32,7 @@ public ServiceRestOperations(HttpPipeline pipeline, string applicationId, Uri en { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-08-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// Gets the status of service. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> ListAsync(string subscrip } /// Gets the status of service. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -173,7 +173,7 @@ internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceG } /// Creates a service. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB service name. @@ -202,7 +202,7 @@ public async Task CreateAsync(string subscriptionId, string resourceGr } /// Creates a service. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB service name. @@ -269,7 +269,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Gets the status of service. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB service name. @@ -302,7 +302,7 @@ public async Task> GetAsync(string subscriptionId, } /// Gets the status of service. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB service name. @@ -373,7 +373,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Deletes service with the given serviceName. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB service name. @@ -401,7 +401,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Deletes service with the given serviceName. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB service name. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/SqlResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/SqlResourcesRestOperations.cs index 71c82039a2be..ddb66046cd0c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/SqlResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/SqlResourcesRestOperations.cs @@ -32,7 +32,7 @@ public SqlResourcesRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-08-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListSqlDatabasesRequest(string subscriptionId, string } /// Lists the SQL databases under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> ListSqlDatabasesAsync } /// Lists the SQL databases under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -169,7 +169,7 @@ internal HttpMessage CreateGetSqlDatabaseRequest(string subscriptionId, string r } /// Gets the SQL database under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -202,7 +202,7 @@ public async Task> GetSqlDatabaseAsync(string } /// Gets the SQL database under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -277,7 +277,7 @@ internal HttpMessage CreateCreateUpdateSqlDatabaseRequest(string subscriptionId, } /// Create or update an Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -306,7 +306,7 @@ public async Task CreateUpdateSqlDatabaseAsync(string subscriptionId, } /// Create or update an Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -372,7 +372,7 @@ internal HttpMessage CreateDeleteSqlDatabaseRequest(string subscriptionId, strin } /// Deletes an existing Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -399,7 +399,7 @@ public async Task DeleteSqlDatabaseAsync(string subscriptionId, string } /// Deletes an existing Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -466,7 +466,7 @@ internal HttpMessage CreateGetSqlDatabaseThroughputRequest(string subscriptionId } /// Gets the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -499,7 +499,7 @@ public async Task> GetSqlDatabaseThroughputAsync } /// Gets the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -576,7 +576,7 @@ internal HttpMessage CreateUpdateSqlDatabaseThroughputRequest(string subscriptio } /// Update RUs per second of an Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -605,7 +605,7 @@ public async Task UpdateSqlDatabaseThroughputAsync(string subscription } /// Update RUs per second of an Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -674,7 +674,7 @@ internal HttpMessage CreateMigrateSqlDatabaseToAutoscaleRequest(string subscript } /// Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -701,7 +701,7 @@ public async Task MigrateSqlDatabaseToAutoscaleAsync(string subscripti } /// Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -768,7 +768,7 @@ internal HttpMessage CreateMigrateSqlDatabaseToManualThroughputRequest(string su } /// Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -795,7 +795,7 @@ public async Task MigrateSqlDatabaseToManualThroughputAsync(string sub } /// Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -821,328 +821,6 @@ public Response MigrateSqlDatabaseToManualThroughput(string subscriptionId, stri } } - internal RequestUriBuilder CreateListClientEncryptionKeysRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/sqlDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/clientEncryptionKeys", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListClientEncryptionKeysRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/sqlDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/clientEncryptionKeys", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListClientEncryptionKeysAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - - using var message = CreateListClientEncryptionKeysRequest(subscriptionId, resourceGroupName, accountName, databaseName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ClientEncryptionKeysListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ClientEncryptionKeysListResult.DeserializeClientEncryptionKeysListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response ListClientEncryptionKeys(string subscriptionId, string resourceGroupName, string accountName, string databaseName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - - using var message = CreateListClientEncryptionKeysRequest(subscriptionId, resourceGroupName, accountName, databaseName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ClientEncryptionKeysListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ClientEncryptionKeysListResult.DeserializeClientEncryptionKeysListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetClientEncryptionKeyRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/sqlDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/clientEncryptionKeys/", false); - uri.AppendPath(clientEncryptionKeyName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetClientEncryptionKeyRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/sqlDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/clientEncryptionKeys/", false); - uri.AppendPath(clientEncryptionKeyName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB ClientEncryptionKey name. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task> GetClientEncryptionKeyAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(clientEncryptionKeyName, nameof(clientEncryptionKeyName)); - - using var message = CreateGetClientEncryptionKeyRequest(subscriptionId, resourceGroupName, accountName, databaseName, clientEncryptionKeyName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CosmosDBSqlClientEncryptionKeyData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CosmosDBSqlClientEncryptionKeyData.DeserializeCosmosDBSqlClientEncryptionKeyData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((CosmosDBSqlClientEncryptionKeyData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB ClientEncryptionKey name. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response GetClientEncryptionKey(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(clientEncryptionKeyName, nameof(clientEncryptionKeyName)); - - using var message = CreateGetClientEncryptionKeyRequest(subscriptionId, resourceGroupName, accountName, databaseName, clientEncryptionKeyName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CosmosDBSqlClientEncryptionKeyData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CosmosDBSqlClientEncryptionKeyData.DeserializeCosmosDBSqlClientEncryptionKeyData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((CosmosDBSqlClientEncryptionKeyData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCreateUpdateClientEncryptionKeyRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, CosmosDBSqlClientEncryptionKeyCreateOrUpdateContent content) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/sqlDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/clientEncryptionKeys/", false); - uri.AppendPath(clientEncryptionKeyName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCreateUpdateClientEncryptionKeyRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, CosmosDBSqlClientEncryptionKeyCreateOrUpdateContent content) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/sqlDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/clientEncryptionKeys/", false); - uri.AppendPath(clientEncryptionKeyName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; - _userAgent.Apply(message); - return message; - } - - /// Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell (instead of directly). - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB ClientEncryptionKey name. - /// The parameters to provide for the client encryption key. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task CreateUpdateClientEncryptionKeyAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, CosmosDBSqlClientEncryptionKeyCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(clientEncryptionKeyName, nameof(clientEncryptionKeyName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCreateUpdateClientEncryptionKeyRequest(subscriptionId, resourceGroupName, accountName, databaseName, clientEncryptionKeyName, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell (instead of directly). - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB ClientEncryptionKey name. - /// The parameters to provide for the client encryption key. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response CreateUpdateClientEncryptionKey(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, CosmosDBSqlClientEncryptionKeyCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(clientEncryptionKeyName, nameof(clientEncryptionKeyName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCreateUpdateClientEncryptionKeyRequest(subscriptionId, resourceGroupName, accountName, databaseName, clientEncryptionKeyName, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - internal RequestUriBuilder CreateListSqlContainersRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName) { var uri = new RawRequestUriBuilder(); @@ -1184,7 +862,7 @@ internal HttpMessage CreateListSqlContainersRequest(string subscriptionId, strin } /// Lists the SQL container under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1215,7 +893,7 @@ public async Task> ListSqlContainersAsy } /// Lists the SQL container under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1288,7 +966,7 @@ internal HttpMessage CreateGetSqlContainerRequest(string subscriptionId, string } /// Gets the SQL container under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1323,7 +1001,7 @@ public async Task> GetSqlContainerAsync(strin } /// Gets the SQL container under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1395,237 +1073,34 @@ internal HttpMessage CreateCreateUpdateSqlContainerRequest(string subscriptionId uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; - _userAgent.Apply(message); - return message; - } - - /// Create or update an Azure Cosmos DB SQL container. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB container name. - /// The parameters to provide for the current SQL container. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task CreateUpdateSqlContainerAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, CosmosDBSqlContainerCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(containerName, nameof(containerName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCreateUpdateSqlContainerRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Create or update an Azure Cosmos DB SQL container. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB container name. - /// The parameters to provide for the current SQL container. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response CreateUpdateSqlContainer(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, CosmosDBSqlContainerCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(containerName, nameof(containerName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCreateUpdateSqlContainerRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDeleteSqlContainerRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/sqlDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/containers/", false); - uri.AppendPath(containerName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateDeleteSqlContainerRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/sqlDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/containers/", false); - uri.AppendPath(containerName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - _userAgent.Apply(message); - return message; - } - - /// Deletes an existing Azure Cosmos DB SQL container. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB container name. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task DeleteSqlContainerAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(containerName, nameof(containerName)); - - using var message = CreateDeleteSqlContainerRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Deletes an existing Azure Cosmos DB SQL container. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB container name. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response DeleteSqlContainer(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(containerName, nameof(containerName)); - - using var message = CreateDeleteSqlContainerRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateSqlDatabasePartitionMergeRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, MergeParameters mergeParameters) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/sqlDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/partitionMerge", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateSqlDatabasePartitionMergeRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, MergeParameters mergeParameters) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/sqlDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/partitionMerge", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(mergeParameters, ModelSerializationExtensions.WireOptions); - request.Content = content; + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; _userAgent.Apply(message); return message; } - /// Merges the partitions of a SQL database. - /// The ID of the target subscription. The value must be an UUID. + /// Create or update an Azure Cosmos DB SQL container. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. - /// The parameters for the merge operation. + /// Cosmos DB container name. + /// The parameters to provide for the current SQL container. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task SqlDatabasePartitionMergeAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, MergeParameters mergeParameters, CancellationToken cancellationToken = default) + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task CreateUpdateSqlContainerAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, CosmosDBSqlContainerCreateOrUpdateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); + Argument.AssertNotNullOrEmpty(containerName, nameof(containerName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateSqlDatabasePartitionMergeRequest(subscriptionId, resourceGroupName, accountName, databaseName, mergeParameters); + using var message = CreateCreateUpdateSqlContainerRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName, content); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -1637,24 +1112,26 @@ public async Task SqlDatabasePartitionMergeAsync(string subscriptionId } } - /// Merges the partitions of a SQL database. - /// The ID of the target subscription. The value must be an UUID. + /// Create or update an Azure Cosmos DB SQL container. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. - /// The parameters for the merge operation. + /// Cosmos DB container name. + /// The parameters to provide for the current SQL container. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response SqlDatabasePartitionMerge(string subscriptionId, string resourceGroupName, string accountName, string databaseName, MergeParameters mergeParameters, CancellationToken cancellationToken = default) + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response CreateUpdateSqlContainer(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, CosmosDBSqlContainerCreateOrUpdateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); + Argument.AssertNotNullOrEmpty(containerName, nameof(containerName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateSqlDatabasePartitionMergeRequest(subscriptionId, resourceGroupName, accountName, databaseName, mergeParameters); + using var message = CreateCreateUpdateSqlContainerRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName, content); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -1666,7 +1143,7 @@ public Response SqlDatabasePartitionMerge(string subscriptionId, string resource } } - internal RequestUriBuilder CreateListSqlContainerPartitionMergeRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, MergeParameters mergeParameters) + internal RequestUriBuilder CreateDeleteSqlContainerRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1680,16 +1157,15 @@ internal RequestUriBuilder CreateListSqlContainerPartitionMergeRequestUri(string uri.AppendPath(databaseName, true); uri.AppendPath("/containers/", false); uri.AppendPath(containerName, true); - uri.AppendPath("/partitionMerge", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListSqlContainerPartitionMergeRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, MergeParameters mergeParameters) + internal HttpMessage CreateDeleteSqlContainerRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Post; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -1702,74 +1178,64 @@ internal HttpMessage CreateListSqlContainerPartitionMergeRequest(string subscrip uri.AppendPath(databaseName, true); uri.AppendPath("/containers/", false); uri.AppendPath(containerName, true); - uri.AppendPath("/partitionMerge", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(mergeParameters, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Merges the partitions of a SQL Container. - /// The ID of the target subscription. The value must be an UUID. + /// Deletes an existing Azure Cosmos DB SQL container. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. /// Cosmos DB container name. - /// The parameters for the merge operation. /// The cancellation token to use. - /// , , , , or is null. + /// , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public async Task ListSqlContainerPartitionMergeAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, MergeParameters mergeParameters, CancellationToken cancellationToken = default) + public async Task DeleteSqlContainerAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); Argument.AssertNotNullOrEmpty(containerName, nameof(containerName)); - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - using var message = CreateListSqlContainerPartitionMergeRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName, mergeParameters); + using var message = CreateDeleteSqlContainerRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: case 202: + case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Merges the partitions of a SQL Container. - /// The ID of the target subscription. The value must be an UUID. + /// Deletes an existing Azure Cosmos DB SQL container. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. /// Cosmos DB container name. - /// The parameters for the merge operation. /// The cancellation token to use. - /// , , , , or is null. + /// , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public Response ListSqlContainerPartitionMerge(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, MergeParameters mergeParameters, CancellationToken cancellationToken = default) + public Response DeleteSqlContainer(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); Argument.AssertNotNullOrEmpty(containerName, nameof(containerName)); - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - using var message = CreateListSqlContainerPartitionMergeRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName, mergeParameters); + using var message = CreateDeleteSqlContainerRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: case 202: + case 204: return message.Response; default: throw new RequestFailedException(message.Response); @@ -1821,7 +1287,7 @@ internal HttpMessage CreateGetSqlContainerThroughputRequest(string subscriptionI } /// Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1856,7 +1322,7 @@ public async Task> GetSqlContainerThroughputAsyn } /// Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1939,7 +1405,7 @@ internal HttpMessage CreateUpdateSqlContainerThroughputRequest(string subscripti } /// Update RUs per second of an Azure Cosmos DB SQL container. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1970,7 +1436,7 @@ public async Task UpdateSqlContainerThroughputAsync(string subscriptio } /// Update RUs per second of an Azure Cosmos DB SQL container. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2045,7 +1511,7 @@ internal HttpMessage CreateMigrateSqlContainerToAutoscaleRequest(string subscrip } /// Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2074,7 +1540,7 @@ public async Task MigrateSqlContainerToAutoscaleAsync(string subscript } /// Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2147,7 +1613,7 @@ internal HttpMessage CreateMigrateSqlContainerToManualThroughputRequest(string s } /// Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2176,7 +1642,7 @@ public async Task MigrateSqlContainerToManualThroughputAsync(string su } /// Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2204,109 +1670,7 @@ public Response MigrateSqlContainerToManualThroughput(string subscriptionId, str } } - internal RequestUriBuilder CreateSqlDatabaseRetrieveThroughputDistributionRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RetrieveThroughputParameters retrieveThroughputParameters) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/sqlDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/throughputSettings/default/retrieveThroughputDistribution", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateSqlDatabaseRetrieveThroughputDistributionRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RetrieveThroughputParameters retrieveThroughputParameters) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/sqlDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/throughputSettings/default/retrieveThroughputDistribution", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(retrieveThroughputParameters, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Retrieve throughput distribution for an Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// The parameters to provide for retrieving throughput distribution for the current SQL database. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task SqlDatabaseRetrieveThroughputDistributionAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var message = CreateSqlDatabaseRetrieveThroughputDistributionRequest(subscriptionId, resourceGroupName, accountName, databaseName, retrieveThroughputParameters); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Retrieve throughput distribution for an Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// The parameters to provide for retrieving throughput distribution for the current SQL database. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response SqlDatabaseRetrieveThroughputDistribution(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var message = CreateSqlDatabaseRetrieveThroughputDistributionRequest(subscriptionId, resourceGroupName, accountName, databaseName, retrieveThroughputParameters); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateSqlDatabaseRedistributeThroughputRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RedistributeThroughputParameters redistributeThroughputParameters) + internal RequestUriBuilder CreateListClientEncryptionKeysRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -2318,16 +1682,16 @@ internal RequestUriBuilder CreateSqlDatabaseRedistributeThroughputRequestUri(str uri.AppendPath(accountName, true); uri.AppendPath("/sqlDatabases/", false); uri.AppendPath(databaseName, true); - uri.AppendPath("/throughputSettings/default/redistributeThroughput", false); + uri.AppendPath("/clientEncryptionKeys", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateSqlDatabaseRedistributeThroughputRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RedistributeThroughputParameters redistributeThroughputParameters) + internal HttpMessage CreateListClientEncryptionKeysRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Post; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -2338,77 +1702,77 @@ internal HttpMessage CreateSqlDatabaseRedistributeThroughputRequest(string subsc uri.AppendPath(accountName, true); uri.AppendPath("/sqlDatabases/", false); uri.AppendPath(databaseName, true); - uri.AppendPath("/throughputSettings/default/redistributeThroughput", false); + uri.AppendPath("/clientEncryptionKeys", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(redistributeThroughputParameters, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Redistribute throughput for an Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. + /// Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. - /// The parameters to provide for redistributing throughput for the current SQL database. /// The cancellation token to use. - /// , , , or is null. + /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task SqlDatabaseRedistributeThroughputAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) + public async Task> ListClientEncryptionKeysAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - using var message = CreateSqlDatabaseRedistributeThroughputRequest(subscriptionId, resourceGroupName, accountName, databaseName, redistributeThroughputParameters); + using var message = CreateListClientEncryptionKeysRequest(subscriptionId, resourceGroupName, accountName, databaseName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: - return message.Response; + { + ClientEncryptionKeysListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ClientEncryptionKeysListResult.DeserializeClientEncryptionKeysListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Redistribute throughput for an Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. + /// Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. - /// The parameters to provide for redistributing throughput for the current SQL database. /// The cancellation token to use. - /// , , , or is null. + /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response SqlDatabaseRedistributeThroughput(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) + public Response ListClientEncryptionKeys(string subscriptionId, string resourceGroupName, string accountName, string databaseName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - using var message = CreateSqlDatabaseRedistributeThroughputRequest(subscriptionId, resourceGroupName, accountName, databaseName, redistributeThroughputParameters); + using var message = CreateListClientEncryptionKeysRequest(subscriptionId, resourceGroupName, accountName, databaseName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: - return message.Response; + { + ClientEncryptionKeysListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ClientEncryptionKeysListResult.DeserializeClientEncryptionKeysListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateSqlContainerRetrieveThroughputDistributionRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, RetrieveThroughputParameters retrieveThroughputParameters) + internal RequestUriBuilder CreateGetClientEncryptionKeyRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -2420,18 +1784,17 @@ internal RequestUriBuilder CreateSqlContainerRetrieveThroughputDistributionReque uri.AppendPath(accountName, true); uri.AppendPath("/sqlDatabases/", false); uri.AppendPath(databaseName, true); - uri.AppendPath("/containers/", false); - uri.AppendPath(containerName, true); - uri.AppendPath("/throughputSettings/default/retrieveThroughputDistribution", false); + uri.AppendPath("/clientEncryptionKeys/", false); + uri.AppendPath(clientEncryptionKeyName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateSqlContainerRetrieveThroughputDistributionRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, RetrieveThroughputParameters retrieveThroughputParameters) + internal HttpMessage CreateGetClientEncryptionKeyRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Post; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -2442,83 +1805,86 @@ internal HttpMessage CreateSqlContainerRetrieveThroughputDistributionRequest(str uri.AppendPath(accountName, true); uri.AppendPath("/sqlDatabases/", false); uri.AppendPath(databaseName, true); - uri.AppendPath("/containers/", false); - uri.AppendPath(containerName, true); - uri.AppendPath("/throughputSettings/default/retrieveThroughputDistribution", false); + uri.AppendPath("/clientEncryptionKeys/", false); + uri.AppendPath(clientEncryptionKeyName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(retrieveThroughputParameters, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Retrieve throughput distribution for an Azure Cosmos DB SQL container. - /// The ID of the target subscription. The value must be an UUID. + /// Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. - /// Cosmos DB container name. - /// The parameters to provide for retrieving throughput distribution for the current SQL container. + /// Cosmos DB ClientEncryptionKey name. /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task SqlContainerRetrieveThroughputDistributionAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetClientEncryptionKeyAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(containerName, nameof(containerName)); - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); + Argument.AssertNotNullOrEmpty(clientEncryptionKeyName, nameof(clientEncryptionKeyName)); - using var message = CreateSqlContainerRetrieveThroughputDistributionRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName, retrieveThroughputParameters); + using var message = CreateGetClientEncryptionKeyRequest(subscriptionId, resourceGroupName, accountName, databaseName, clientEncryptionKeyName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: - return message.Response; + { + CosmosDBSqlClientEncryptionKeyData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CosmosDBSqlClientEncryptionKeyData.DeserializeCosmosDBSqlClientEncryptionKeyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((CosmosDBSqlClientEncryptionKeyData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Retrieve throughput distribution for an Azure Cosmos DB SQL container. - /// The ID of the target subscription. The value must be an UUID. + /// Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. - /// Cosmos DB container name. - /// The parameters to provide for retrieving throughput distribution for the current SQL container. + /// Cosmos DB ClientEncryptionKey name. /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response SqlContainerRetrieveThroughputDistribution(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response GetClientEncryptionKey(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(containerName, nameof(containerName)); - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); + Argument.AssertNotNullOrEmpty(clientEncryptionKeyName, nameof(clientEncryptionKeyName)); - using var message = CreateSqlContainerRetrieveThroughputDistributionRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName, retrieveThroughputParameters); + using var message = CreateGetClientEncryptionKeyRequest(subscriptionId, resourceGroupName, accountName, databaseName, clientEncryptionKeyName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: - return message.Response; + { + CosmosDBSqlClientEncryptionKeyData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CosmosDBSqlClientEncryptionKeyData.DeserializeCosmosDBSqlClientEncryptionKeyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((CosmosDBSqlClientEncryptionKeyData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateSqlContainerRedistributeThroughputRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, RedistributeThroughputParameters redistributeThroughputParameters) + internal RequestUriBuilder CreateCreateUpdateClientEncryptionKeyRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, CosmosDBSqlClientEncryptionKeyCreateOrUpdateContent content) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -2530,18 +1896,17 @@ internal RequestUriBuilder CreateSqlContainerRedistributeThroughputRequestUri(st uri.AppendPath(accountName, true); uri.AppendPath("/sqlDatabases/", false); uri.AppendPath(databaseName, true); - uri.AppendPath("/containers/", false); - uri.AppendPath(containerName, true); - uri.AppendPath("/throughputSettings/default/redistributeThroughput", false); + uri.AppendPath("/clientEncryptionKeys/", false); + uri.AppendPath(clientEncryptionKeyName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateSqlContainerRedistributeThroughputRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, RedistributeThroughputParameters redistributeThroughputParameters) + internal HttpMessage CreateCreateUpdateClientEncryptionKeyRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, CosmosDBSqlClientEncryptionKeyCreateOrUpdateContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Post; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -2552,40 +1917,39 @@ internal HttpMessage CreateSqlContainerRedistributeThroughputRequest(string subs uri.AppendPath(accountName, true); uri.AppendPath("/sqlDatabases/", false); uri.AppendPath(databaseName, true); - uri.AppendPath("/containers/", false); - uri.AppendPath(containerName, true); - uri.AppendPath("/throughputSettings/default/redistributeThroughput", false); + uri.AppendPath("/clientEncryptionKeys/", false); + uri.AppendPath(clientEncryptionKeyName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(redistributeThroughputParameters, ModelSerializationExtensions.WireOptions); - request.Content = content; + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; _userAgent.Apply(message); return message; } - /// Redistribute throughput for an Azure Cosmos DB SQL container. - /// The ID of the target subscription. The value must be an UUID. + /// Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell (instead of directly). + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. - /// Cosmos DB container name. - /// The parameters to provide for redistributing throughput for the current SQL container. + /// Cosmos DB ClientEncryptionKey name. + /// The parameters to provide for the client encryption key. /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task SqlContainerRedistributeThroughputAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task CreateUpdateClientEncryptionKeyAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, CosmosDBSqlClientEncryptionKeyCreateOrUpdateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(containerName, nameof(containerName)); - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); + Argument.AssertNotNullOrEmpty(clientEncryptionKeyName, nameof(clientEncryptionKeyName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateSqlContainerRedistributeThroughputRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName, redistributeThroughputParameters); + using var message = CreateCreateUpdateClientEncryptionKeyRequest(subscriptionId, resourceGroupName, accountName, databaseName, clientEncryptionKeyName, content); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -2597,26 +1961,26 @@ public async Task SqlContainerRedistributeThroughputAsync(string subsc } } - /// Redistribute throughput for an Azure Cosmos DB SQL container. - /// The ID of the target subscription. The value must be an UUID. + /// Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell (instead of directly). + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. - /// Cosmos DB container name. - /// The parameters to provide for redistributing throughput for the current SQL container. + /// Cosmos DB ClientEncryptionKey name. + /// The parameters to provide for the client encryption key. /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response SqlContainerRedistributeThroughput(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response CreateUpdateClientEncryptionKey(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, CosmosDBSqlClientEncryptionKeyCreateOrUpdateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(containerName, nameof(containerName)); - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); + Argument.AssertNotNullOrEmpty(clientEncryptionKeyName, nameof(clientEncryptionKeyName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateSqlContainerRedistributeThroughputRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName, redistributeThroughputParameters); + using var message = CreateCreateUpdateClientEncryptionKeyRequest(subscriptionId, resourceGroupName, accountName, databaseName, clientEncryptionKeyName, content); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -2673,7 +2037,7 @@ internal HttpMessage CreateListSqlStoredProceduresRequest(string subscriptionId, } /// Lists the SQL storedProcedure under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2706,7 +2070,7 @@ public async Task> ListSqlStoredP } /// Lists the SQL storedProcedure under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2785,7 +2149,7 @@ internal HttpMessage CreateGetSqlStoredProcedureRequest(string subscriptionId, s } /// Gets the SQL storedProcedure under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2822,7 +2186,7 @@ public async Task> GetSqlStoredProcedur } /// Gets the SQL storedProcedure under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2909,7 +2273,7 @@ internal HttpMessage CreateCreateUpdateSqlStoredProcedureRequest(string subscrip } /// Create or update an Azure Cosmos DB SQL storedProcedure. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2942,7 +2306,7 @@ public async Task CreateUpdateSqlStoredProcedureAsync(string subscript } /// Create or update an Azure Cosmos DB SQL storedProcedure. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3020,7 +2384,7 @@ internal HttpMessage CreateDeleteSqlStoredProcedureRequest(string subscriptionId } /// Deletes an existing Azure Cosmos DB SQL storedProcedure. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3051,7 +2415,7 @@ public async Task DeleteSqlStoredProcedureAsync(string subscriptionId, } /// Deletes an existing Azure Cosmos DB SQL storedProcedure. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3126,7 +2490,7 @@ internal HttpMessage CreateListSqlUserDefinedFunctionsRequest(string subscriptio } /// Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3159,7 +2523,7 @@ public async Task> ListSqlUse } /// Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3238,7 +2602,7 @@ internal HttpMessage CreateGetSqlUserDefinedFunctionRequest(string subscriptionI } /// Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3275,7 +2639,7 @@ public async Task> GetSqlUserDefine } /// Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3362,7 +2726,7 @@ internal HttpMessage CreateCreateUpdateSqlUserDefinedFunctionRequest(string subs } /// Create or update an Azure Cosmos DB SQL userDefinedFunction. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3395,7 +2759,7 @@ public async Task CreateUpdateSqlUserDefinedFunctionAsync(string subsc } /// Create or update an Azure Cosmos DB SQL userDefinedFunction. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3473,7 +2837,7 @@ internal HttpMessage CreateDeleteSqlUserDefinedFunctionRequest(string subscripti } /// Deletes an existing Azure Cosmos DB SQL userDefinedFunction. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3504,7 +2868,7 @@ public async Task DeleteSqlUserDefinedFunctionAsync(string subscriptio } /// Deletes an existing Azure Cosmos DB SQL userDefinedFunction. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3579,7 +2943,7 @@ internal HttpMessage CreateListSqlTriggersRequest(string subscriptionId, string } /// Lists the SQL trigger under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3612,7 +2976,7 @@ public async Task> ListSqlTriggersAsync(s } /// Lists the SQL trigger under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3691,7 +3055,7 @@ internal HttpMessage CreateGetSqlTriggerRequest(string subscriptionId, string re } /// Gets the SQL trigger under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3728,7 +3092,7 @@ public async Task> GetSqlTriggerAsync(string su } /// Gets the SQL trigger under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3815,7 +3179,7 @@ internal HttpMessage CreateCreateUpdateSqlTriggerRequest(string subscriptionId, } /// Create or update an Azure Cosmos DB SQL trigger. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3848,7 +3212,7 @@ public async Task CreateUpdateSqlTriggerAsync(string subscriptionId, s } /// Create or update an Azure Cosmos DB SQL trigger. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3926,7 +3290,7 @@ internal HttpMessage CreateDeleteSqlTriggerRequest(string subscriptionId, string } /// Deletes an existing Azure Cosmos DB SQL trigger. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3957,7 +3321,7 @@ public async Task DeleteSqlTriggerAsync(string subscriptionId, string } /// Deletes an existing Azure Cosmos DB SQL trigger. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -4026,7 +3390,7 @@ internal HttpMessage CreateGetSqlRoleDefinitionRequest(string subscriptionId, st } /// Retrieves the properties of an existing Azure Cosmos DB SQL Role Definition with the given Id. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The GUID for the Role Definition. @@ -4059,7 +3423,7 @@ public async Task> GetSqlRoleDefinitionA } /// Retrieves the properties of an existing Azure Cosmos DB SQL Role Definition with the given Id. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The GUID for the Role Definition. @@ -4134,7 +3498,7 @@ internal HttpMessage CreateCreateUpdateSqlRoleDefinitionRequest(string subscript } /// Creates or updates an Azure Cosmos DB SQL Role Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The GUID for the Role Definition. @@ -4163,7 +3527,7 @@ public async Task CreateUpdateSqlRoleDefinitionAsync(string subscripti } /// Creates or updates an Azure Cosmos DB SQL Role Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The GUID for the Role Definition. @@ -4230,7 +3594,7 @@ internal HttpMessage CreateDeleteSqlRoleDefinitionRequest(string subscriptionId, } /// Deletes an existing Azure Cosmos DB SQL Role Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The GUID for the Role Definition. @@ -4258,7 +3622,7 @@ public async Task DeleteSqlRoleDefinitionAsync(string subscriptionId, } /// Deletes an existing Azure Cosmos DB SQL Role Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The GUID for the Role Definition. @@ -4322,7 +3686,7 @@ internal HttpMessage CreateListSqlRoleDefinitionsRequest(string subscriptionId, } /// Retrieves the list of all Azure Cosmos DB SQL Role Definitions. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -4351,7 +3715,7 @@ public async Task> ListSqlRoleDefinition } /// Retrieves the list of all Azure Cosmos DB SQL Role Definitions. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -4418,7 +3782,7 @@ internal HttpMessage CreateGetSqlRoleAssignmentRequest(string subscriptionId, st } /// Retrieves the properties of an existing Azure Cosmos DB SQL Role Assignment with the given Id. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The GUID for the Role Assignment. @@ -4451,7 +3815,7 @@ public async Task> GetSqlRoleAssignmentA } /// Retrieves the properties of an existing Azure Cosmos DB SQL Role Assignment with the given Id. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The GUID for the Role Assignment. @@ -4526,7 +3890,7 @@ internal HttpMessage CreateCreateUpdateSqlRoleAssignmentRequest(string subscript } /// Creates or updates an Azure Cosmos DB SQL Role Assignment. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The GUID for the Role Assignment. @@ -4555,7 +3919,7 @@ public async Task CreateUpdateSqlRoleAssignmentAsync(string subscripti } /// Creates or updates an Azure Cosmos DB SQL Role Assignment. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The GUID for the Role Assignment. @@ -4622,7 +3986,7 @@ internal HttpMessage CreateDeleteSqlRoleAssignmentRequest(string subscriptionId, } /// Deletes an existing Azure Cosmos DB SQL Role Assignment. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The GUID for the Role Assignment. @@ -4650,7 +4014,7 @@ public async Task DeleteSqlRoleAssignmentAsync(string subscriptionId, } /// Deletes an existing Azure Cosmos DB SQL Role Assignment. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The GUID for the Role Assignment. @@ -4714,7 +4078,7 @@ internal HttpMessage CreateListSqlRoleAssignmentsRequest(string subscriptionId, } /// Retrieves the list of all Azure Cosmos DB SQL Role Assignments. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -4743,7 +4107,7 @@ public async Task> ListSqlRoleAssignment } /// Retrieves the list of all Azure Cosmos DB SQL Role Assignments. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -4820,7 +4184,7 @@ internal HttpMessage CreateRetrieveContinuousBackupInformationRequest(string sub } /// Retrieves continuous backup information for a container resource. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -4851,7 +4215,7 @@ public async Task RetrieveContinuousBackupInformationAsync(string subs } /// Retrieves continuous backup information for a container resource. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/TableResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/TableResourcesRestOperations.cs index 0397dbd21317..ac07c6534305 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/TableResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/TableResourcesRestOperations.cs @@ -32,7 +32,7 @@ public TableResourcesRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-08-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListTablesRequest(string subscriptionId, string resou } /// Lists the Tables under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> ListTablesAsync(string subs } /// Lists the Tables under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -169,7 +169,7 @@ internal HttpMessage CreateGetTableRequest(string subscriptionId, string resourc } /// Gets the Tables under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -202,7 +202,7 @@ public async Task> GetTableAsync(string subscription } /// Gets the Tables under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -277,7 +277,7 @@ internal HttpMessage CreateCreateUpdateTableRequest(string subscriptionId, strin } /// Create or update an Azure Cosmos DB Table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -306,7 +306,7 @@ public async Task CreateUpdateTableAsync(string subscriptionId, string } /// Create or update an Azure Cosmos DB Table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -372,7 +372,7 @@ internal HttpMessage CreateDeleteTableRequest(string subscriptionId, string reso } /// Deletes an existing Azure Cosmos DB Table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -399,7 +399,7 @@ public async Task DeleteTableAsync(string subscriptionId, string resou } /// Deletes an existing Azure Cosmos DB Table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -466,7 +466,7 @@ internal HttpMessage CreateGetTableThroughputRequest(string subscriptionId, stri } /// Gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -499,7 +499,7 @@ public async Task> GetTableThroughputAsync(strin } /// Gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -576,7 +576,7 @@ internal HttpMessage CreateUpdateTableThroughputRequest(string subscriptionId, s } /// Update RUs per second of an Azure Cosmos DB Table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -605,7 +605,7 @@ public async Task UpdateTableThroughputAsync(string subscriptionId, st } /// Update RUs per second of an Azure Cosmos DB Table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -674,7 +674,7 @@ internal HttpMessage CreateMigrateTableToAutoscaleRequest(string subscriptionId, } /// Migrate an Azure Cosmos DB Table from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -701,7 +701,7 @@ public async Task MigrateTableToAutoscaleAsync(string subscriptionId, } /// Migrate an Azure Cosmos DB Table from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -768,7 +768,7 @@ internal HttpMessage CreateMigrateTableToManualThroughputRequest(string subscrip } /// Migrate an Azure Cosmos DB Table from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -795,7 +795,7 @@ public async Task MigrateTableToManualThroughputAsync(string subscript } /// Migrate an Azure Cosmos DB Table from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -866,7 +866,7 @@ internal HttpMessage CreateRetrieveContinuousBackupInformationRequest(string sub } /// Retrieves continuous backup information for a table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -895,7 +895,7 @@ public async Task RetrieveContinuousBackupInformationAsync(string subs } /// Retrieves continuous backup information for a table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolAccountRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolAccountRestOperations.cs deleted file mode 100644 index fa6087fb942a..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolAccountRestOperations.cs +++ /dev/null @@ -1,334 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.CosmosDB -{ - internal partial class ThroughputPoolAccountRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of ThroughputPoolAccountRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public ThroughputPoolAccountRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string throughputPoolName, string throughputPoolAccountName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendPath("/throughputPoolAccounts/", false); - uri.AppendPath(throughputPoolAccountName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string throughputPoolName, string throughputPoolAccountName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendPath("/throughputPoolAccounts/", false); - uri.AppendPath(throughputPoolAccountName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// Cosmos DB global database account in a Throughput Pool. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string throughputPoolName, string throughputPoolAccountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, throughputPoolName, throughputPoolAccountName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CosmosDBThroughputPoolAccountData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CosmosDBThroughputPoolAccountData.DeserializeCosmosDBThroughputPoolAccountData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((CosmosDBThroughputPoolAccountData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// Cosmos DB global database account in a Throughput Pool. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string throughputPoolName, string throughputPoolAccountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, throughputPoolName, throughputPoolAccountName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CosmosDBThroughputPoolAccountData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CosmosDBThroughputPoolAccountData.DeserializeCosmosDBThroughputPoolAccountData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((CosmosDBThroughputPoolAccountData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string throughputPoolName, string throughputPoolAccountName, CosmosDBThroughputPoolAccountData data) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendPath("/throughputPoolAccounts/", false); - uri.AppendPath(throughputPoolAccountName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string throughputPoolName, string throughputPoolAccountName, CosmosDBThroughputPoolAccountData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendPath("/throughputPoolAccounts/", false); - uri.AppendPath(throughputPoolAccountName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// Cosmos DB global database account in a Throughput Pool. - /// The parameters to provide for the current ThroughputPoolAccount. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string throughputPoolName, string throughputPoolAccountName, CosmosDBThroughputPoolAccountData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, throughputPoolName, throughputPoolAccountName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// Cosmos DB global database account in a Throughput Pool. - /// The parameters to provide for the current ThroughputPoolAccount. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string throughputPoolName, string throughputPoolAccountName, CosmosDBThroughputPoolAccountData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, throughputPoolName, throughputPoolAccountName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string throughputPoolName, string throughputPoolAccountName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendPath("/throughputPoolAccounts/", false); - uri.AppendPath(throughputPoolAccountName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string throughputPoolName, string throughputPoolAccountName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendPath("/throughputPoolAccounts/", false); - uri.AppendPath(throughputPoolAccountName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Removes an existing Azure Cosmos DB database account from a throughput pool. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// Cosmos DB global database account in a Throughput Pool. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string throughputPoolName, string throughputPoolAccountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, throughputPoolName, throughputPoolAccountName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Removes an existing Azure Cosmos DB database account from a throughput pool. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// Cosmos DB global database account in a Throughput Pool. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string throughputPoolName, string throughputPoolAccountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, throughputPoolName, throughputPoolAccountName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolAccountsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolAccountsRestOperations.cs deleted file mode 100644 index 331d4a1aa715..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolAccountsRestOperations.cs +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - internal partial class ThroughputPoolAccountsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of ThroughputPoolAccountsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public ThroughputPoolAccountsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string throughputPoolName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendPath("/throughputPoolAccounts", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string throughputPoolName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendPath("/throughputPoolAccounts", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists all the Azure Cosmos DB accounts available under the subscription. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, throughputPoolName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ThroughputPoolAccountsListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ThroughputPoolAccountsListResult.DeserializeThroughputPoolAccountsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists all the Azure Cosmos DB accounts available under the subscription. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, throughputPoolName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ThroughputPoolAccountsListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ThroughputPoolAccountsListResult.DeserializeThroughputPoolAccountsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string throughputPoolName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string throughputPoolName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists all the Azure Cosmos DB accounts available under the subscription. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, throughputPoolName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ThroughputPoolAccountsListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ThroughputPoolAccountsListResult.DeserializeThroughputPoolAccountsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists all the Azure Cosmos DB accounts available under the subscription. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, throughputPoolName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ThroughputPoolAccountsListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ThroughputPoolAccountsListResult.DeserializeThroughputPoolAccountsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolRestOperations.cs deleted file mode 100644 index 1476c1c734c0..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolRestOperations.cs +++ /dev/null @@ -1,403 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - internal partial class ThroughputPoolRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of ThroughputPoolRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public ThroughputPoolRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string throughputPoolName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string throughputPoolName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, throughputPoolName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CosmosDBThroughputPoolData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CosmosDBThroughputPoolData.DeserializeCosmosDBThroughputPoolData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((CosmosDBThroughputPoolData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, throughputPoolName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CosmosDBThroughputPoolData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CosmosDBThroughputPoolData.DeserializeCosmosDBThroughputPoolData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((CosmosDBThroughputPoolData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string throughputPoolName, CosmosDBThroughputPoolData data) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string throughputPoolName, CosmosDBThroughputPoolData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// The parameters to provide for the current ThroughputPool. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string throughputPoolName, CosmosDBThroughputPoolData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, throughputPoolName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// The parameters to provide for the current ThroughputPool. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string throughputPoolName, CosmosDBThroughputPoolData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, throughputPoolName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string throughputPoolName, CosmosDBThroughputPoolPatch patch) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string throughputPoolName, CosmosDBThroughputPoolPatch patch) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Updates the properties of an existing Azure Cosmos DB Throughput Pool. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// The parameters to provide for the current Throughput Pool. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string throughputPoolName, CosmosDBThroughputPoolPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, throughputPoolName, patch); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Updates the properties of an existing Azure Cosmos DB Throughput Pool. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// The parameters to provide for the current Throughput Pool. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string throughputPoolName, CosmosDBThroughputPoolPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, throughputPoolName, patch); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string throughputPoolName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string throughputPoolName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Deletes an existing Azure Cosmos DB Throughput Pool. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, throughputPoolName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Deletes an existing Azure Cosmos DB Throughput Pool. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, throughputPoolName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolsRestOperations.cs deleted file mode 100644 index 936dc1ea04e3..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolsRestOperations.cs +++ /dev/null @@ -1,359 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - internal partial class ThroughputPoolsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of ThroughputPoolsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public ThroughputPoolsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateListRequestUri(string subscriptionId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/throughputPools", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListRequest(string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/throughputPools", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists all the Azure Cosmos DB Throughput Pools available under the subscription. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ThroughputPoolsListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ThroughputPoolsListResult.DeserializeThroughputPoolsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists all the Azure Cosmos DB Throughput Pools available under the subscription. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ThroughputPoolsListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ThroughputPoolsListResult.DeserializeThroughputPoolsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/throughputPools", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/throughputPools", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List all the ThroughputPools in a given resource group. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ThroughputPoolsListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ThroughputPoolsListResult.DeserializeThroughputPoolsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List all the ThroughputPools in a given resource group. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ThroughputPoolsListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ThroughputPoolsListResult.DeserializeThroughputPoolsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists all the Azure Cosmos DB Throughput Pools available under the subscription. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ThroughputPoolsListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ThroughputPoolsListResult.DeserializeThroughputPoolsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists all the Azure Cosmos DB Throughput Pools available under the subscription. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ThroughputPoolsListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ThroughputPoolsListResult.DeserializeThroughputPoolsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List all the ThroughputPools in a given resource group. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ThroughputPoolsListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ThroughputPoolsListResult.DeserializeThroughputPoolsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List all the ThroughputPools in a given resource group. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ThroughputPoolsListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ThroughputPoolsListResult.DeserializeThroughputPoolsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountCollection.cs index 0dba357a5560..4a9a1ab4e314 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -105,7 +105,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -146,7 +146,7 @@ public virtual Response Get(Guid instanceId, /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -175,7 +175,7 @@ public virtual AsyncPageable GetAllAsync(Canc /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -204,7 +204,7 @@ public virtual Pageable GetAll(CancellationTo /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -243,7 +243,7 @@ public virtual async Task> ExistsAsync(Guid instanceId, Cancellat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual Response Exists(Guid instanceId, CancellationToken cancella /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -323,7 +323,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountData.Serialization.cs index 9837575f9dc1..be3c630f1c44 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountData.Serialization.cs @@ -67,16 +67,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode writer.WritePropertyName("creationTime"u8); writer.WriteStringValue(CreatedOn.Value, "O"); } - if (Optional.IsDefined(OldestRestorableOn)) - { - writer.WritePropertyName("oldestRestorableTime"u8); - writer.WriteStringValue(OldestRestorableOn.Value, "O"); - } if (Optional.IsDefined(DeletedOn)) { writer.WritePropertyName("deletionTime"u8); writer.WriteStringValue(DeletedOn.Value, "O"); } + if (Optional.IsDefined(OldestRestorableOn)) + { + writer.WritePropertyName("oldestRestorableTime"u8); + writer.WriteStringValue(OldestRestorableOn.Value, "O"); + } if (options.Format != "W" && Optional.IsDefined(ApiType)) { writer.WritePropertyName("apiType"u8); @@ -138,8 +138,8 @@ internal static RestorableCosmosDBAccountData DeserializeRestorableCosmosDBAccou SystemData systemData = default; string accountName = default; DateTimeOffset? creationTime = default; - DateTimeOffset? oldestRestorableTime = default; DateTimeOffset? deletionTime = default; + DateTimeOffset? oldestRestorableTime = default; CosmosDBApiType? apiType = default; IReadOnlyList restorableLocations = default; IDictionary serializedAdditionalRawData = default; @@ -202,22 +202,22 @@ internal static RestorableCosmosDBAccountData DeserializeRestorableCosmosDBAccou creationTime = property0.Value.GetDateTimeOffset("O"); continue; } - if (property0.NameEquals("oldestRestorableTime"u8)) + if (property0.NameEquals("deletionTime"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - oldestRestorableTime = property0.Value.GetDateTimeOffset("O"); + deletionTime = property0.Value.GetDateTimeOffset("O"); continue; } - if (property0.NameEquals("deletionTime"u8)) + if (property0.NameEquals("oldestRestorableTime"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - deletionTime = property0.Value.GetDateTimeOffset("O"); + oldestRestorableTime = property0.Value.GetDateTimeOffset("O"); continue; } if (property0.NameEquals("apiType"u8)) @@ -260,8 +260,8 @@ internal static RestorableCosmosDBAccountData DeserializeRestorableCosmosDBAccou location, accountName, creationTime, - oldestRestorableTime, deletionTime, + oldestRestorableTime, apiType, restorableLocations ?? new ChangeTrackingList(), serializedAdditionalRawData); @@ -387,34 +387,34 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OldestRestorableOn), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DeletedOn), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" oldestRestorableTime: "); + builder.Append(" deletionTime: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(OldestRestorableOn)) + if (Optional.IsDefined(DeletedOn)) { - builder.Append(" oldestRestorableTime: "); - var formattedDateTimeString = TypeFormatters.ToString(OldestRestorableOn.Value, "o"); + builder.Append(" deletionTime: "); + var formattedDateTimeString = TypeFormatters.ToString(DeletedOn.Value, "o"); builder.AppendLine($"'{formattedDateTimeString}'"); } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DeletedOn), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OldestRestorableOn), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" deletionTime: "); + builder.Append(" oldestRestorableTime: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(DeletedOn)) + if (Optional.IsDefined(OldestRestorableOn)) { - builder.Append(" deletionTime: "); - var formattedDateTimeString = TypeFormatters.ToString(DeletedOn.Value, "o"); + builder.Append(" oldestRestorableTime: "); + var formattedDateTimeString = TypeFormatters.ToString(OldestRestorableOn.Value, "o"); builder.AppendLine($"'{formattedDateTimeString}'"); } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountData.cs index 297199d694ad..e0792a9e8cbb 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountData.cs @@ -65,18 +65,18 @@ internal RestorableCosmosDBAccountData() /// The location of the resource group to which the resource belongs. /// The name of the global database account. /// The creation time of the restorable database account (ISO-8601 format). - /// The least recent time at which the database account can be restored to (ISO-8601 format). /// The time at which the restorable database account has been deleted (ISO-8601 format). + /// The least recent time at which the database account can be restored to (ISO-8601 format). /// The API type of the restorable database account. /// List of regions where the of the database account can be restored from. /// Keeps track of any properties unknown to the library. - internal RestorableCosmosDBAccountData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AzureLocation? location, string accountName, DateTimeOffset? createdOn, DateTimeOffset? oldestRestorableOn, DateTimeOffset? deletedOn, CosmosDBApiType? apiType, IReadOnlyList restorableLocations, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal RestorableCosmosDBAccountData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AzureLocation? location, string accountName, DateTimeOffset? createdOn, DateTimeOffset? deletedOn, DateTimeOffset? oldestRestorableOn, CosmosDBApiType? apiType, IReadOnlyList restorableLocations, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { Location = location; AccountName = accountName; CreatedOn = createdOn; - OldestRestorableOn = oldestRestorableOn; DeletedOn = deletedOn; + OldestRestorableOn = oldestRestorableOn; ApiType = apiType; RestorableLocations = restorableLocations; _serializedAdditionalRawData = serializedAdditionalRawData; @@ -91,12 +91,12 @@ internal RestorableCosmosDBAccountData(ResourceIdentifier id, string name, Resou /// The creation time of the restorable database account (ISO-8601 format). [WirePath("properties.creationTime")] public DateTimeOffset? CreatedOn { get; } - /// The least recent time at which the database account can be restored to (ISO-8601 format). - [WirePath("properties.oldestRestorableTime")] - public DateTimeOffset? OldestRestorableOn { get; } /// The time at which the restorable database account has been deleted (ISO-8601 format). [WirePath("properties.deletionTime")] public DateTimeOffset? DeletedOn { get; } + /// The least recent time at which the database account can be restored to (ISO-8601 format). + [WirePath("properties.oldestRestorableTime")] + public DateTimeOffset? OldestRestorableOn { get; } /// The API type of the restorable database account. [WirePath("properties.apiType")] public CosmosDBApiType? ApiType { get; } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountResource.cs index d91379d270b3..e9d3a6f9ac70 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountResource.cs @@ -146,7 +146,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -186,7 +186,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// Resource @@ -226,7 +226,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -251,7 +251,7 @@ public virtual AsyncPageable GetRestorableSqlDatabasesAsy /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -276,7 +276,7 @@ public virtual Pageable GetRestorableSqlDatabases(Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -304,7 +304,7 @@ public virtual AsyncPageable GetRestorableSqlContainersA /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -332,7 +332,7 @@ public virtual Pageable GetRestorableSqlContainers(strin /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -359,7 +359,7 @@ public virtual AsyncPageable GetAllRestorableSqlResou /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -386,7 +386,7 @@ public virtual Pageable GetAllRestorableSqlResourceDa /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -411,7 +411,7 @@ public virtual AsyncPageable GetRestorableMongoDBData /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -436,7 +436,7 @@ public virtual Pageable GetRestorableMongoDBDatabases /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -464,7 +464,7 @@ public virtual AsyncPageable GetRestorableMongoDBCo /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -492,7 +492,7 @@ public virtual Pageable GetRestorableMongoDBCollect /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -519,7 +519,7 @@ public virtual AsyncPageable GetAllRestorableMong /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -546,7 +546,7 @@ public virtual Pageable GetAllRestorableMongoDBRe /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -571,7 +571,7 @@ public virtual AsyncPageable GetRestorableGremlinData /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -596,7 +596,7 @@ public virtual Pageable GetRestorableGremlinDatabases /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -624,7 +624,7 @@ public virtual AsyncPageable GetRestorableGremlinGraphsA /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -652,7 +652,7 @@ public virtual Pageable GetRestorableGremlinGraphs(strin /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -679,7 +679,7 @@ public virtual AsyncPageable GetRestorableGremlin /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -706,7 +706,7 @@ public virtual Pageable GetRestorableGremlinResou /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -733,7 +733,7 @@ public virtual AsyncPageable GetRestorableTablesAsync(string st /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -760,7 +760,7 @@ public virtual Pageable GetRestorableTables(string startTime = /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// @@ -787,7 +787,7 @@ public virtual AsyncPageable GetRestorableTableReso /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-08-15 /// /// /// diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ThroughputSettingData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ThroughputSettingData.Serialization.cs index 21b4a4133bd8..90d85f240306 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ThroughputSettingData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ThroughputSettingData.Serialization.cs @@ -30,12 +30,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -115,7 +109,6 @@ internal static ThroughputSettingData DeserializeThroughputSettingData(JsonEleme { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -127,16 +120,6 @@ internal static ThroughputSettingData DeserializeThroughputSettingData(JsonEleme Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -215,7 +198,6 @@ internal static ThroughputSettingData DeserializeThroughputSettingData(JsonEleme tags ?? new ChangeTrackingDictionary(), location, resource, - identity, serializedAdditionalRawData); } @@ -302,21 +284,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ThroughputSettingData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ThroughputSettingData.cs index f2525edc1e55..4646f03bcf37 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ThroughputSettingData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ThroughputSettingData.cs @@ -65,12 +65,10 @@ public ThroughputSettingData(AzureLocation location) : base(location) /// The tags. /// The location. /// - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal ThroughputSettingData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedThroughputSettingsResourceInfo resource, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal ThroughputSettingData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedThroughputSettingsResourceInfo resource, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -82,8 +80,5 @@ internal ThroughputSettingData() /// Gets or sets the resource. [WirePath("properties.resource")] public ExtendedThroughputSettingsResourceInfo Resource { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/autorest.md b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/autorest.md index 34c76f1254ca..1dc82703f8db 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/autorest.md +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/autorest.md @@ -9,7 +9,7 @@ azure-arm: true csharp: true library-name: CosmosDB namespace: Azure.ResourceManager.CosmosDB -require: https://github.com/Azure/azure-rest-api-specs/blob/86b70ce378f0005c26b58ba0bcf96907bfa3a966/specification/cosmos-db/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/cosmos-db/resource-manager/readme.md #tag: package-preview-2024-05 output-folder: $(this-folder)/Generated clear-output-folder: true diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/tsp-location.yaml b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/tsp-location.yaml index ec4d97f30e9b..6f9111426edb 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/tsp-location.yaml +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/tsp-location.yaml @@ -1,3 +1,4 @@ -directory: specification/devopsinfrastructure -commit: 16d5475c14c0d620f59d186b5a8c94a06ee85da0 -repo: Azure/azure-rest-api-specs \ No newline at end of file +directory: specification/devopsinfrastructure/Microsoft.DevOpsInfrastructure.Management +commit: 75af203a2e61f012df7acb36ecc7c5febe878a2d +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.Namespaces/api/Azure.Messaging.EventGrid.Namespaces.netstandard2.0.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.Namespaces/api/Azure.Messaging.EventGrid.Namespaces.netstandard2.0.cs index c928aa91bd4f..6622666b54ad 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.Namespaces/api/Azure.Messaging.EventGrid.Namespaces.netstandard2.0.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.Namespaces/api/Azure.Messaging.EventGrid.Namespaces.netstandard2.0.cs @@ -11,105 +11,32 @@ internal AcknowledgeResult() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class BrokerProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class AzureMessagingEventGridNamespacesClientOptions : Azure.Core.ClientOptions { - internal BrokerProperties() { } - public int DeliveryCount { get { throw null; } } - public string LockToken { get { throw null; } } - Azure.Messaging.EventGrid.Namespaces.BrokerProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.Namespaces.BrokerProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public static partial class EventGridNamespacesModelFactory - { - public static Azure.Messaging.EventGrid.Namespaces.AcknowledgeResult AcknowledgeResult(System.Collections.Generic.IEnumerable failedLockTokens = null, System.Collections.Generic.IEnumerable succeededLockTokens = null) { throw null; } - public static Azure.Messaging.EventGrid.Namespaces.BrokerProperties BrokerProperties(string lockToken = null, int deliveryCount = 0) { throw null; } - public static Azure.Messaging.EventGrid.Namespaces.FailedLockToken FailedLockToken(string lockToken = null, Azure.ResponseError error = null) { throw null; } - public static Azure.Messaging.EventGrid.Namespaces.ReceiveDetails ReceiveDetails(Azure.Messaging.EventGrid.Namespaces.BrokerProperties brokerProperties = null, Azure.Messaging.CloudEvent @event = null) { throw null; } - public static Azure.Messaging.EventGrid.Namespaces.ReceiveResult ReceiveResult(System.Collections.Generic.IEnumerable details = null) { throw null; } - public static Azure.Messaging.EventGrid.Namespaces.RejectResult RejectResult(System.Collections.Generic.IEnumerable failedLockTokens = null, System.Collections.Generic.IEnumerable succeededLockTokens = null) { throw null; } - public static Azure.Messaging.EventGrid.Namespaces.ReleaseResult ReleaseResult(System.Collections.Generic.IEnumerable failedLockTokens = null, System.Collections.Generic.IEnumerable succeededLockTokens = null) { throw null; } - public static Azure.Messaging.EventGrid.Namespaces.RenewLocksResult RenewLocksResult(System.Collections.Generic.IEnumerable failedLockTokens = null, System.Collections.Generic.IEnumerable succeededLockTokens = null) { throw null; } - } - public partial class EventGridReceiverClient - { - protected EventGridReceiverClient() { } - public EventGridReceiverClient(System.Uri endpoint, string topicName, string subscriptionName, Azure.AzureKeyCredential credential) { } - public EventGridReceiverClient(System.Uri endpoint, string topicName, string subscriptionName, Azure.AzureKeyCredential credential, Azure.Messaging.EventGrid.Namespaces.EventGridReceiverClientOptions options) { } - public EventGridReceiverClient(System.Uri endpoint, string topicName, string subscriptionName, Azure.Core.TokenCredential credential) { } - public EventGridReceiverClient(System.Uri endpoint, string topicName, string subscriptionName, Azure.Core.TokenCredential credential, Azure.Messaging.EventGrid.Namespaces.EventGridReceiverClientOptions options) { } - public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public virtual Azure.Response Acknowledge(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response Acknowledge(System.Collections.Generic.IEnumerable lockTokens, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public virtual System.Threading.Tasks.Task AcknowledgeAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task> AcknowledgeAsync(System.Collections.Generic.IEnumerable lockTokens, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public virtual Azure.Response Receive(int? maxEvents, System.TimeSpan? maxWaitTime, Azure.RequestContext context) { throw null; } - public virtual Azure.Response Receive(int? maxEvents = default(int?), System.TimeSpan? maxWaitTime = default(System.TimeSpan?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public virtual System.Threading.Tasks.Task ReceiveAsync(int? maxEvents, System.TimeSpan? maxWaitTime, Azure.RequestContext context) { throw null; } - public virtual System.Threading.Tasks.Task> ReceiveAsync(int? maxEvents = default(int?), System.TimeSpan? maxWaitTime = default(System.TimeSpan?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public virtual Azure.Response Reject(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response Reject(System.Collections.Generic.IEnumerable lockTokens, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public virtual System.Threading.Tasks.Task RejectAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task> RejectAsync(System.Collections.Generic.IEnumerable lockTokens, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public virtual Azure.Response Release(Azure.Core.RequestContent content, string releaseDelayInSeconds = null, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response Release(System.Collections.Generic.IEnumerable lockTokens, Azure.Messaging.EventGrid.Namespaces.ReleaseDelay? delay = default(Azure.Messaging.EventGrid.Namespaces.ReleaseDelay?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public virtual System.Threading.Tasks.Task ReleaseAsync(Azure.Core.RequestContent content, string releaseDelayInSeconds = null, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task> ReleaseAsync(System.Collections.Generic.IEnumerable lockTokens, Azure.Messaging.EventGrid.Namespaces.ReleaseDelay? delay = default(Azure.Messaging.EventGrid.Namespaces.ReleaseDelay?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public virtual Azure.Response RenewLocks(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response RenewLocks(System.Collections.Generic.IEnumerable lockTokens, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public virtual System.Threading.Tasks.Task RenewLocksAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task> RenewLocksAsync(System.Collections.Generic.IEnumerable lockTokens, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - } - public partial class EventGridReceiverClientOptions : Azure.Core.ClientOptions - { - public EventGridReceiverClientOptions(Azure.Messaging.EventGrid.Namespaces.EventGridReceiverClientOptions.ServiceVersion version = Azure.Messaging.EventGrid.Namespaces.EventGridReceiverClientOptions.ServiceVersion.V2024_06_01) { } + public AzureMessagingEventGridNamespacesClientOptions(Azure.Messaging.EventGrid.Namespaces.AzureMessagingEventGridNamespacesClientOptions.ServiceVersion version = Azure.Messaging.EventGrid.Namespaces.AzureMessagingEventGridNamespacesClientOptions.ServiceVersion.V2024_06_01) { } public enum ServiceVersion { V2023_11_01 = 1, V2024_06_01 = 2, } } - public partial class EventGridSenderClient + public partial class EventGridReceiverClient { - protected EventGridSenderClient() { } - public EventGridSenderClient(System.Uri endpoint, string topicName, Azure.AzureKeyCredential credential) { } - public EventGridSenderClient(System.Uri endpoint, string topicName, Azure.AzureKeyCredential credential, Azure.Messaging.EventGrid.Namespaces.EventGridSenderClientOptions options) { } - public EventGridSenderClient(System.Uri endpoint, string topicName, Azure.Core.TokenCredential credential) { } - public EventGridSenderClient(System.Uri endpoint, string topicName, Azure.Core.TokenCredential credential, Azure.Messaging.EventGrid.Namespaces.EventGridSenderClientOptions options) { } + protected EventGridReceiverClient() { } + public EventGridReceiverClient(System.Uri endpoint, Azure.AzureKeyCredential credential) { } + public EventGridReceiverClient(System.Uri endpoint, Azure.AzureKeyCredential credential, Azure.Messaging.EventGrid.Namespaces.AzureMessagingEventGridNamespacesClientOptions options) { } + public EventGridReceiverClient(System.Uri endpoint, Azure.Core.TokenCredential credential) { } + public EventGridReceiverClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.Messaging.EventGrid.Namespaces.AzureMessagingEventGridNamespacesClientOptions options) { } public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } - public virtual Azure.Response Send(Azure.Messaging.CloudEvent cloudEvent, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Send(System.Collections.Generic.IEnumerable cloudEvents, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task SendAsync(Azure.Messaging.CloudEvent cloudEvent, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task SendAsync(System.Collections.Generic.IEnumerable cloudEvents, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public virtual Azure.Response SendEvent(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public virtual System.Threading.Tasks.Task SendEventAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public virtual Azure.Response SendEvents(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public virtual System.Threading.Tasks.Task SendEventsAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } } - public partial class EventGridSenderClientOptions : Azure.Core.ClientOptions + public partial class EventGridSenderClient { - public EventGridSenderClientOptions(Azure.Messaging.EventGrid.Namespaces.EventGridSenderClientOptions.ServiceVersion version = Azure.Messaging.EventGrid.Namespaces.EventGridSenderClientOptions.ServiceVersion.V2024_06_01) { } - public enum ServiceVersion - { - V2023_11_01 = 1, - V2024_06_01 = 2, - } + protected EventGridSenderClient() { } + public EventGridSenderClient(System.Uri endpoint, Azure.AzureKeyCredential credential) { } + public EventGridSenderClient(System.Uri endpoint, Azure.AzureKeyCredential credential, Azure.Messaging.EventGrid.Namespaces.AzureMessagingEventGridNamespacesClientOptions options) { } + public EventGridSenderClient(System.Uri endpoint, Azure.Core.TokenCredential credential) { } + public EventGridSenderClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.Messaging.EventGrid.Namespaces.AzureMessagingEventGridNamespacesClientOptions options) { } + public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } } public partial class FailedLockToken : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -122,26 +49,13 @@ internal FailedLockToken() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class ReceiveDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal ReceiveDetails() { } - public Azure.Messaging.EventGrid.Namespaces.BrokerProperties BrokerProperties { get { throw null; } } - public Azure.Messaging.CloudEvent Event { get { throw null; } } - Azure.Messaging.EventGrid.Namespaces.ReceiveDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.Namespaces.ReceiveDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class ReceiveResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public static partial class MessagingEventGridNamespacesModelFactory { - internal ReceiveResult() { } - public System.Collections.Generic.IReadOnlyList Details { get { throw null; } } - Azure.Messaging.EventGrid.Namespaces.ReceiveResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.Namespaces.ReceiveResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public static Azure.Messaging.EventGrid.Namespaces.AcknowledgeResult AcknowledgeResult(System.Collections.Generic.IEnumerable failedLockTokens = null, System.Collections.Generic.IEnumerable succeededLockTokens = null) { throw null; } + public static Azure.Messaging.EventGrid.Namespaces.FailedLockToken FailedLockToken(string lockToken = null, Azure.ResponseError error = null) { throw null; } + public static Azure.Messaging.EventGrid.Namespaces.RejectResult RejectResult(System.Collections.Generic.IEnumerable failedLockTokens = null, System.Collections.Generic.IEnumerable succeededLockTokens = null) { throw null; } + public static Azure.Messaging.EventGrid.Namespaces.ReleaseResult ReleaseResult(System.Collections.Generic.IEnumerable failedLockTokens = null, System.Collections.Generic.IEnumerable succeededLockTokens = null) { throw null; } + public static Azure.Messaging.EventGrid.Namespaces.RenewLocksResult RenewLocksResult(System.Collections.Generic.IEnumerable failedLockTokens = null, System.Collections.Generic.IEnumerable succeededLockTokens = null) { throw null; } } public partial class RejectResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -200,13 +114,13 @@ internal RenewLocksResult() { } } namespace Microsoft.Extensions.Azure { - public static partial class EventGridNamespacesClientBuilderExtensions + public static partial class MessagingEventGridNamespacesClientBuilderExtensions { - public static Azure.Core.Extensions.IAzureClientBuilder AddEventGridReceiverClient(this TBuilder builder, System.Uri endpoint, string topicName, string subscriptionName) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithCredential { throw null; } - public static Azure.Core.Extensions.IAzureClientBuilder AddEventGridReceiverClient(this TBuilder builder, System.Uri endpoint, string topicName, string subscriptionName, Azure.AzureKeyCredential credential) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilder { throw null; } - public static Azure.Core.Extensions.IAzureClientBuilder AddEventGridReceiverClient(this TBuilder builder, TConfiguration configuration) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithConfiguration { throw null; } - public static Azure.Core.Extensions.IAzureClientBuilder AddEventGridSenderClient(this TBuilder builder, System.Uri endpoint, string topicName) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithCredential { throw null; } - public static Azure.Core.Extensions.IAzureClientBuilder AddEventGridSenderClient(this TBuilder builder, System.Uri endpoint, string topicName, Azure.AzureKeyCredential credential) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilder { throw null; } - public static Azure.Core.Extensions.IAzureClientBuilder AddEventGridSenderClient(this TBuilder builder, TConfiguration configuration) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithConfiguration { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddEventGridReceiverClient(this TBuilder builder, System.Uri endpoint) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithCredential { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddEventGridReceiverClient(this TBuilder builder, System.Uri endpoint, Azure.AzureKeyCredential credential) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilder { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddEventGridReceiverClient(this TBuilder builder, TConfiguration configuration) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithConfiguration { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddEventGridSenderClient(this TBuilder builder, System.Uri endpoint) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithCredential { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddEventGridSenderClient(this TBuilder builder, System.Uri endpoint, Azure.AzureKeyCredential credential) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilder { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddEventGridSenderClient(this TBuilder builder, TConfiguration configuration) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithConfiguration { throw null; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/api/Azure.Messaging.EventGrid.SystemEvents.netstandard2.0.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/api/Azure.Messaging.EventGrid.SystemEvents.netstandard2.0.cs index 307cbc84ebe2..3fce0537cb4c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/api/Azure.Messaging.EventGrid.SystemEvents.netstandard2.0.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/api/Azure.Messaging.EventGrid.SystemEvents.netstandard2.0.cs @@ -33,7 +33,7 @@ internal AcsChatEventInThreadBaseProperties() { } public partial class AcsChatMessageDeletedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventBaseProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsChatMessageDeletedEventData() { } - public System.DateTimeOffset DeleteTime { get { throw null; } } + public System.DateTimeOffset? DeleteTime { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -43,7 +43,7 @@ internal AcsChatMessageDeletedEventData() { } public partial class AcsChatMessageDeletedInThreadEventData : Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventInThreadBaseProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsChatMessageDeletedInThreadEventData() { } - public System.DateTimeOffset DeleteTime { get { throw null; } } + public System.DateTimeOffset? DeleteTime { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageDeletedInThreadEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageDeletedInThreadEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -53,7 +53,7 @@ internal AcsChatMessageDeletedInThreadEventData() { } public partial class AcsChatMessageEditedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventBaseProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsChatMessageEditedEventData() { } - public System.DateTimeOffset EditTime { get { throw null; } } + public System.DateTimeOffset? EditTime { get { throw null; } } public string MessageBody { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Metadata { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEditedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -65,7 +65,7 @@ internal AcsChatMessageEditedEventData() { } public partial class AcsChatMessageEditedInThreadEventData : Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventInThreadBaseProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsChatMessageEditedInThreadEventData() { } - public System.DateTimeOffset EditTime { get { throw null; } } + public System.DateTimeOffset? EditTime { get { throw null; } } public string MessageBody { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Metadata { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEditedInThreadEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -77,7 +77,7 @@ internal AcsChatMessageEditedInThreadEventData() { } public partial class AcsChatMessageEventBaseProperties : Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsChatMessageEventBaseProperties() { } - public System.DateTimeOffset ComposeTime { get { throw null; } } + public System.DateTimeOffset? ComposeTime { get { throw null; } } public string MessageId { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel SenderCommunicationIdentifier { get { throw null; } } public string SenderDisplayName { get { throw null; } } @@ -92,7 +92,7 @@ internal AcsChatMessageEventBaseProperties() { } public partial class AcsChatMessageEventInThreadBaseProperties : Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsChatMessageEventInThreadBaseProperties() { } - public System.DateTimeOffset ComposeTime { get { throw null; } } + public System.DateTimeOffset? ComposeTime { get { throw null; } } public string MessageId { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel SenderCommunicationIdentifier { get { throw null; } } public string SenderDisplayName { get { throw null; } } @@ -131,7 +131,7 @@ public partial class AcsChatParticipantAddedToThreadEventData : Azure.Messaging. internal AcsChatParticipantAddedToThreadEventData() { } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel AddedByCommunicationIdentifier { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties ParticipantAdded { get { throw null; } } - public System.DateTimeOffset Time { get { throw null; } } + public System.DateTimeOffset? Time { get { throw null; } } public long? Version { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantAddedToThreadEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -144,7 +144,7 @@ public partial class AcsChatParticipantAddedToThreadWithUserEventData : Azure.Me internal AcsChatParticipantAddedToThreadWithUserEventData() { } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel AddedByCommunicationIdentifier { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties ParticipantAdded { get { throw null; } } - public System.DateTimeOffset Time { get { throw null; } } + public System.DateTimeOffset? Time { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantAddedToThreadWithUserEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantAddedToThreadWithUserEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -156,7 +156,7 @@ public partial class AcsChatParticipantRemovedFromThreadEventData : Azure.Messag internal AcsChatParticipantRemovedFromThreadEventData() { } public Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties ParticipantRemoved { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel RemovedByCommunicationIdentifier { get { throw null; } } - public System.DateTimeOffset Time { get { throw null; } } + public System.DateTimeOffset? Time { get { throw null; } } public long? Version { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantRemovedFromThreadEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -169,7 +169,7 @@ public partial class AcsChatParticipantRemovedFromThreadWithUserEventData : Azur internal AcsChatParticipantRemovedFromThreadWithUserEventData() { } public Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties ParticipantRemoved { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel RemovedByCommunicationIdentifier { get { throw null; } } - public System.DateTimeOffset Time { get { throw null; } } + public System.DateTimeOffset? Time { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantRemovedFromThreadWithUserEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantRemovedFromThreadWithUserEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -206,7 +206,7 @@ public partial class AcsChatThreadDeletedEventData : Azure.Messaging.EventGrid.S { internal AcsChatThreadDeletedEventData() { } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel DeletedByCommunicationIdentifier { get { throw null; } } - public System.DateTimeOffset DeleteTime { get { throw null; } } + public System.DateTimeOffset? DeleteTime { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -216,7 +216,7 @@ internal AcsChatThreadDeletedEventData() { } public partial class AcsChatThreadEventBaseProperties : Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsChatThreadEventBaseProperties() { } - public System.DateTimeOffset CreateTime { get { throw null; } } + public System.DateTimeOffset? CreateTime { get { throw null; } } public long? Version { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadEventBaseProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -227,7 +227,7 @@ internal AcsChatThreadEventBaseProperties() { } public partial class AcsChatThreadEventInThreadBaseProperties : Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsChatThreadEventInThreadBaseProperties() { } - public System.DateTimeOffset CreateTime { get { throw null; } } + public System.DateTimeOffset? CreateTime { get { throw null; } } public long? Version { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadEventInThreadBaseProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -251,7 +251,7 @@ public partial class AcsChatThreadPropertiesUpdatedEventData : Azure.Messaging.E { internal AcsChatThreadPropertiesUpdatedEventData() { } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel EditedByCommunicationIdentifier { get { throw null; } } - public System.DateTimeOffset EditTime { get { throw null; } } + public System.DateTimeOffset? EditTime { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Metadata { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Properties { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadPropertiesUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -264,7 +264,7 @@ public partial class AcsChatThreadPropertiesUpdatedPerUserEventData : Azure.Mess { internal AcsChatThreadPropertiesUpdatedPerUserEventData() { } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel EditedByCommunicationIdentifier { get { throw null; } } - public System.DateTimeOffset EditTime { get { throw null; } } + public System.DateTimeOffset? EditTime { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Metadata { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Properties { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadPropertiesUpdatedPerUserEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -277,7 +277,7 @@ public partial class AcsChatThreadWithUserDeletedEventData : Azure.Messaging.Eve { internal AcsChatThreadWithUserDeletedEventData() { } public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel DeletedByCommunicationIdentifier { get { throw null; } } - public System.DateTimeOffset DeleteTime { get { throw null; } } + public System.DateTimeOffset? DeleteTime { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadWithUserDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadWithUserDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -287,12 +287,12 @@ internal AcsChatThreadWithUserDeletedEventData() { } public partial class AcsEmailDeliveryReportReceivedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsEmailDeliveryReportReceivedEventData() { } - public System.DateTimeOffset DeliveryAttemptTimestamp { get { throw null; } } + public System.DateTimeOffset? DeliveryAttemptTimestamp { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatusDetails DeliveryStatusDetails { get { throw null; } } public string MessageId { get { throw null; } } public string Recipient { get { throw null; } } public string Sender { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatus Status { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatus? Status { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportReceivedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportReceivedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -334,12 +334,12 @@ internal AcsEmailDeliveryReportStatusDetails() { } public partial class AcsEmailEngagementTrackingReportReceivedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsEmailEngagementTrackingReportReceivedEventData() { } - public Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement Engagement { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement? Engagement { get { throw null; } } public string EngagementContext { get { throw null; } } public string MessageId { get { throw null; } } public string Recipient { get { throw null; } } public string Sender { get { throw null; } } - public System.DateTimeOffset UserActionTimestamp { get { throw null; } } + public System.DateTimeOffset? UserActionTimestamp { get { throw null; } } public string UserAgent { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsEmailEngagementTrackingReportReceivedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -468,9 +468,9 @@ internal AcsMessageContext() { } public partial class AcsMessageDeliveryStatusUpdatedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsMessageEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsMessageDeliveryStatusUpdatedEventData() { } - public Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind ChannelKind { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind? ChannelKind { get { throw null; } } public string MessageId { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatus Status { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatus? Status { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatusUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatusUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -482,7 +482,7 @@ public partial class AcsMessageEventData : System.ClientModel.Primitives.IJsonMo internal AcsMessageEventData() { } public Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelEventError Error { get { throw null; } } public string From { get { throw null; } } - public System.DateTimeOffset ReceivedTimestamp { get { throw null; } } + public System.DateTimeOffset? ReceivedTimestamp { get { throw null; } } public string To { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsMessageEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -506,7 +506,7 @@ public partial class AcsMessageInteractiveContent : System.ClientModel.Primitive internal AcsMessageInteractiveContent() { } public Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveButtonReplyContent ButtonReply { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveListReplyContent ListReply { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.AcsInteractiveReplyKind ReplyKind { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.AcsInteractiveReplyKind? ReplyKind { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -571,11 +571,11 @@ internal AcsRecordingChunkInfoProperties() { } public partial class AcsRecordingFileStatusUpdatedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsRecordingFileStatusUpdatedEventData() { } - public Azure.Messaging.EventGrid.SystemEvents.RecordingChannelType RecordingChannelKind { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.RecordingContentType RecordingContentType { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.RecordingChannelType? RecordingChannelKind { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.RecordingContentType? RecordingContentType { get { throw null; } } public long? RecordingDurationMs { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.RecordingFormatType RecordingFormatType { get { throw null; } } - public System.DateTimeOffset RecordingStartTime { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.RecordingFormatType? RecordingFormatType { get { throw null; } } + public System.DateTimeOffset? RecordingStartTime { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.AcsRecordingStorageInfoProperties RecordingStorageInfo { get { throw null; } } public string SessionEndReason { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsRecordingFileStatusUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -738,10 +738,10 @@ public partial class AcsRouterJobReceivedEventData : Azure.Messaging.EventGrid.S { internal AcsRouterJobReceivedEventData() { } public string ClassificationPolicyId { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobStatus JobStatus { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobStatus? JobStatus { get { throw null; } } public int? Priority { get { throw null; } } public System.Collections.Generic.IReadOnlyList RequestedWorkerSelectors { get { throw null; } } - public System.DateTimeOffset ScheduledOn { get { throw null; } } + public System.DateTimeOffset? ScheduledOn { get { throw null; } } public bool UnavailableForMatching { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobReceivedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -756,7 +756,7 @@ internal AcsRouterJobSchedulingFailedEventData() { } public System.Collections.Generic.IReadOnlyList ExpiredRequestedWorkerSelectors { get { throw null; } } public string FailureReason { get { throw null; } } public int? Priority { get { throw null; } } - public System.DateTimeOffset ScheduledOn { get { throw null; } } + public System.DateTimeOffset? ScheduledOn { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobSchedulingFailedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobSchedulingFailedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -808,7 +808,7 @@ internal AcsRouterJobWaitingForActivationEventData() { } public System.Collections.Generic.IReadOnlyList ExpiredAttachedWorkerSelectors { get { throw null; } } public System.Collections.Generic.IReadOnlyList ExpiredRequestedWorkerSelectors { get { throw null; } } public int? Priority { get { throw null; } } - public System.DateTimeOffset ScheduledOn { get { throw null; } } + public System.DateTimeOffset? ScheduledOn { get { throw null; } } public bool UnavailableForMatching { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobWaitingForActivationEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -954,11 +954,11 @@ internal AcsRouterWorkerOfferExpiredEventData() { } public partial class AcsRouterWorkerOfferIssuedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsRouterWorkerOfferIssuedEventData() { } - public System.DateTimeOffset ExpiresOn { get { throw null; } } + public System.DateTimeOffset? ExpiresOn { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary JobLabels { get { throw null; } } public int? JobPriority { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary JobTags { get { throw null; } } - public System.DateTimeOffset OfferedOn { get { throw null; } } + public System.DateTimeOffset? OfferedOn { get { throw null; } } public string OfferId { get { throw null; } } public string QueueId { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary WorkerLabels { get { throw null; } } @@ -998,11 +998,11 @@ internal AcsRouterWorkerRegisteredEventData() { } public partial class AcsRouterWorkerSelector : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AcsRouterWorkerSelector() { } - public System.DateTimeOffset ExpirationTime { get { throw null; } } + public System.DateTimeOffset? ExpirationTime { get { throw null; } } public string Key { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.AcsRouterLabelOperator LabelOperator { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.AcsRouterLabelOperator? LabelOperator { get { throw null; } } public System.BinaryData LabelValue { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelectorState SelectorState { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelectorState? SelectorState { get { throw null; } } public double TimeToLive { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelector System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -1049,7 +1049,7 @@ public partial class AcsSmsDeliveryAttemptProperties : System.ClientModel.Primit internal AcsSmsDeliveryAttemptProperties() { } public int? SegmentsFailed { get { throw null; } } public int? SegmentsSucceeded { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsSmsDeliveryAttemptProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsSmsDeliveryAttemptProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1062,7 +1062,7 @@ internal AcsSmsDeliveryReportReceivedEventData() { } public System.Collections.Generic.IReadOnlyList DeliveryAttempts { get { throw null; } } public string DeliveryStatus { get { throw null; } } public string DeliveryStatusDetails { get { throw null; } } - public System.DateTimeOffset ReceivedTimestamp { get { throw null; } } + public System.DateTimeOffset? ReceivedTimestamp { get { throw null; } } public string Tag { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsSmsDeliveryReportReceivedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -1086,7 +1086,7 @@ public partial class AcsSmsReceivedEventData : Azure.Messaging.EventGrid.SystemE { internal AcsSmsReceivedEventData() { } public string Message { get { throw null; } } - public System.DateTimeOffset ReceivedTimestamp { get { throw null; } } + public System.DateTimeOffset? ReceivedTimestamp { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AcsSmsReceivedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AcsSmsReceivedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1497,7 +1497,7 @@ internal AppConfigurationSnapshotModifiedEventData() { } public partial class AppEventTypeDetail : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AppEventTypeDetail() { } - public Azure.Messaging.EventGrid.SystemEvents.AppAction Action { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.AppAction? Action { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AppEventTypeDetail System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AppEventTypeDetail System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1524,9 +1524,9 @@ internal AppEventTypeDetail() { } public partial class AppServicePlanEventTypeDetail : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AppServicePlanEventTypeDetail() { } - public Azure.Messaging.EventGrid.SystemEvents.AppServicePlanAction Action { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.StampKind StampKind { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.AsyncStatus Status { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.AppServicePlanAction? Action { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.StampKind? StampKind { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.AsyncStatus? Status { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.AppServicePlanEventTypeDetail System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.AppServicePlanEventTypeDetail System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1722,7 +1722,7 @@ public partial class CommunicationIdentifierModel : System.ClientModel.Primitive { internal CommunicationIdentifierModel() { } public Azure.Messaging.EventGrid.SystemEvents.CommunicationUserIdentifierModel CommunicationUser { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModelKind Kind { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModelKind? Kind { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsAppIdentifierModel MicrosoftTeamsApp { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsUserIdentifierModel MicrosoftTeamsUser { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.PhoneNumberIdentifierModel PhoneNumber { get { throw null; } } @@ -1771,7 +1771,7 @@ internal ContainerRegistryArtifactEventData() { } public string Id { get { throw null; } } public string Location { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget Target { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1843,7 +1843,7 @@ internal ContainerRegistryEventData() { } public Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventRequest Request { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventSource Source { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventTarget Target { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1991,8 +1991,8 @@ public partial class DataBoxCopyCompletedEventData : System.ClientModel.Primitiv { internal DataBoxCopyCompletedEventData() { } public string SerialNumber { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName StageName { get { throw null; } } - public System.DateTimeOffset StageTime { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName? StageName { get { throw null; } } + public System.DateTimeOffset? StageTime { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.DataBoxCopyCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.DataBoxCopyCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2003,8 +2003,8 @@ public partial class DataBoxCopyStartedEventData : System.ClientModel.Primitives { internal DataBoxCopyStartedEventData() { } public string SerialNumber { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName StageName { get { throw null; } } - public System.DateTimeOffset StageTime { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName? StageName { get { throw null; } } + public System.DateTimeOffset? StageTime { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.DataBoxCopyStartedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.DataBoxCopyStartedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2015,8 +2015,8 @@ public partial class DataBoxOrderCompletedEventData : System.ClientModel.Primiti { internal DataBoxOrderCompletedEventData() { } public string SerialNumber { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName StageName { get { throw null; } } - public System.DateTimeOffset StageTime { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName? StageName { get { throw null; } } + public System.DateTimeOffset? StageTime { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.DataBoxOrderCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.DataBoxOrderCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2152,150 +2152,150 @@ internal DeviceTwinProperties() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class EventGridMQTTClientCreatedOrUpdatedEventData : Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class EventGridMqttClientCreatedOrUpdatedEventData : Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal EventGridMQTTClientCreatedOrUpdatedEventData() { } + internal EventGridMqttClientCreatedOrUpdatedEventData() { } public System.Collections.Generic.IReadOnlyDictionary Attributes { get { throw null; } } - public System.DateTimeOffset CreatedOn { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientState State { get { throw null; } } - public System.DateTimeOffset UpdatedOn { get { throw null; } } - Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientCreatedOrUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientCreatedOrUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class EventGridMQTTClientDeletedEventData : Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal EventGridMQTTClientDeletedEventData() { } - Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState? State { get { throw null; } } + public System.DateTimeOffset? UpdatedOn { get { throw null; } } + Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientCreatedOrUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientCreatedOrUpdatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EventGridMqttClientDeletedEventData : Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal EventGridMqttClientDeletedEventData() { } + Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct EventGridMQTTClientDisconnectionReason : System.IEquatable + public readonly partial struct EventGridMqttClientDisconnectionReason : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; - public EventGridMQTTClientDisconnectionReason(string value) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason ClientAuthenticationError { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason ClientAuthorizationError { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason ClientError { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason ClientInitiatedDisconnect { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason ConnectionLost { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason IpForbidden { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason QuotaExceeded { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason ServerError { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason ServerInitiatedDisconnect { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason SessionOverflow { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason SessionTakenOver { get { throw null; } } - public bool Equals(Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason other) { throw null; } + public EventGridMqttClientDisconnectionReason(string value) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason ClientAuthenticationError { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason ClientAuthorizationError { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason ClientError { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason ClientInitiatedDisconnect { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason ConnectionLost { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason IpForbidden { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason QuotaExceeded { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason ServerError { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason ServerInitiatedDisconnect { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason SessionOverflow { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason SessionTakenOver { get { throw null; } } + public bool Equals(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason left, Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason right) { throw null; } - public static implicit operator Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason (string value) { throw null; } - public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason left, Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason right) { throw null; } + public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason left, Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason right) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason (string value) { throw null; } + public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason left, Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason right) { throw null; } public override string ToString() { throw null; } } - public partial class EventGridMQTTClientEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class EventGridMqttClientEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal EventGridMQTTClientEventData() { } + internal EventGridMqttClientEventData() { } public string ClientAuthenticationName { get { throw null; } } public string ClientName { get { throw null; } } public string NamespaceName { get { throw null; } } - Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class EventGridMQTTClientSessionConnectedEventData : Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class EventGridMqttClientSessionConnectedEventData : Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal EventGridMQTTClientSessionConnectedEventData() { } + internal EventGridMqttClientSessionConnectedEventData() { } public string ClientSessionName { get { throw null; } } public long? SequenceNumber { get { throw null; } } - Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientSessionConnectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientSessionConnectedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientSessionConnectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientSessionConnectedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class EventGridMQTTClientSessionDisconnectedEventData : Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class EventGridMqttClientSessionDisconnectedEventData : Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal EventGridMQTTClientSessionDisconnectedEventData() { } + internal EventGridMqttClientSessionDisconnectedEventData() { } public string ClientSessionName { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason DisconnectionReason { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason? DisconnectionReason { get { throw null; } } public long? SequenceNumber { get { throw null; } } - Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientSessionDisconnectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientSessionDisconnectedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientSessionDisconnectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientSessionDisconnectedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct EventGridMQTTClientState : System.IEquatable + public readonly partial struct EventGridMqttClientState : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; - public EventGridMQTTClientState(string value) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientState Disabled { get { throw null; } } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientState Enabled { get { throw null; } } - public bool Equals(Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientState other) { throw null; } + public EventGridMqttClientState(string value) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState Disabled { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState Enabled { get { throw null; } } + public bool Equals(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientState left, Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientState right) { throw null; } - public static implicit operator Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientState (string value) { throw null; } - public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientState left, Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientState right) { throw null; } + public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState left, Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState right) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState (string value) { throw null; } + public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState left, Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState right) { throw null; } public override string ToString() { throw null; } } public static partial class EventGridSystemEventsModelFactory { public static Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties AcsChatEventBaseProperties(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties AcsChatEventInThreadBaseProperties(string transactionId = null, string threadId = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageDeletedEventData AcsChatMessageDeletedEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset composeTime = default(System.DateTimeOffset), string type = null, long? version = default(long?), System.DateTimeOffset deleteTime = default(System.DateTimeOffset)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageDeletedInThreadEventData AcsChatMessageDeletedInThreadEventData(string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset composeTime = default(System.DateTimeOffset), string type = null, long? version = default(long?), System.DateTimeOffset deleteTime = default(System.DateTimeOffset)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEditedEventData AcsChatMessageEditedEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset composeTime = default(System.DateTimeOffset), string type = null, long? version = default(long?), string messageBody = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.DateTimeOffset editTime = default(System.DateTimeOffset)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEditedInThreadEventData AcsChatMessageEditedInThreadEventData(string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset composeTime = default(System.DateTimeOffset), string type = null, long? version = default(long?), string messageBody = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.DateTimeOffset editTime = default(System.DateTimeOffset)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventBaseProperties AcsChatMessageEventBaseProperties(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset composeTime = default(System.DateTimeOffset), string type = null, long? version = default(long?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventInThreadBaseProperties AcsChatMessageEventInThreadBaseProperties(string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset composeTime = default(System.DateTimeOffset), string type = null, long? version = default(long?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageReceivedEventData AcsChatMessageReceivedEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset composeTime = default(System.DateTimeOffset), string type = null, long? version = default(long?), string messageBody = null, System.Collections.Generic.IReadOnlyDictionary metadata = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageReceivedInThreadEventData AcsChatMessageReceivedInThreadEventData(string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset composeTime = default(System.DateTimeOffset), string type = null, long? version = default(long?), string messageBody = null, System.Collections.Generic.IReadOnlyDictionary metadata = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantAddedToThreadEventData AcsChatParticipantAddedToThreadEventData(string transactionId = null, string threadId = null, System.DateTimeOffset time = default(System.DateTimeOffset), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel addedByCommunicationIdentifier = null, Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties participantAdded = null, long? version = default(long?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantAddedToThreadWithUserEventData AcsChatParticipantAddedToThreadWithUserEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset createTime = default(System.DateTimeOffset), long? version = default(long?), System.DateTimeOffset time = default(System.DateTimeOffset), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel addedByCommunicationIdentifier = null, Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties participantAdded = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantRemovedFromThreadEventData AcsChatParticipantRemovedFromThreadEventData(string transactionId = null, string threadId = null, System.DateTimeOffset time = default(System.DateTimeOffset), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel removedByCommunicationIdentifier = null, Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties participantRemoved = null, long? version = default(long?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantRemovedFromThreadWithUserEventData AcsChatParticipantRemovedFromThreadWithUserEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset createTime = default(System.DateTimeOffset), long? version = default(long?), System.DateTimeOffset time = default(System.DateTimeOffset), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel removedByCommunicationIdentifier = null, Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties participantRemoved = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadCreatedEventData AcsChatThreadCreatedEventData(string transactionId = null, string threadId = null, System.DateTimeOffset createTime = default(System.DateTimeOffset), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel createdByCommunicationIdentifier = null, System.Collections.Generic.IReadOnlyDictionary properties = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Collections.Generic.IEnumerable participants = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadCreatedWithUserEventData AcsChatThreadCreatedWithUserEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset createTime = default(System.DateTimeOffset), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel createdByCommunicationIdentifier = null, System.Collections.Generic.IReadOnlyDictionary properties = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Collections.Generic.IEnumerable participants = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadDeletedEventData AcsChatThreadDeletedEventData(string transactionId = null, string threadId = null, System.DateTimeOffset createTime = default(System.DateTimeOffset), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel deletedByCommunicationIdentifier = null, System.DateTimeOffset deleteTime = default(System.DateTimeOffset)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadEventBaseProperties AcsChatThreadEventBaseProperties(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset createTime = default(System.DateTimeOffset), long? version = default(long?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadEventInThreadBaseProperties AcsChatThreadEventInThreadBaseProperties(string transactionId = null, string threadId = null, System.DateTimeOffset createTime = default(System.DateTimeOffset), long? version = default(long?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageDeletedEventData AcsChatMessageDeletedEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset? composeTime = default(System.DateTimeOffset?), string type = null, long? version = default(long?), System.DateTimeOffset? deleteTime = default(System.DateTimeOffset?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageDeletedInThreadEventData AcsChatMessageDeletedInThreadEventData(string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset? composeTime = default(System.DateTimeOffset?), string type = null, long? version = default(long?), System.DateTimeOffset? deleteTime = default(System.DateTimeOffset?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEditedEventData AcsChatMessageEditedEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset? composeTime = default(System.DateTimeOffset?), string type = null, long? version = default(long?), string messageBody = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.DateTimeOffset? editTime = default(System.DateTimeOffset?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEditedInThreadEventData AcsChatMessageEditedInThreadEventData(string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset? composeTime = default(System.DateTimeOffset?), string type = null, long? version = default(long?), string messageBody = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.DateTimeOffset? editTime = default(System.DateTimeOffset?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventBaseProperties AcsChatMessageEventBaseProperties(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset? composeTime = default(System.DateTimeOffset?), string type = null, long? version = default(long?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventInThreadBaseProperties AcsChatMessageEventInThreadBaseProperties(string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset? composeTime = default(System.DateTimeOffset?), string type = null, long? version = default(long?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageReceivedEventData AcsChatMessageReceivedEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset? composeTime = default(System.DateTimeOffset?), string type = null, long? version = default(long?), string messageBody = null, System.Collections.Generic.IReadOnlyDictionary metadata = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageReceivedInThreadEventData AcsChatMessageReceivedInThreadEventData(string transactionId = null, string threadId = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, System.DateTimeOffset? composeTime = default(System.DateTimeOffset?), string type = null, long? version = default(long?), string messageBody = null, System.Collections.Generic.IReadOnlyDictionary metadata = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantAddedToThreadEventData AcsChatParticipantAddedToThreadEventData(string transactionId = null, string threadId = null, System.DateTimeOffset? time = default(System.DateTimeOffset?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel addedByCommunicationIdentifier = null, Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties participantAdded = null, long? version = default(long?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantAddedToThreadWithUserEventData AcsChatParticipantAddedToThreadWithUserEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset? createTime = default(System.DateTimeOffset?), long? version = default(long?), System.DateTimeOffset? time = default(System.DateTimeOffset?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel addedByCommunicationIdentifier = null, Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties participantAdded = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantRemovedFromThreadEventData AcsChatParticipantRemovedFromThreadEventData(string transactionId = null, string threadId = null, System.DateTimeOffset? time = default(System.DateTimeOffset?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel removedByCommunicationIdentifier = null, Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties participantRemoved = null, long? version = default(long?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatParticipantRemovedFromThreadWithUserEventData AcsChatParticipantRemovedFromThreadWithUserEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset? createTime = default(System.DateTimeOffset?), long? version = default(long?), System.DateTimeOffset? time = default(System.DateTimeOffset?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel removedByCommunicationIdentifier = null, Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties participantRemoved = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadCreatedEventData AcsChatThreadCreatedEventData(string transactionId = null, string threadId = null, System.DateTimeOffset? createTime = default(System.DateTimeOffset?), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel createdByCommunicationIdentifier = null, System.Collections.Generic.IReadOnlyDictionary properties = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Collections.Generic.IEnumerable participants = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadCreatedWithUserEventData AcsChatThreadCreatedWithUserEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset? createTime = default(System.DateTimeOffset?), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel createdByCommunicationIdentifier = null, System.Collections.Generic.IReadOnlyDictionary properties = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Collections.Generic.IEnumerable participants = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadDeletedEventData AcsChatThreadDeletedEventData(string transactionId = null, string threadId = null, System.DateTimeOffset? createTime = default(System.DateTimeOffset?), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel deletedByCommunicationIdentifier = null, System.DateTimeOffset? deleteTime = default(System.DateTimeOffset?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadEventBaseProperties AcsChatThreadEventBaseProperties(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset? createTime = default(System.DateTimeOffset?), long? version = default(long?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadEventInThreadBaseProperties AcsChatThreadEventInThreadBaseProperties(string transactionId = null, string threadId = null, System.DateTimeOffset? createTime = default(System.DateTimeOffset?), long? version = default(long?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties AcsChatThreadParticipantProperties(string displayName = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel participantCommunicationIdentifier = null, System.Collections.Generic.IReadOnlyDictionary metadata = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadPropertiesUpdatedEventData AcsChatThreadPropertiesUpdatedEventData(string transactionId = null, string threadId = null, System.DateTimeOffset createTime = default(System.DateTimeOffset), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel editedByCommunicationIdentifier = null, System.DateTimeOffset editTime = default(System.DateTimeOffset), System.Collections.Generic.IReadOnlyDictionary properties = null, System.Collections.Generic.IReadOnlyDictionary metadata = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadPropertiesUpdatedPerUserEventData AcsChatThreadPropertiesUpdatedPerUserEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset createTime = default(System.DateTimeOffset), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel editedByCommunicationIdentifier = null, System.DateTimeOffset editTime = default(System.DateTimeOffset), System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Collections.Generic.IReadOnlyDictionary properties = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadWithUserDeletedEventData AcsChatThreadWithUserDeletedEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset createTime = default(System.DateTimeOffset), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel deletedByCommunicationIdentifier = null, System.DateTimeOffset deleteTime = default(System.DateTimeOffset)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportReceivedEventData AcsEmailDeliveryReportReceivedEventData(string sender = null, string recipient = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatus status = default(Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatus), Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatusDetails deliveryStatusDetails = null, System.DateTimeOffset deliveryAttemptTimestamp = default(System.DateTimeOffset)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadPropertiesUpdatedEventData AcsChatThreadPropertiesUpdatedEventData(string transactionId = null, string threadId = null, System.DateTimeOffset? createTime = default(System.DateTimeOffset?), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel editedByCommunicationIdentifier = null, System.DateTimeOffset? editTime = default(System.DateTimeOffset?), System.Collections.Generic.IReadOnlyDictionary properties = null, System.Collections.Generic.IReadOnlyDictionary metadata = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadPropertiesUpdatedPerUserEventData AcsChatThreadPropertiesUpdatedPerUserEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset? createTime = default(System.DateTimeOffset?), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel editedByCommunicationIdentifier = null, System.DateTimeOffset? editTime = default(System.DateTimeOffset?), System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Collections.Generic.IReadOnlyDictionary properties = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadWithUserDeletedEventData AcsChatThreadWithUserDeletedEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, System.DateTimeOffset? createTime = default(System.DateTimeOffset?), long? version = default(long?), Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel deletedByCommunicationIdentifier = null, System.DateTimeOffset? deleteTime = default(System.DateTimeOffset?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportReceivedEventData AcsEmailDeliveryReportReceivedEventData(string sender = null, string recipient = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatus? status = default(Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatus?), Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatusDetails deliveryStatusDetails = null, System.DateTimeOffset? deliveryAttemptTimestamp = default(System.DateTimeOffset?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsEmailDeliveryReportStatusDetails AcsEmailDeliveryReportStatusDetails(string statusMessage = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsEmailEngagementTrackingReportReceivedEventData AcsEmailEngagementTrackingReportReceivedEventData(string sender = null, string recipient = null, string messageId = null, System.DateTimeOffset userActionTimestamp = default(System.DateTimeOffset), string engagementContext = null, string userAgent = null, Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement engagement = default(Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsEmailEngagementTrackingReportReceivedEventData AcsEmailEngagementTrackingReportReceivedEventData(string sender = null, string recipient = null, string messageId = null, System.DateTimeOffset? userActionTimestamp = default(System.DateTimeOffset?), string engagementContext = null, string userAgent = null, Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement? engagement = default(Azure.Messaging.EventGrid.SystemEvents.AcsUserEngagement?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsIncomingCallCustomContext AcsIncomingCallCustomContext(System.Collections.Generic.IReadOnlyDictionary sipHeaders = null, System.Collections.Generic.IReadOnlyDictionary voipHeaders = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsIncomingCallEventData AcsIncomingCallEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel toCommunicationIdentifier = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel fromCommunicationIdentifier = null, string serverCallId = null, string callerDisplayName = null, Azure.Messaging.EventGrid.SystemEvents.AcsIncomingCallCustomContext customContext = null, string incomingCallContext = null, string correlationId = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageButtonContent AcsMessageButtonContent(string text = null, string payload = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelEventError AcsMessageChannelEventError(string channelCode = null, string channelMessage = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageContext AcsMessageContext(string from = null, string messageId = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatusUpdatedEventData AcsMessageDeliveryStatusUpdatedEventData(string from = null, string to = null, System.DateTimeOffset receivedTimestamp = default(System.DateTimeOffset), Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelEventError error = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatus status = default(Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatus), Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind channelKind = default(Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageEventData AcsMessageEventData(string from = null, string to = null, System.DateTimeOffset receivedTimestamp = default(System.DateTimeOffset), Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelEventError error = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatusUpdatedEventData AcsMessageDeliveryStatusUpdatedEventData(string from = null, string to = null, System.DateTimeOffset? receivedTimestamp = default(System.DateTimeOffset?), Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelEventError error = null, string messageId = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatus? status = default(Azure.Messaging.EventGrid.SystemEvents.AcsMessageDeliveryStatus?), Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind? channelKind = default(Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageEventData AcsMessageEventData(string from = null, string to = null, System.DateTimeOffset? receivedTimestamp = default(System.DateTimeOffset?), Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelEventError error = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveButtonReplyContent AcsMessageInteractiveButtonReplyContent(string buttonId = null, string title = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveContent AcsMessageInteractiveContent(Azure.Messaging.EventGrid.SystemEvents.AcsInteractiveReplyKind replyKind = default(Azure.Messaging.EventGrid.SystemEvents.AcsInteractiveReplyKind), Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveButtonReplyContent buttonReply = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveListReplyContent listReply = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveContent AcsMessageInteractiveContent(Azure.Messaging.EventGrid.SystemEvents.AcsInteractiveReplyKind? replyKind = default(Azure.Messaging.EventGrid.SystemEvents.AcsInteractiveReplyKind?), Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveButtonReplyContent buttonReply = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveListReplyContent listReply = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveListReplyContent AcsMessageInteractiveListReplyContent(string listItemId = null, string title = null, string description = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageMediaContent AcsMessageMediaContent(string mimeType = null, string mediaId = null, string fileName = null, string caption = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageReceivedEventData AcsMessageReceivedEventData(string from = null, string to = null, System.DateTimeOffset receivedTimestamp = default(System.DateTimeOffset), Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelEventError error = null, string content = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind channelKind = default(Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind), Azure.Messaging.EventGrid.SystemEvents.AcsMessageMediaContent mediaContent = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageContext context = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageButtonContent button = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveContent interactiveContent = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsMessageReceivedEventData AcsMessageReceivedEventData(string from = null, string to = null, System.DateTimeOffset? receivedTimestamp = default(System.DateTimeOffset?), Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelEventError error = null, string content = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind channelKind = default(Azure.Messaging.EventGrid.SystemEvents.AcsMessageChannelKind), Azure.Messaging.EventGrid.SystemEvents.AcsMessageMediaContent mediaContent = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageContext context = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageButtonContent button = null, Azure.Messaging.EventGrid.SystemEvents.AcsMessageInteractiveContent interactiveContent = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRecordingChunkInfoProperties AcsRecordingChunkInfoProperties(string documentId = null, long? index = default(long?), string endReason = null, string metadataLocation = null, string contentLocation = null, string deleteLocation = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsRecordingFileStatusUpdatedEventData AcsRecordingFileStatusUpdatedEventData(Azure.Messaging.EventGrid.SystemEvents.AcsRecordingStorageInfoProperties recordingStorageInfo = null, System.DateTimeOffset recordingStartTime = default(System.DateTimeOffset), long? recordingDurationMs = default(long?), Azure.Messaging.EventGrid.SystemEvents.RecordingContentType recordingContentType = default(Azure.Messaging.EventGrid.SystemEvents.RecordingContentType), Azure.Messaging.EventGrid.SystemEvents.RecordingChannelType recordingChannelKind = default(Azure.Messaging.EventGrid.SystemEvents.RecordingChannelType), Azure.Messaging.EventGrid.SystemEvents.RecordingFormatType recordingFormatType = default(Azure.Messaging.EventGrid.SystemEvents.RecordingFormatType), string sessionEndReason = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRecordingFileStatusUpdatedEventData AcsRecordingFileStatusUpdatedEventData(Azure.Messaging.EventGrid.SystemEvents.AcsRecordingStorageInfoProperties recordingStorageInfo = null, System.DateTimeOffset? recordingStartTime = default(System.DateTimeOffset?), long? recordingDurationMs = default(long?), Azure.Messaging.EventGrid.SystemEvents.RecordingContentType? recordingContentType = default(Azure.Messaging.EventGrid.SystemEvents.RecordingContentType?), Azure.Messaging.EventGrid.SystemEvents.RecordingChannelType? recordingChannelKind = default(Azure.Messaging.EventGrid.SystemEvents.RecordingChannelType?), Azure.Messaging.EventGrid.SystemEvents.RecordingFormatType? recordingFormatType = default(Azure.Messaging.EventGrid.SystemEvents.RecordingFormatType?), string sessionEndReason = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRecordingStorageInfoProperties AcsRecordingStorageInfoProperties(System.Collections.Generic.IEnumerable recordingChunks = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterChannelConfiguration AcsRouterChannelConfiguration(string channelId = null, int? capacityCostPerJob = default(int?), int? maxNumberOfJobs = default(int?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterCommunicationError AcsRouterCommunicationError(string code = null, string message = null, string target = null, Azure.Messaging.EventGrid.SystemEvents.AcsRouterCommunicationError innererror = null, System.Collections.Generic.IEnumerable details = null) { throw null; } @@ -2309,10 +2309,10 @@ public static partial class EventGridSystemEventsModelFactory public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobEventData AcsRouterJobEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobExceptionTriggeredEventData AcsRouterJobExceptionTriggeredEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, string ruleKey = null, string exceptionRuleId = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobQueuedEventData AcsRouterJobQueuedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, int? priority = default(int?), System.Collections.Generic.IEnumerable attachedWorkerSelectors = null, System.Collections.Generic.IEnumerable requestedWorkerSelectors = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobReceivedEventData AcsRouterJobReceivedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobStatus jobStatus = default(Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobStatus), string classificationPolicyId = null, int? priority = default(int?), System.Collections.Generic.IEnumerable requestedWorkerSelectors = null, System.DateTimeOffset scheduledOn = default(System.DateTimeOffset), bool unavailableForMatching = false) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobSchedulingFailedEventData AcsRouterJobSchedulingFailedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, int? priority = default(int?), System.Collections.Generic.IEnumerable expiredAttachedWorkerSelectors = null, System.Collections.Generic.IEnumerable expiredRequestedWorkerSelectors = null, System.DateTimeOffset scheduledOn = default(System.DateTimeOffset), string failureReason = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobReceivedEventData AcsRouterJobReceivedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobStatus? jobStatus = default(Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobStatus?), string classificationPolicyId = null, int? priority = default(int?), System.Collections.Generic.IEnumerable requestedWorkerSelectors = null, System.DateTimeOffset? scheduledOn = default(System.DateTimeOffset?), bool unavailableForMatching = false) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobSchedulingFailedEventData AcsRouterJobSchedulingFailedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, int? priority = default(int?), System.Collections.Generic.IEnumerable expiredAttachedWorkerSelectors = null, System.Collections.Generic.IEnumerable expiredRequestedWorkerSelectors = null, System.DateTimeOffset? scheduledOn = default(System.DateTimeOffset?), string failureReason = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobUnassignedEventData AcsRouterJobUnassignedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, string assignmentId = null, string workerId = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobWaitingForActivationEventData AcsRouterJobWaitingForActivationEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, int? priority = default(int?), System.Collections.Generic.IEnumerable expiredAttachedWorkerSelectors = null, System.Collections.Generic.IEnumerable expiredRequestedWorkerSelectors = null, System.DateTimeOffset scheduledOn = default(System.DateTimeOffset), bool unavailableForMatching = false) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobWaitingForActivationEventData AcsRouterJobWaitingForActivationEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, int? priority = default(int?), System.Collections.Generic.IEnumerable expiredAttachedWorkerSelectors = null, System.Collections.Generic.IEnumerable expiredRequestedWorkerSelectors = null, System.DateTimeOffset? scheduledOn = default(System.DateTimeOffset?), bool unavailableForMatching = false) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobWorkerSelectorsExpiredEventData AcsRouterJobWorkerSelectorsExpiredEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, System.Collections.Generic.IEnumerable expiredRequestedWorkerSelectors = null, System.Collections.Generic.IEnumerable expiredAttachedWorkerSelectors = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterQueueDetails AcsRouterQueueDetails(string id = null, string name = null, System.Collections.Generic.IReadOnlyDictionary labels = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerDeletedEventData AcsRouterWorkerDeletedEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null) { throw null; } @@ -2321,15 +2321,15 @@ public static partial class EventGridSystemEventsModelFactory public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerOfferAcceptedEventData AcsRouterWorkerOfferAcceptedEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null, string queueId = null, string offerId = null, string assignmentId = null, int? jobPriority = default(int?), System.Collections.Generic.IReadOnlyDictionary workerLabels = null, System.Collections.Generic.IReadOnlyDictionary workerTags = null, System.Collections.Generic.IReadOnlyDictionary jobLabels = null, System.Collections.Generic.IReadOnlyDictionary jobTags = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerOfferDeclinedEventData AcsRouterWorkerOfferDeclinedEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null, string queueId = null, string offerId = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerOfferExpiredEventData AcsRouterWorkerOfferExpiredEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null, string queueId = null, string offerId = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerOfferIssuedEventData AcsRouterWorkerOfferIssuedEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null, string queueId = null, string offerId = null, int? jobPriority = default(int?), System.Collections.Generic.IReadOnlyDictionary workerLabels = null, System.DateTimeOffset offeredOn = default(System.DateTimeOffset), System.DateTimeOffset expiresOn = default(System.DateTimeOffset), System.Collections.Generic.IReadOnlyDictionary workerTags = null, System.Collections.Generic.IReadOnlyDictionary jobLabels = null, System.Collections.Generic.IReadOnlyDictionary jobTags = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerOfferIssuedEventData AcsRouterWorkerOfferIssuedEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null, string queueId = null, string offerId = null, int? jobPriority = default(int?), System.Collections.Generic.IReadOnlyDictionary workerLabels = null, System.DateTimeOffset? offeredOn = default(System.DateTimeOffset?), System.DateTimeOffset? expiresOn = default(System.DateTimeOffset?), System.Collections.Generic.IReadOnlyDictionary workerTags = null, System.Collections.Generic.IReadOnlyDictionary jobLabels = null, System.Collections.Generic.IReadOnlyDictionary jobTags = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerOfferRevokedEventData AcsRouterWorkerOfferRevokedEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null, string queueId = null, string offerId = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerRegisteredEventData AcsRouterWorkerRegisteredEventData(string workerId = null, System.Collections.Generic.IEnumerable queueAssignments = null, System.Collections.Generic.IEnumerable channelConfigurations = null, int? totalCapacity = default(int?), System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelector AcsRouterWorkerSelector(string key = null, Azure.Messaging.EventGrid.SystemEvents.AcsRouterLabelOperator labelOperator = default(Azure.Messaging.EventGrid.SystemEvents.AcsRouterLabelOperator), System.BinaryData labelValue = null, double timeToLive = 0, Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelectorState selectorState = default(Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelectorState), System.DateTimeOffset expirationTime = default(System.DateTimeOffset)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelector AcsRouterWorkerSelector(string key = null, Azure.Messaging.EventGrid.SystemEvents.AcsRouterLabelOperator? labelOperator = default(Azure.Messaging.EventGrid.SystemEvents.AcsRouterLabelOperator?), System.BinaryData labelValue = null, double timeToLive = 0, Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelectorState? selectorState = default(Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelectorState?), System.DateTimeOffset? expirationTime = default(System.DateTimeOffset?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerUpdatedEventData AcsRouterWorkerUpdatedEventData(string workerId = null, System.Collections.Generic.IEnumerable queueAssignments = null, System.Collections.Generic.IEnumerable channelConfigurations = null, int? totalCapacity = default(int?), System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, System.Collections.Generic.IEnumerable updatedWorkerProperties = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsSmsDeliveryAttemptProperties AcsSmsDeliveryAttemptProperties(System.DateTimeOffset timestamp = default(System.DateTimeOffset), int? segmentsSucceeded = default(int?), int? segmentsFailed = default(int?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsSmsDeliveryReportReceivedEventData AcsSmsDeliveryReportReceivedEventData(string messageId = null, string from = null, string to = null, string deliveryStatus = null, string deliveryStatusDetails = null, System.Collections.Generic.IEnumerable deliveryAttempts = null, System.DateTimeOffset receivedTimestamp = default(System.DateTimeOffset), string tag = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsSmsDeliveryAttemptProperties AcsSmsDeliveryAttemptProperties(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), int? segmentsSucceeded = default(int?), int? segmentsFailed = default(int?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsSmsDeliveryReportReceivedEventData AcsSmsDeliveryReportReceivedEventData(string messageId = null, string from = null, string to = null, string deliveryStatus = null, string deliveryStatusDetails = null, System.Collections.Generic.IEnumerable deliveryAttempts = null, System.DateTimeOffset? receivedTimestamp = default(System.DateTimeOffset?), string tag = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsSmsEventBaseProperties AcsSmsEventBaseProperties(string messageId = null, string from = null, string to = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AcsSmsReceivedEventData AcsSmsReceivedEventData(string messageId = null, string from = null, string to = null, string message = null, System.DateTimeOffset receivedTimestamp = default(System.DateTimeOffset)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsSmsReceivedEventData AcsSmsReceivedEventData(string messageId = null, string from = null, string to = null, string message = null, System.DateTimeOffset? receivedTimestamp = default(System.DateTimeOffset?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsUserDisconnectedEventData AcsUserDisconnectedEventData(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel userCommunicationIdentifier = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiDefinitionAddedEventData ApiCenterApiDefinitionAddedEventData(string title = null, string description = null, Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiSpecification specification = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiDefinitionUpdatedEventData ApiCenterApiDefinitionUpdatedEventData(string title = null, string description = null, Azure.Messaging.EventGrid.SystemEvents.ApiCenterApiSpecification specification = null) { throw null; } @@ -2365,8 +2365,8 @@ public static partial class EventGridSystemEventsModelFactory public static Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotCreatedEventData AppConfigurationSnapshotCreatedEventData(string name = null, string etag = null, string syncToken = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotEventData AppConfigurationSnapshotEventData(string name = null, string etag = null, string syncToken = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AppConfigurationSnapshotModifiedEventData AppConfigurationSnapshotModifiedEventData(string name = null, string etag = null, string syncToken = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AppEventTypeDetail AppEventTypeDetail(Azure.Messaging.EventGrid.SystemEvents.AppAction action = default(Azure.Messaging.EventGrid.SystemEvents.AppAction)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.AppServicePlanEventTypeDetail AppServicePlanEventTypeDetail(Azure.Messaging.EventGrid.SystemEvents.StampKind stampKind = default(Azure.Messaging.EventGrid.SystemEvents.StampKind), Azure.Messaging.EventGrid.SystemEvents.AppServicePlanAction action = default(Azure.Messaging.EventGrid.SystemEvents.AppServicePlanAction), Azure.Messaging.EventGrid.SystemEvents.AsyncStatus status = default(Azure.Messaging.EventGrid.SystemEvents.AsyncStatus)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AppEventTypeDetail AppEventTypeDetail(Azure.Messaging.EventGrid.SystemEvents.AppAction? action = default(Azure.Messaging.EventGrid.SystemEvents.AppAction?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AppServicePlanEventTypeDetail AppServicePlanEventTypeDetail(Azure.Messaging.EventGrid.SystemEvents.StampKind? stampKind = default(Azure.Messaging.EventGrid.SystemEvents.StampKind?), Azure.Messaging.EventGrid.SystemEvents.AppServicePlanAction? action = default(Azure.Messaging.EventGrid.SystemEvents.AppServicePlanAction?), Azure.Messaging.EventGrid.SystemEvents.AsyncStatus? status = default(Azure.Messaging.EventGrid.SystemEvents.AsyncStatus?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AvsClusterCreatedEventData AvsClusterCreatedEventData(string operationId = null, System.Collections.Generic.IEnumerable addedHostNames = null, System.Collections.Generic.IEnumerable removedHostNames = null, System.Collections.Generic.IEnumerable inMaintenanceHostNames = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AvsClusterDeletedEventData AvsClusterDeletedEventData(string operationId = null, System.Collections.Generic.IEnumerable addedHostNames = null, System.Collections.Generic.IEnumerable removedHostNames = null, System.Collections.Generic.IEnumerable inMaintenanceHostNames = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AvsClusterEventData AvsClusterEventData(string operationId = null, System.Collections.Generic.IEnumerable addedHostNames = null, System.Collections.Generic.IEnumerable removedHostNames = null, System.Collections.Generic.IEnumerable inMaintenanceHostNames = null) { throw null; } @@ -2382,20 +2382,20 @@ public static partial class EventGridSystemEventsModelFactory public static Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionFailedEventData AvsScriptExecutionFailedEventData(string operationId = null, string cmdletId = null, System.Collections.Generic.IEnumerable output = null, string failureMessage = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionFinishedEventData AvsScriptExecutionFinishedEventData(string operationId = null, string cmdletId = null, System.Collections.Generic.IEnumerable output = null, System.Collections.Generic.IReadOnlyDictionary namedOutputs = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AvsScriptExecutionStartedEventData AvsScriptExecutionStartedEventData(string operationId = null, string cmdletId = null, System.Collections.Generic.IEnumerable output = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel CommunicationIdentifierModel(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModelKind kind = default(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModelKind), string rawId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationUserIdentifierModel communicationUser = null, Azure.Messaging.EventGrid.SystemEvents.PhoneNumberIdentifierModel phoneNumber = null, Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsUserIdentifierModel microsoftTeamsUser = null, Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsAppIdentifierModel microsoftTeamsApp = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel CommunicationIdentifierModel(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModelKind? kind = default(Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModelKind?), string rawId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationUserIdentifierModel communicationUser = null, Azure.Messaging.EventGrid.SystemEvents.PhoneNumberIdentifierModel phoneNumber = null, Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsUserIdentifierModel microsoftTeamsUser = null, Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsAppIdentifierModel microsoftTeamsApp = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.CommunicationUserIdentifierModel CommunicationUserIdentifierModel(string id = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventData ContainerRegistryArtifactEventData(string id = null, System.DateTimeOffset timestamp = default(System.DateTimeOffset), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventData ContainerRegistryArtifactEventData(string id = null, System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget ContainerRegistryArtifactEventTarget(string mediaType = null, long? size = default(long?), string digest = null, string repository = null, string tag = null, string name = null, string version = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryChartDeletedEventData ContainerRegistryChartDeletedEventData(string id = null, System.DateTimeOffset timestamp = default(System.DateTimeOffset), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryChartPushedEventData ContainerRegistryChartPushedEventData(string id = null, System.DateTimeOffset timestamp = default(System.DateTimeOffset), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryChartDeletedEventData ContainerRegistryChartDeletedEventData(string id = null, System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryChartPushedEventData ContainerRegistryChartPushedEventData(string id = null, System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryArtifactEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventActor ContainerRegistryEventActor(string name = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry ContainerRegistryEventConnectedRegistry(string name = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventData ContainerRegistryEventData(string id = null, System.DateTimeOffset timestamp = default(System.DateTimeOffset), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventRequest request = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventActor actor = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventSource source = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventData ContainerRegistryEventData(string id = null, System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventRequest request = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventActor actor = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventSource source = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventRequest ContainerRegistryEventRequest(string id = null, string addr = null, string host = null, string method = null, string useragent = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventSource ContainerRegistryEventSource(string addr = null, string instanceID = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventTarget ContainerRegistryEventTarget(string mediaType = null, long? size = default(long?), string digest = null, long? length = default(long?), string repository = null, string url = null, string tag = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryImageDeletedEventData ContainerRegistryImageDeletedEventData(string id = null, System.DateTimeOffset timestamp = default(System.DateTimeOffset), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventRequest request = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventActor actor = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventSource source = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryImagePushedEventData ContainerRegistryImagePushedEventData(string id = null, System.DateTimeOffset timestamp = default(System.DateTimeOffset), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventRequest request = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventActor actor = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventSource source = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryImageDeletedEventData ContainerRegistryImageDeletedEventData(string id = null, System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventRequest request = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventActor actor = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventSource source = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryImagePushedEventData ContainerRegistryImagePushedEventData(string id = null, System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string action = null, string location = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventTarget target = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventRequest request = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventActor actor = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventSource source = null, Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventConnectedRegistry connectedRegistry = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerServiceClusterSupportEndedEventData ContainerServiceClusterSupportEndedEventData(string kubernetesVersion = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerServiceClusterSupportEndingEventData ContainerServiceClusterSupportEndingEventData(string kubernetesVersion = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerServiceClusterSupportEventData ContainerServiceClusterSupportEventData(string kubernetesVersion = null) { throw null; } @@ -2404,9 +2404,9 @@ public static partial class EventGridSystemEventsModelFactory public static Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingFailedEventData ContainerServiceNodePoolRollingFailedEventData(string nodePoolName = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingStartedEventData ContainerServiceNodePoolRollingStartedEventData(string nodePoolName = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ContainerServiceNodePoolRollingSucceededEventData ContainerServiceNodePoolRollingSucceededEventData(string nodePoolName = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.DataBoxCopyCompletedEventData DataBoxCopyCompletedEventData(string serialNumber = null, Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName stageName = default(Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName), System.DateTimeOffset stageTime = default(System.DateTimeOffset)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.DataBoxCopyStartedEventData DataBoxCopyStartedEventData(string serialNumber = null, Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName stageName = default(Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName), System.DateTimeOffset stageTime = default(System.DateTimeOffset)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.DataBoxOrderCompletedEventData DataBoxOrderCompletedEventData(string serialNumber = null, Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName stageName = default(Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName), System.DateTimeOffset stageTime = default(System.DateTimeOffset)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.DataBoxCopyCompletedEventData DataBoxCopyCompletedEventData(string serialNumber = null, Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName? stageName = default(Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName?), System.DateTimeOffset? stageTime = default(System.DateTimeOffset?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.DataBoxCopyStartedEventData DataBoxCopyStartedEventData(string serialNumber = null, Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName? stageName = default(Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName?), System.DateTimeOffset? stageTime = default(System.DateTimeOffset?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.DataBoxOrderCompletedEventData DataBoxOrderCompletedEventData(string serialNumber = null, Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName? stageName = default(Azure.Messaging.EventGrid.SystemEvents.DataBoxStageName?), System.DateTimeOffset? stageTime = default(System.DateTimeOffset?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventInfo DeviceConnectionStateEventInfo(string sequenceNumber = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventProperties DeviceConnectionStateEventProperties(string deviceId = null, string moduleId = null, string hubName = null, Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventInfo deviceConnectionStateEventInfo = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.DeviceLifeCycleEventProperties DeviceLifeCycleEventProperties(string deviceId = null, string hubName = null, Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfo twin = null) { throw null; } @@ -2416,18 +2416,18 @@ public static partial class EventGridSystemEventsModelFactory public static Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfoX509Thumbprint DeviceTwinInfoX509Thumbprint(string primaryThumbprint = null, string secondaryThumbprint = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.DeviceTwinMetadata DeviceTwinMetadata(string lastUpdated = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.DeviceTwinProperties DeviceTwinProperties(Azure.Messaging.EventGrid.SystemEvents.DeviceTwinMetadata metadata = null, float? version = default(float?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientCreatedOrUpdatedEventData EventGridMQTTClientCreatedOrUpdatedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientState state = default(Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientState), System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset updatedOn = default(System.DateTimeOffset), System.Collections.Generic.IReadOnlyDictionary attributes = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDeletedEventData EventGridMQTTClientDeletedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientEventData EventGridMQTTClientEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientSessionConnectedEventData EventGridMQTTClientSessionConnectedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, string clientSessionName = null, long? sequenceNumber = default(long?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientSessionDisconnectedEventData EventGridMQTTClientSessionDisconnectedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, string clientSessionName = null, long? sequenceNumber = default(long?), Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason disconnectionReason = default(Azure.Messaging.EventGrid.SystemEvents.EventGridMQTTClientDisconnectionReason)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.EventHubCaptureFileCreatedEventData EventHubCaptureFileCreatedEventData(string fileurl = null, string fileType = null, string partitionId = null, int? sizeInBytes = default(int?), int? eventCount = default(int?), int? firstSequenceNumber = default(int?), int? lastSequenceNumber = default(int?), System.DateTimeOffset firstEnqueueTime = default(System.DateTimeOffset), System.DateTimeOffset lastEnqueueTime = default(System.DateTimeOffset)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientCreatedOrUpdatedEventData EventGridMqttClientCreatedOrUpdatedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState? state = default(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientState?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?), System.Collections.Generic.IReadOnlyDictionary attributes = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDeletedEventData EventGridMqttClientDeletedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientEventData EventGridMqttClientEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientSessionConnectedEventData EventGridMqttClientSessionConnectedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, string clientSessionName = null, long? sequenceNumber = default(long?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientSessionDisconnectedEventData EventGridMqttClientSessionDisconnectedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, string clientSessionName = null, long? sequenceNumber = default(long?), Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason? disconnectionReason = default(Azure.Messaging.EventGrid.SystemEvents.EventGridMqttClientDisconnectionReason?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.EventHubCaptureFileCreatedEventData EventHubCaptureFileCreatedEventData(string fileurl = null, string fileType = null, string partitionId = null, int? sizeInBytes = default(int?), int? eventCount = default(int?), int? firstSequenceNumber = default(int?), int? lastSequenceNumber = default(int?), System.DateTimeOffset? firstEnqueueTime = default(System.DateTimeOffset?), System.DateTimeOffset? lastEnqueueTime = default(System.DateTimeOffset?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.HealthcareDicomImageCreatedEventData HealthcareDicomImageCreatedEventData(string partitionName = null, string imageStudyInstanceUid = null, string imageSeriesInstanceUid = null, string imageSopInstanceUid = null, string serviceHostName = null, long? sequenceNumber = default(long?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.HealthcareDicomImageDeletedEventData HealthcareDicomImageDeletedEventData(string partitionName = null, string imageStudyInstanceUid = null, string imageSeriesInstanceUid = null, string imageSopInstanceUid = null, string serviceHostName = null, long? sequenceNumber = default(long?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.HealthcareDicomImageUpdatedEventData HealthcareDicomImageUpdatedEventData(string partitionName = null, string imageStudyInstanceUid = null, string imageSeriesInstanceUid = null, string imageSopInstanceUid = null, string serviceHostName = null, long? sequenceNumber = default(long?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceCreatedEventData HealthcareFhirResourceCreatedEventData(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType fhirResourceType = default(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType), string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = default(long?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceDeletedEventData HealthcareFhirResourceDeletedEventData(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType fhirResourceType = default(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType), string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = default(long?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceUpdatedEventData HealthcareFhirResourceUpdatedEventData(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType fhirResourceType = default(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType), string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = default(long?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceCreatedEventData HealthcareFhirResourceCreatedEventData(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType? fhirResourceType = default(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType?), string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = default(long?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceDeletedEventData HealthcareFhirResourceDeletedEventData(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType? fhirResourceType = default(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType?), string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = default(long?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceUpdatedEventData HealthcareFhirResourceUpdatedEventData(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType? fhirResourceType = default(Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType?), string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = default(long?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.IotHubDeviceConnectedEventData IotHubDeviceConnectedEventData(string deviceId = null, string moduleId = null, string hubName = null, Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventInfo deviceConnectionStateEventInfo = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.IotHubDeviceCreatedEventData IotHubDeviceCreatedEventData(string deviceId = null, string hubName = null, Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfo twin = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.IotHubDeviceDeletedEventData IotHubDeviceDeletedEventData(string deviceId = null, string hubName = null, Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfo twin = null) { throw null; } @@ -2443,7 +2443,7 @@ public static partial class EventGridSystemEventsModelFactory public static Azure.Messaging.EventGrid.SystemEvents.KeyVaultSecretExpiredEventData KeyVaultSecretExpiredEventData(string id = null, string vaultName = null, string objectType = null, string objectName = null, string version = null, float? nbf = default(float?), float? exp = default(float?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.KeyVaultSecretNearExpiryEventData KeyVaultSecretNearExpiryEventData(string id = null, string vaultName = null, string objectType = null, string objectName = null, string version = null, float? nbf = default(float?), float? exp = default(float?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.KeyVaultSecretNewVersionCreatedEventData KeyVaultSecretNewVersionCreatedEventData(string id = null, string vaultName = null, string objectType = null, string objectName = null, string version = null, float? nbf = default(float?), float? exp = default(float?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesDatasetDriftDetectedEventData MachineLearningServicesDatasetDriftDetectedEventData(string dataDriftId = null, string dataDriftName = null, string runId = null, string baseDatasetId = null, string targetDatasetId = null, double? driftCoefficient = default(double?), System.DateTimeOffset startTime = default(System.DateTimeOffset), System.DateTimeOffset endTime = default(System.DateTimeOffset)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesDatasetDriftDetectedEventData MachineLearningServicesDatasetDriftDetectedEventData(string dataDriftId = null, string dataDriftName = null, string runId = null, string baseDatasetId = null, string targetDatasetId = null, double? driftCoefficient = default(double?), System.DateTimeOffset? startTime = default(System.DateTimeOffset?), System.DateTimeOffset? endTime = default(System.DateTimeOffset?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesModelDeployedEventData MachineLearningServicesModelDeployedEventData(string serviceName = null, string serviceComputeType = null, string modelIds = null, System.Collections.Generic.IReadOnlyDictionary serviceTags = null, System.Collections.Generic.IReadOnlyDictionary serviceProperties = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesModelRegisteredEventData MachineLearningServicesModelRegisteredEventData(string modelName = null, string modelVersion = null, System.Collections.Generic.IReadOnlyDictionary modelTags = null, System.Collections.Generic.IReadOnlyDictionary modelProperties = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesRunCompletedEventData MachineLearningServicesRunCompletedEventData(string experimentId = null, string experimentName = null, string runId = null, string runType = null, System.Collections.Generic.IReadOnlyDictionary runTags = null, System.Collections.Generic.IReadOnlyDictionary runProperties = null) { throw null; } @@ -2453,25 +2453,25 @@ public static partial class EventGridSystemEventsModelFactory public static Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceExitedEventData MapsGeofenceExitedEventData(System.Collections.Generic.IEnumerable expiredGeofenceGeometryId = null, System.Collections.Generic.IEnumerable geometries = null, System.Collections.Generic.IEnumerable invalidPeriodGeofenceGeometryId = null, bool? isEventPublished = default(bool?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceGeometry MapsGeofenceGeometry(string deviceId = null, float? distance = default(float?), string geometryId = null, float? nearestLat = default(float?), float? nearestLon = default(float?), string udId = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceResultEventData MapsGeofenceResultEventData(System.Collections.Generic.IEnumerable expiredGeofenceGeometryId = null, System.Collections.Generic.IEnumerable geometries = null, System.Collections.Generic.IEnumerable invalidPeriodGeofenceGeometryId = null, bool? isEventPublished = default(bool?)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobCanceledEventData MediaJobCanceledEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobState state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), System.Collections.Generic.IReadOnlyDictionary correlationData = null, System.Collections.Generic.IEnumerable outputs = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobCancelingEventData MediaJobCancelingEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobState state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), System.Collections.Generic.IReadOnlyDictionary correlationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobError MediaJobError(Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode code = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode), string message = null, Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory category = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory), Azure.Messaging.EventGrid.SystemEvents.MediaJobRetry retry = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobRetry), System.Collections.Generic.IEnumerable details = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MediaJobCanceledEventData MediaJobCanceledEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState? previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), Azure.Messaging.EventGrid.SystemEvents.MediaJobState? state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), System.Collections.Generic.IReadOnlyDictionary correlationData = null, System.Collections.Generic.IEnumerable outputs = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MediaJobCancelingEventData MediaJobCancelingEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState? previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), Azure.Messaging.EventGrid.SystemEvents.MediaJobState? state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), System.Collections.Generic.IReadOnlyDictionary correlationData = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MediaJobError MediaJobError(Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode? code = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode?), string message = null, Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory? category = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory?), Azure.Messaging.EventGrid.SystemEvents.MediaJobRetry? retry = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobRetry?), System.Collections.Generic.IEnumerable details = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorDetail MediaJobErrorDetail(string code = null, string message = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErroredEventData MediaJobErroredEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobState state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), System.Collections.Generic.IReadOnlyDictionary correlationData = null, System.Collections.Generic.IEnumerable outputs = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobFinishedEventData MediaJobFinishedEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobState state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), System.Collections.Generic.IReadOnlyDictionary correlationData = null, System.Collections.Generic.IEnumerable outputs = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput MediaJobOutput(string odataType = null, Azure.Messaging.EventGrid.SystemEvents.MediaJobError error = null, string label = null, long progress = (long)0, Azure.Messaging.EventGrid.SystemEvents.MediaJobState state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputAsset MediaJobOutputAsset(Azure.Messaging.EventGrid.SystemEvents.MediaJobError error = null, string label = null, long progress = (long)0, Azure.Messaging.EventGrid.SystemEvents.MediaJobState state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), string assetName = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputCanceledEventData MediaJobOutputCanceledEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputCancelingEventData MediaJobOutputCancelingEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputErroredEventData MediaJobOutputErroredEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputFinishedEventData MediaJobOutputFinishedEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputProcessingEventData MediaJobOutputProcessingEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MediaJobErroredEventData MediaJobErroredEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState? previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), Azure.Messaging.EventGrid.SystemEvents.MediaJobState? state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), System.Collections.Generic.IReadOnlyDictionary correlationData = null, System.Collections.Generic.IEnumerable outputs = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MediaJobFinishedEventData MediaJobFinishedEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState? previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), Azure.Messaging.EventGrid.SystemEvents.MediaJobState? state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), System.Collections.Generic.IReadOnlyDictionary correlationData = null, System.Collections.Generic.IEnumerable outputs = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput MediaJobOutput(string odataType = null, Azure.Messaging.EventGrid.SystemEvents.MediaJobError error = null, string label = null, long progress = (long)0, Azure.Messaging.EventGrid.SystemEvents.MediaJobState? state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputAsset MediaJobOutputAsset(Azure.Messaging.EventGrid.SystemEvents.MediaJobError error = null, string label = null, long progress = (long)0, Azure.Messaging.EventGrid.SystemEvents.MediaJobState? state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), string assetName = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputCanceledEventData MediaJobOutputCanceledEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState? previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputCancelingEventData MediaJobOutputCancelingEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState? previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputErroredEventData MediaJobOutputErroredEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState? previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputFinishedEventData MediaJobOutputFinishedEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState? previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputProcessingEventData MediaJobOutputProcessingEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState? previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputProgressEventData MediaJobOutputProgressEventData(string label = null, long? progress = default(long?), System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputScheduledEventData MediaJobOutputScheduledEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputStateChangeEventData MediaJobOutputStateChangeEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobProcessingEventData MediaJobProcessingEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobState state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), System.Collections.Generic.IReadOnlyDictionary correlationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobScheduledEventData MediaJobScheduledEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobState state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), System.Collections.Generic.IReadOnlyDictionary correlationData = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MediaJobStateChangeEventData MediaJobStateChangeEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), Azure.Messaging.EventGrid.SystemEvents.MediaJobState state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState), System.Collections.Generic.IReadOnlyDictionary correlationData = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputScheduledEventData MediaJobOutputScheduledEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState? previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputStateChangeEventData MediaJobOutputStateChangeEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState? previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput output = null, System.Collections.Generic.IReadOnlyDictionary jobCorrelationData = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MediaJobProcessingEventData MediaJobProcessingEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState? previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), Azure.Messaging.EventGrid.SystemEvents.MediaJobState? state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), System.Collections.Generic.IReadOnlyDictionary correlationData = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MediaJobScheduledEventData MediaJobScheduledEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState? previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), Azure.Messaging.EventGrid.SystemEvents.MediaJobState? state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), System.Collections.Generic.IReadOnlyDictionary correlationData = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MediaJobStateChangeEventData MediaJobStateChangeEventData(Azure.Messaging.EventGrid.SystemEvents.MediaJobState? previousState = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), Azure.Messaging.EventGrid.SystemEvents.MediaJobState? state = default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState?), System.Collections.Generic.IReadOnlyDictionary correlationData = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventChannelArchiveHeartbeatEventData MediaLiveEventChannelArchiveHeartbeatEventData(string channelLatencyMs = null, string latencyResultCode = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventConnectionRejectedEventData MediaLiveEventConnectionRejectedEventData(string ingestUrl = null, string streamId = null, string encoderIp = null, string encoderPort = null, string resultCode = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventEncoderConnectedEventData MediaLiveEventEncoderConnectedEventData(string ingestUrl = null, string streamId = null, string encoderIp = null, string encoderPort = null) { throw null; } @@ -2482,16 +2482,16 @@ public static partial class EventGridSystemEventsModelFactory public static Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventIncomingVideoStreamsOutOfSyncEventData MediaLiveEventIncomingVideoStreamsOutOfSyncEventData(string firstTimestamp = null, string firstDuration = null, string secondTimestamp = null, string secondDuration = null, string timescale = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventIngestHeartbeatEventData MediaLiveEventIngestHeartbeatEventData(string trackType = null, string trackName = null, string transcriptionLanguage = null, string transcriptionState = null, long? bitrate = default(long?), long? incomingBitrate = default(long?), string ingestDriftValue = null, string lastFragmentArrivalTime = null, string lastTimestamp = null, string timescale = null, long? overlapCount = default(long?), long? discontinuityCount = default(long?), long? nonincreasingCount = default(long?), bool? unexpectedBitrate = default(bool?), string state = null, bool? healthy = default(bool?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.MediaLiveEventTrackDiscontinuityDetectedEventData MediaLiveEventTrackDiscontinuityDetectedEventData(string trackType = null, string trackName = null, long? bitrate = default(long?), string previousTimestamp = null, string newTimestamp = null, string timescale = null, string discontinuityGap = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsAppIdentifierModel MicrosoftTeamsAppIdentifierModel(string appId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel cloud = default(Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel)) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsUserIdentifierModel MicrosoftTeamsUserIdentifierModel(string userId = null, bool? isAnonymous = default(bool?), Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel cloud = default(Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsAppIdentifierModel MicrosoftTeamsAppIdentifierModel(string appId = null, Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel? cloud = default(Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsUserIdentifierModel MicrosoftTeamsUserIdentifierModel(string userId = null, bool? isAnonymous = default(bool?), Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel? cloud = default(Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.PhoneNumberIdentifierModel PhoneNumberIdentifierModel(string value = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateChangedEventData PolicyInsightsPolicyStateChangedEventData(System.DateTimeOffset timestamp = default(System.DateTimeOffset), string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateCreatedEventData PolicyInsightsPolicyStateCreatedEventData(System.DateTimeOffset timestamp = default(System.DateTimeOffset), string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateDeletedEventData PolicyInsightsPolicyStateDeletedEventData(System.DateTimeOffset timestamp = default(System.DateTimeOffset), string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.RedisExportRDBCompletedEventData RedisExportRDBCompletedEventData(System.DateTimeOffset timestamp = default(System.DateTimeOffset), string name = null, string status = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.RedisImportRDBCompletedEventData RedisImportRDBCompletedEventData(System.DateTimeOffset timestamp = default(System.DateTimeOffset), string name = null, string status = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.RedisPatchingCompletedEventData RedisPatchingCompletedEventData(System.DateTimeOffset timestamp = default(System.DateTimeOffset), string name = null, string status = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.RedisScalingCompletedEventData RedisScalingCompletedEventData(System.DateTimeOffset timestamp = default(System.DateTimeOffset), string name = null, string status = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateChangedEventData PolicyInsightsPolicyStateChangedEventData(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateCreatedEventData PolicyInsightsPolicyStateCreatedEventData(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateDeletedEventData PolicyInsightsPolicyStateDeletedEventData(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.RedisExportRdbCompletedEventData RedisExportRdbCompletedEventData(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string name = null, string status = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.RedisImportRdbCompletedEventData RedisImportRdbCompletedEventData(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string name = null, string status = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.RedisPatchingCompletedEventData RedisPatchingCompletedEventData(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string name = null, string status = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.RedisScalingCompletedEventData RedisScalingCompletedEventData(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string name = null, string status = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceActionCancelEventData ResourceActionCancelEventData(string tenantId = null, string subscriptionId = null, string resourceGroup = null, string resourceProvider = null, string resourceUri = null, string operationName = null, string status = null, Azure.Messaging.EventGrid.SystemEvents.ResourceAuthorization authorization = null, System.Collections.Generic.IReadOnlyDictionary claims = null, string correlationId = null, Azure.Messaging.EventGrid.SystemEvents.ResourceHttpRequest httpRequest = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceActionFailureEventData ResourceActionFailureEventData(string tenantId = null, string subscriptionId = null, string resourceGroup = null, string resourceProvider = null, string resourceUri = null, string operationName = null, string status = null, Azure.Messaging.EventGrid.SystemEvents.ResourceAuthorization authorization = null, System.Collections.Generic.IReadOnlyDictionary claims = null, string correlationId = null, Azure.Messaging.EventGrid.SystemEvents.ResourceHttpRequest httpRequest = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceActionSuccessEventData ResourceActionSuccessEventData(string tenantId = null, string subscriptionId = null, string resourceGroup = null, string resourceProvider = null, string resourceUri = null, string operationName = null, string status = null, Azure.Messaging.EventGrid.SystemEvents.ResourceAuthorization authorization = null, System.Collections.Generic.IReadOnlyDictionary claims = null, string correlationId = null, Azure.Messaging.EventGrid.SystemEvents.ResourceHttpRequest httpRequest = null) { throw null; } @@ -2502,7 +2502,7 @@ public static partial class EventGridSystemEventsModelFactory public static Azure.Messaging.EventGrid.SystemEvents.ResourceHttpRequest ResourceHttpRequest(string clientRequestId = null, string clientIpAddress = null, string method = null, string url = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsHealthResourcesAnnotatedEventData ResourceNotificationsHealthResourcesAnnotatedEventData(Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedDetails resourceDetails = null, Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails operationalDetails = null, string apiVersion = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData(Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedDetails resourceDetails = null, Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails operationalDetails = null, string apiVersion = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails ResourceNotificationsOperationalDetails(System.DateTimeOffset resourceEventTime = default(System.DateTimeOffset)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails ResourceNotificationsOperationalDetails(System.DateTimeOffset? resourceEventTime = default(System.DateTimeOffset?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedDetails ResourceNotificationsResourceDeletedDetails(string id = null, string name = null, string type = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedEventData ResourceNotificationsResourceDeletedEventData(Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceDeletedDetails resourceDetails = null, Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails operationalDetails = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceManagementCreatedOrUpdatedEventData ResourceNotificationsResourceManagementCreatedOrUpdatedEventData(Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedDetails resourceDetails = null, Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails operationalDetails = null, string apiVersion = null) { throw null; } @@ -2516,23 +2516,23 @@ public static partial class EventGridSystemEventsModelFactory public static Azure.Messaging.EventGrid.SystemEvents.ServiceBusActiveMessagesAvailableWithNoListenersEventData ServiceBusActiveMessagesAvailableWithNoListenersEventData(string namespaceName = null, string requestUri = null, string entityType = null, string queueName = null, string topicName = null, string subscriptionName = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData(string namespaceName = null, string requestUri = null, string entityType = null, string queueName = null, string topicName = null, string subscriptionName = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ServiceBusDeadletterMessagesAvailableWithNoListenersEventData ServiceBusDeadletterMessagesAvailableWithNoListenersEventData(string namespaceName = null, string requestUri = null, string entityType = null, string queueName = null, string topicName = null, string subscriptionName = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionConnectedEventData SignalRServiceClientConnectionConnectedEventData(System.DateTimeOffset timestamp = default(System.DateTimeOffset), string hubName = null, string connectionId = null, string userId = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionDisconnectedEventData SignalRServiceClientConnectionDisconnectedEventData(System.DateTimeOffset timestamp = default(System.DateTimeOffset), string hubName = null, string connectionId = null, string userId = null, string errorMessage = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionConnectedEventData SignalRServiceClientConnectionConnectedEventData(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string hubName = null, string connectionId = null, string userId = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionDisconnectedEventData SignalRServiceClientConnectionDisconnectedEventData(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string hubName = null, string connectionId = null, string userId = null, string errorMessage = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageAsyncOperationInitiatedEventData StorageAsyncOperationInitiatedEventData(string api = null, string clientRequestId = null, string requestId = null, string contentType = null, long? contentLength = default(long?), string blobType = null, string url = null, string sequencer = null, string identity = null, System.Collections.Generic.IReadOnlyDictionary storageDiagnostics = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobCreatedEventData StorageBlobCreatedEventData(string api = null, string clientRequestId = null, string requestId = null, string eTag = null, string contentType = null, long? contentLength = default(long?), long? contentOffset = default(long?), string blobType = null, string url = null, string sequencer = null, string identity = null, System.Collections.Generic.IReadOnlyDictionary storageDiagnostics = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobCreatedEventData StorageBlobCreatedEventData(string api = null, string clientRequestId = null, string requestId = null, string eTag = null, string contentType = null, long? contentLength = default(long?), long? contentOffset = default(long?), string blobType = null, Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier accessTier = default(Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier), string url = null, string sequencer = null, string identity = null, System.Collections.Generic.IReadOnlyDictionary storageDiagnostics = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobDeletedEventData StorageBlobDeletedEventData(string api = null, string clientRequestId = null, string requestId = null, string contentType = null, string blobType = null, string url = null, string sequencer = null, string identity = null, System.Collections.Generic.IReadOnlyDictionary storageDiagnostics = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobInventoryPolicyCompletedEventData StorageBlobInventoryPolicyCompletedEventData(System.DateTimeOffset scheduleDateTime = default(System.DateTimeOffset), string accountName = null, string ruleName = null, string policyRunStatus = null, string policyRunStatusMessage = null, string policyRunId = null, string manifestBlobUrl = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobInventoryPolicyCompletedEventData StorageBlobInventoryPolicyCompletedEventData(System.DateTimeOffset? scheduleDateTime = default(System.DateTimeOffset?), string accountName = null, string ruleName = null, string policyRunStatus = null, string policyRunStatusMessage = null, string policyRunId = null, string manifestBlobUrl = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobRenamedEventData StorageBlobRenamedEventData(string api = null, string clientRequestId = null, string requestId = null, string sourceUrl = null, string destinationUrl = null, string sequencer = null, string identity = null, System.Collections.Generic.IReadOnlyDictionary storageDiagnostics = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobTierChangedEventData StorageBlobTierChangedEventData(string api = null, string clientRequestId = null, string requestId = null, string contentType = null, long? contentLength = default(long?), string blobType = null, string url = null, string sequencer = null, string identity = null, System.Collections.Generic.IReadOnlyDictionary storageDiagnostics = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobTierChangedEventData StorageBlobTierChangedEventData(string api = null, string clientRequestId = null, string requestId = null, string contentType = null, long? contentLength = default(long?), string blobType = null, Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier accessTier = default(Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier), Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier previousTier = default(Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier), string url = null, string sequencer = null, string identity = null, System.Collections.Generic.IReadOnlyDictionary storageDiagnostics = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryCreatedEventData StorageDirectoryCreatedEventData(string api = null, string clientRequestId = null, string requestId = null, string eTag = null, string url = null, string sequencer = null, string identity = null, System.Collections.Generic.IReadOnlyDictionary storageDiagnostics = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryDeletedEventData StorageDirectoryDeletedEventData(string api = null, string clientRequestId = null, string requestId = null, string url = null, string recursive = null, string sequencer = null, string identity = null, System.Collections.Generic.IReadOnlyDictionary storageDiagnostics = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryRenamedEventData StorageDirectoryRenamedEventData(string api = null, string clientRequestId = null, string requestId = null, string sourceUrl = null, string destinationUrl = null, string sequencer = null, string identity = null, System.Collections.Generic.IReadOnlyDictionary storageDiagnostics = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail StorageLifecyclePolicyActionSummaryDetail(long? totalObjectsCount = default(long?), long? successCount = default(long?), string errorList = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyCompletedEventData StorageLifecyclePolicyCompletedEventData(string scheduleTime = null, Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail deleteSummary = null, Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail tierToCoolSummary = null, Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail tierToArchiveSummary = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedEventData StorageTaskAssignmentCompletedEventData(Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedStatus status = default(Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedStatus), System.DateTimeOffset completedOn = default(System.DateTimeOffset), string taskExecutionId = null, string taskName = null, System.Uri summaryReportBlobUri = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentQueuedEventData StorageTaskAssignmentQueuedEventData(System.DateTimeOffset queuedOn = default(System.DateTimeOffset), string taskExecutionId = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedEventData StorageTaskCompletedEventData(Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedStatus status = default(Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedStatus), System.DateTimeOffset completedDateTime = default(System.DateTimeOffset), string taskExecutionId = null, string taskName = null, System.Uri summaryReportBlobUrl = null) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.StorageTaskQueuedEventData StorageTaskQueuedEventData(System.DateTimeOffset queuedDateTime = default(System.DateTimeOffset), string taskExecutionId = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedEventData StorageTaskAssignmentCompletedEventData(Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedStatus? status = default(Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedStatus?), System.DateTimeOffset? completedOn = default(System.DateTimeOffset?), string taskExecutionId = null, string taskName = null, System.Uri summaryReportBlobUri = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentQueuedEventData StorageTaskAssignmentQueuedEventData(System.DateTimeOffset? queuedOn = default(System.DateTimeOffset?), string taskExecutionId = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedEventData StorageTaskCompletedEventData(Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedStatus? status = default(Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedStatus?), System.DateTimeOffset? completedDateTime = default(System.DateTimeOffset?), string taskExecutionId = null, string taskName = null, System.Uri summaryReportBlobUrl = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageTaskQueuedEventData StorageTaskQueuedEventData(System.DateTimeOffset? queuedDateTime = default(System.DateTimeOffset?), string taskExecutionId = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.SubscriptionDeletedEventData SubscriptionDeletedEventData(string eventSubscriptionId = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.SubscriptionValidationEventData SubscriptionValidationEventData(string validationCode = null, string validationUrl = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.SubscriptionValidationResponse SubscriptionValidationResponse(string validationResponse = null) { throw null; } @@ -2557,9 +2557,9 @@ internal EventHubCaptureFileCreatedEventData() { } public int? EventCount { get { throw null; } } public string FileType { get { throw null; } } public string Fileurl { get { throw null; } } - public System.DateTimeOffset FirstEnqueueTime { get { throw null; } } + public System.DateTimeOffset? FirstEnqueueTime { get { throw null; } } public int? FirstSequenceNumber { get { throw null; } } - public System.DateTimeOffset LastEnqueueTime { get { throw null; } } + public System.DateTimeOffset? LastEnqueueTime { get { throw null; } } public int? LastSequenceNumber { get { throw null; } } public string PartitionId { get { throw null; } } public int? SizeInBytes { get { throw null; } } @@ -2618,7 +2618,7 @@ public partial class HealthcareFhirResourceCreatedEventData : System.ClientModel { internal HealthcareFhirResourceCreatedEventData() { } public string FhirResourceId { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType FhirResourceType { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType? FhirResourceType { get { throw null; } } public long? FhirResourceVersionId { get { throw null; } } public string FhirServiceHostName { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2631,7 +2631,7 @@ public partial class HealthcareFhirResourceDeletedEventData : System.ClientModel { internal HealthcareFhirResourceDeletedEventData() { } public string FhirResourceId { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType FhirResourceType { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType? FhirResourceType { get { throw null; } } public long? FhirResourceVersionId { get { throw null; } } public string FhirServiceHostName { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2821,7 +2821,7 @@ public partial class HealthcareFhirResourceUpdatedEventData : System.ClientModel { internal HealthcareFhirResourceUpdatedEventData() { } public string FhirResourceId { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType FhirResourceType { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceType? FhirResourceType { get { throw null; } } public long? FhirResourceVersionId { get { throw null; } } public string FhirServiceHostName { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.HealthcareFhirResourceUpdatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3042,9 +3042,9 @@ internal MachineLearningServicesDatasetDriftDetectedEventData() { } public string DataDriftId { get { throw null; } } public string DataDriftName { get { throw null; } } public double? DriftCoefficient { get { throw null; } } - public System.DateTimeOffset EndTime { get { throw null; } } + public System.DateTimeOffset? EndTime { get { throw null; } } public string RunId { get { throw null; } } - public System.DateTimeOffset StartTime { get { throw null; } } + public System.DateTimeOffset? StartTime { get { throw null; } } public string TargetDatasetId { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.MachineLearningServicesDatasetDriftDetectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -3187,11 +3187,11 @@ internal MediaJobCancelingEventData() { } public partial class MediaJobError : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal MediaJobError() { } - public Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory Category { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode Code { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategory? Category { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCode? Code { get { throw null; } } public System.Collections.Generic.IReadOnlyList Details { get { throw null; } } public string Message { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.MediaJobRetry Retry { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.MediaJobRetry? Retry { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.MediaJobError System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.MediaJobError System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3279,11 +3279,11 @@ internal MediaJobFinishedEventData() { } } public abstract partial class MediaJobOutput : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - protected MediaJobOutput(Azure.Messaging.EventGrid.SystemEvents.MediaJobError error, long progress, Azure.Messaging.EventGrid.SystemEvents.MediaJobState state) { } + protected MediaJobOutput(Azure.Messaging.EventGrid.SystemEvents.MediaJobError error, long progress) { } public Azure.Messaging.EventGrid.SystemEvents.MediaJobError Error { get { throw null; } } public string Label { get { throw null; } } public long Progress { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.MediaJobState State { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.MediaJobState? State { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3292,7 +3292,7 @@ protected MediaJobOutput(Azure.Messaging.EventGrid.SystemEvents.MediaJobError er } public partial class MediaJobOutputAsset : Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal MediaJobOutputAsset() : base (default(Azure.Messaging.EventGrid.SystemEvents.MediaJobError), default(long), default(Azure.Messaging.EventGrid.SystemEvents.MediaJobState)) { } + internal MediaJobOutputAsset() : base (default(Azure.Messaging.EventGrid.SystemEvents.MediaJobError), default(long)) { } public string AssetName { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputAsset System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -3371,7 +3371,7 @@ public partial class MediaJobOutputStateChangeEventData : System.ClientModel.Pri internal MediaJobOutputStateChangeEventData() { } public System.Collections.Generic.IReadOnlyDictionary JobCorrelationData { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput Output { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.MediaJobState PreviousState { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.MediaJobState? PreviousState { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputStateChangeEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputStateChangeEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3441,8 +3441,8 @@ public partial class MediaJobStateChangeEventData : System.ClientModel.Primitive { internal MediaJobStateChangeEventData() { } public System.Collections.Generic.IReadOnlyDictionary CorrelationData { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.MediaJobState PreviousState { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.MediaJobState State { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.MediaJobState? PreviousState { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.MediaJobState? State { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.MediaJobStateChangeEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.MediaJobStateChangeEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3608,7 +3608,7 @@ public partial class MicrosoftTeamsAppIdentifierModel : System.ClientModel.Primi { internal MicrosoftTeamsAppIdentifierModel() { } public string AppId { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel Cloud { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel? Cloud { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsAppIdentifierModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsAppIdentifierModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3618,7 +3618,7 @@ internal MicrosoftTeamsAppIdentifierModel() { } public partial class MicrosoftTeamsUserIdentifierModel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal MicrosoftTeamsUserIdentifierModel() { } - public Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel Cloud { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel? Cloud { get { throw null; } } public bool? IsAnonymous { get { throw null; } } public string UserId { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsUserIdentifierModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3646,7 +3646,7 @@ internal PolicyInsightsPolicyStateChangedEventData() { } public string PolicyDefinitionId { get { throw null; } } public string PolicyDefinitionReferenceId { get { throw null; } } public string SubscriptionId { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateChangedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateChangedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3662,7 +3662,7 @@ internal PolicyInsightsPolicyStateCreatedEventData() { } public string PolicyDefinitionId { get { throw null; } } public string PolicyDefinitionReferenceId { get { throw null; } } public string SubscriptionId { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateCreatedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateCreatedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3678,7 +3678,7 @@ internal PolicyInsightsPolicyStateDeletedEventData() { } public string PolicyDefinitionId { get { throw null; } } public string PolicyDefinitionReferenceId { get { throw null; } } public string SubscriptionId { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateDeletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.PolicyInsightsPolicyStateDeletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3740,36 +3740,36 @@ internal PolicyInsightsPolicyStateDeletedEventData() { } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.RecordingFormatType left, Azure.Messaging.EventGrid.SystemEvents.RecordingFormatType right) { throw null; } public override string ToString() { throw null; } } - public partial class RedisExportRDBCompletedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class RedisExportRdbCompletedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal RedisExportRDBCompletedEventData() { } + internal RedisExportRdbCompletedEventData() { } public string Name { get { throw null; } } public string Status { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } - Azure.Messaging.EventGrid.SystemEvents.RedisExportRDBCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.RedisExportRDBCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public System.DateTimeOffset? Timestamp { get { throw null; } } + Azure.Messaging.EventGrid.SystemEvents.RedisExportRdbCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Messaging.EventGrid.SystemEvents.RedisExportRdbCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class RedisImportRDBCompletedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class RedisImportRdbCompletedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal RedisImportRDBCompletedEventData() { } + internal RedisImportRdbCompletedEventData() { } public string Name { get { throw null; } } public string Status { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } - Azure.Messaging.EventGrid.SystemEvents.RedisImportRDBCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.Messaging.EventGrid.SystemEvents.RedisImportRDBCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public System.DateTimeOffset? Timestamp { get { throw null; } } + Azure.Messaging.EventGrid.SystemEvents.RedisImportRdbCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Messaging.EventGrid.SystemEvents.RedisImportRdbCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } public partial class RedisPatchingCompletedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal RedisPatchingCompletedEventData() { } public string Name { get { throw null; } } public string Status { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.RedisPatchingCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.RedisPatchingCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3781,7 +3781,7 @@ public partial class RedisScalingCompletedEventData : System.ClientModel.Primiti internal RedisScalingCompletedEventData() { } public string Name { get { throw null; } } public string Status { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.RedisScalingCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.RedisScalingCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3954,7 +3954,7 @@ internal ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData( public partial class ResourceNotificationsOperationalDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ResourceNotificationsOperationalDetails() { } - public System.DateTimeOffset ResourceEventTime { get { throw null; } } + public System.DateTimeOffset? ResourceEventTime { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4154,7 +4154,7 @@ public partial class SignalRServiceClientConnectionConnectedEventData : System.C internal SignalRServiceClientConnectionConnectedEventData() { } public string ConnectionId { get { throw null; } } public string HubName { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } public string UserId { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionConnectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -4168,7 +4168,7 @@ internal SignalRServiceClientConnectionDisconnectedEventData() { } public string ConnectionId { get { throw null; } } public string ErrorMessage { get { throw null; } } public string HubName { get { throw null; } } - public System.DateTimeOffset Timestamp { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } public string UserId { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionDisconnectedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -4214,9 +4214,31 @@ internal StorageAsyncOperationInitiatedEventData() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct StorageBlobAccessTier : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public StorageBlobAccessTier(string value) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier Archive { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier Cold { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier Cool { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier Default { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier Hot { get { throw null; } } + public bool Equals(Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier left, Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier right) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier (string value) { throw null; } + public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier left, Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier right) { throw null; } + public override string ToString() { throw null; } + } public partial class StorageBlobCreatedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal StorageBlobCreatedEventData() { } + public Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier AccessTier { get { throw null; } } public string Api { get { throw null; } } public string BlobType { get { throw null; } } public string ClientRequestId { get { throw null; } } @@ -4262,7 +4284,7 @@ internal StorageBlobInventoryPolicyCompletedEventData() { } public string PolicyRunStatus { get { throw null; } } public string PolicyRunStatusMessage { get { throw null; } } public string RuleName { get { throw null; } } - public System.DateTimeOffset ScheduleDateTime { get { throw null; } } + public System.DateTimeOffset? ScheduleDateTime { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.StorageBlobInventoryPolicyCompletedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Messaging.EventGrid.SystemEvents.StorageBlobInventoryPolicyCompletedEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4289,12 +4311,14 @@ internal StorageBlobRenamedEventData() { } public partial class StorageBlobTierChangedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal StorageBlobTierChangedEventData() { } + public Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier AccessTier { get { throw null; } } public string Api { get { throw null; } } public string BlobType { get { throw null; } } public string ClientRequestId { get { throw null; } } public long? ContentLength { get { throw null; } } public string ContentType { get { throw null; } } public string Identity { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier PreviousTier { get { throw null; } } public string RequestId { get { throw null; } } public string Sequencer { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary StorageDiagnostics { get { throw null; } } @@ -4384,8 +4408,8 @@ internal StorageLifecyclePolicyCompletedEventData() { } public partial class StorageTaskAssignmentCompletedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal StorageTaskAssignmentCompletedEventData() { } - public System.DateTimeOffset CompletedOn { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedStatus Status { get { throw null; } } + public System.DateTimeOffset? CompletedOn { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedStatus? Status { get { throw null; } } public System.Uri SummaryReportBlobUri { get { throw null; } } public string TaskExecutionId { get { throw null; } } public string TaskName { get { throw null; } } @@ -4416,7 +4440,7 @@ internal StorageTaskAssignmentCompletedEventData() { } public partial class StorageTaskAssignmentQueuedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal StorageTaskAssignmentQueuedEventData() { } - public System.DateTimeOffset QueuedOn { get { throw null; } } + public System.DateTimeOffset? QueuedOn { get { throw null; } } public string TaskExecutionId { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentQueuedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -4427,8 +4451,8 @@ internal StorageTaskAssignmentQueuedEventData() { } public partial class StorageTaskCompletedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal StorageTaskCompletedEventData() { } - public System.DateTimeOffset CompletedDateTime { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedStatus Status { get { throw null; } } + public System.DateTimeOffset? CompletedDateTime { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedStatus? Status { get { throw null; } } public System.Uri SummaryReportBlobUrl { get { throw null; } } public string TaskExecutionId { get { throw null; } } public string TaskName { get { throw null; } } @@ -4459,7 +4483,7 @@ internal StorageTaskCompletedEventData() { } public partial class StorageTaskQueuedEventData : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal StorageTaskQueuedEventData() { } - public System.DateTimeOffset QueuedDateTime { get { throw null; } } + public System.DateTimeOffset? QueuedDateTime { get { throw null; } } public string TaskExecutionId { get { throw null; } } Azure.Messaging.EventGrid.SystemEvents.StorageTaskQueuedEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -4604,10 +4628,10 @@ public static partial class SystemEventNames public const string DataBoxCopyCompleted = "Microsoft.DataBox.CopyCompleted"; public const string DataBoxCopyStarted = "Microsoft.DataBox.CopyStarted"; public const string DataBoxOrderCompleted = "Microsoft.DataBox.OrderCompleted"; - public const string EventGridMQTTClientCreatedOrUpdated = "Microsoft.EventGrid.MQTTClientCreatedOrUpdated"; - public const string EventGridMQTTClientDeleted = "Microsoft.EventGrid.MQTTClientDeleted"; - public const string EventGridMQTTClientSessionConnected = "Microsoft.EventGrid.MQTTClientSessionConnected"; - public const string EventGridMQTTClientSessionDisconnected = "Microsoft.EventGrid.MQTTClientSessionDisconnected"; + public const string EventGridMqttClientCreatedOrUpdated = "Microsoft.EventGrid.MQTTClientCreatedOrUpdated"; + public const string EventGridMqttClientDeleted = "Microsoft.EventGrid.MQTTClientDeleted"; + public const string EventGridMqttClientSessionConnected = "Microsoft.EventGrid.MQTTClientSessionConnected"; + public const string EventGridMqttClientSessionDisconnected = "Microsoft.EventGrid.MQTTClientSessionDisconnected"; public const string EventGridSubscriptionDeleted = "Microsoft.EventGrid.SubscriptionDeletedEvent"; public const string EventGridSubscriptionValidation = "Microsoft.EventGrid.SubscriptionValidationEvent"; public const string EventHubCaptureFileCreated = "Microsoft.EventHub.CaptureFileCreated"; @@ -4668,8 +4692,8 @@ public static partial class SystemEventNames public const string PolicyInsightsPolicyStateChanged = "Microsoft.PolicyInsights.PolicyStateChanged"; public const string PolicyInsightsPolicyStateCreated = "Microsoft.PolicyInsights.PolicyStateCreated"; public const string PolicyInsightsPolicyStateDeleted = "Microsoft.PolicyInsights.PolicyStateDeleted"; - public const string RedisExportRDBCompleted = "Microsoft.Cache.ExportRDBCompleted"; - public const string RedisImportRDBCompleted = "Microsoft.Cache.ImportRDBCompleted"; + public const string RedisExportRdbCompleted = "Microsoft.Cache.ExportRDBCompleted"; + public const string RedisImportRdbCompleted = "Microsoft.Cache.ImportRDBCompleted"; public const string RedisPatchingCompleted = "Microsoft.Cache.PatchingCompleted"; public const string RedisScalingCompleted = "Microsoft.Cache.ScalingCompleted"; public const string ResourceActionCancel = "Microsoft.Resources.ResourceActionCancel"; diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedEventData.Serialization.cs index e119d27c44d3..40761e19f713 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod } writer.WriteStartObject(); - writer.WritePropertyName("deleteTime"u8); - writer.WriteStringValue(DeleteTime, "O"); + if (Optional.IsDefined(DeleteTime)) + { + writer.WritePropertyName("deleteTime"u8); + writer.WriteStringValue(DeleteTime.Value, "O"); + } if (Optional.IsDefined(MessageId)) { writer.WritePropertyName("messageId"u8); @@ -40,8 +43,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod writer.WritePropertyName("senderDisplayName"u8); writer.WriteStringValue(SenderDisplayName); } - writer.WritePropertyName("composeTime"u8); - writer.WriteStringValue(ComposeTime, "O"); + if (Optional.IsDefined(ComposeTime)) + { + writer.WritePropertyName("composeTime"u8); + writer.WriteStringValue(ComposeTime.Value, "O"); + } if (Optional.IsDefined(Type)) { writer.WritePropertyName("type"u8); @@ -102,11 +108,11 @@ internal static AcsChatMessageDeletedEventData DeserializeAcsChatMessageDeletedE { return null; } - DateTimeOffset deleteTime = default; + DateTimeOffset? deleteTime = default; string messageId = default; CommunicationIdentifierModel senderCommunicationIdentifier = default; string senderDisplayName = default; - DateTimeOffset composeTime = default; + DateTimeOffset? composeTime = default; string type = default; long? version = default; CommunicationIdentifierModel recipientCommunicationIdentifier = default; @@ -118,6 +124,10 @@ internal static AcsChatMessageDeletedEventData DeserializeAcsChatMessageDeletedE { if (property.NameEquals("deleteTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } deleteTime = property.Value.GetDateTimeOffset("O"); continue; } @@ -138,6 +148,10 @@ internal static AcsChatMessageDeletedEventData DeserializeAcsChatMessageDeletedE } if (property.NameEquals("composeTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } composeTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedEventData.cs index 29bd2123a788..5f6a22502794 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedEventData.cs @@ -16,15 +16,11 @@ public partial class AcsChatMessageDeletedEventData : AcsChatMessageEventBasePro /// Initializes a new instance of . /// The communication identifier of the target user. /// The communication identifier of the sender. - /// The original compose time of the message. - /// The time at which the message was deleted. /// or is null. - internal AcsChatMessageDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel senderCommunicationIdentifier, DateTimeOffset composeTime, DateTimeOffset deleteTime) : base(recipientCommunicationIdentifier, senderCommunicationIdentifier, composeTime) + internal AcsChatMessageDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel senderCommunicationIdentifier) : base(recipientCommunicationIdentifier, senderCommunicationIdentifier) { Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier)); Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier)); - - DeleteTime = deleteTime; } /// Initializes a new instance of . @@ -39,7 +35,7 @@ internal AcsChatMessageDeletedEventData(CommunicationIdentifierModel recipientCo /// The type of the message. /// The version of the message. /// The time at which the message was deleted. - internal AcsChatMessageDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset composeTime, string type, long? version, DateTimeOffset deleteTime) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version) + internal AcsChatMessageDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version, DateTimeOffset? deleteTime) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version) { DeleteTime = deleteTime; } @@ -50,6 +46,6 @@ internal AcsChatMessageDeletedEventData() } /// The time at which the message was deleted. - public DateTimeOffset DeleteTime { get; } + public DateTimeOffset? DeleteTime { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedInThreadEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedInThreadEventData.Serialization.cs index 7d5664edf25f..01c09eb8b6c9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedInThreadEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedInThreadEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter wri } writer.WriteStartObject(); - writer.WritePropertyName("deleteTime"u8); - writer.WriteStringValue(DeleteTime, "O"); + if (Optional.IsDefined(DeleteTime)) + { + writer.WritePropertyName("deleteTime"u8); + writer.WriteStringValue(DeleteTime.Value, "O"); + } if (Optional.IsDefined(MessageId)) { writer.WritePropertyName("messageId"u8); @@ -40,8 +43,11 @@ void IJsonModel.Write(Utf8JsonWriter wri writer.WritePropertyName("senderDisplayName"u8); writer.WriteStringValue(SenderDisplayName); } - writer.WritePropertyName("composeTime"u8); - writer.WriteStringValue(ComposeTime, "O"); + if (Optional.IsDefined(ComposeTime)) + { + writer.WritePropertyName("composeTime"u8); + writer.WriteStringValue(ComposeTime.Value, "O"); + } if (Optional.IsDefined(Type)) { writer.WritePropertyName("type"u8); @@ -100,11 +106,11 @@ internal static AcsChatMessageDeletedInThreadEventData DeserializeAcsChatMessage { return null; } - DateTimeOffset deleteTime = default; + DateTimeOffset? deleteTime = default; string messageId = default; CommunicationIdentifierModel senderCommunicationIdentifier = default; string senderDisplayName = default; - DateTimeOffset composeTime = default; + DateTimeOffset? composeTime = default; string type = default; long? version = default; string transactionId = default; @@ -115,6 +121,10 @@ internal static AcsChatMessageDeletedInThreadEventData DeserializeAcsChatMessage { if (property.NameEquals("deleteTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } deleteTime = property.Value.GetDateTimeOffset("O"); continue; } @@ -135,6 +145,10 @@ internal static AcsChatMessageDeletedInThreadEventData DeserializeAcsChatMessage } if (property.NameEquals("composeTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } composeTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedInThreadEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedInThreadEventData.cs index fdf50c683027..36a7b77ba1a3 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedInThreadEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedInThreadEventData.cs @@ -15,14 +15,10 @@ public partial class AcsChatMessageDeletedInThreadEventData : AcsChatMessageEven { /// Initializes a new instance of . /// The communication identifier of the sender. - /// The original compose time of the message. - /// The time at which the message was deleted. /// is null. - internal AcsChatMessageDeletedInThreadEventData(CommunicationIdentifierModel senderCommunicationIdentifier, DateTimeOffset composeTime, DateTimeOffset deleteTime) : base(senderCommunicationIdentifier, composeTime) + internal AcsChatMessageDeletedInThreadEventData(CommunicationIdentifierModel senderCommunicationIdentifier) : base(senderCommunicationIdentifier) { Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier)); - - DeleteTime = deleteTime; } /// Initializes a new instance of . @@ -36,7 +32,7 @@ internal AcsChatMessageDeletedInThreadEventData(CommunicationIdentifierModel sen /// The type of the message. /// The version of the message. /// The time at which the message was deleted. - internal AcsChatMessageDeletedInThreadEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset composeTime, string type, long? version, DateTimeOffset deleteTime) : base(transactionId, threadId, serializedAdditionalRawData, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version) + internal AcsChatMessageDeletedInThreadEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version, DateTimeOffset? deleteTime) : base(transactionId, threadId, serializedAdditionalRawData, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version) { DeleteTime = deleteTime; } @@ -47,6 +43,6 @@ internal AcsChatMessageDeletedInThreadEventData() } /// The time at which the message was deleted. - public DateTimeOffset DeleteTime { get; } + public DateTimeOffset? DeleteTime { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedEventData.Serialization.cs index 73612534305b..ba4f0b0d34e3 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedEventData.Serialization.cs @@ -39,8 +39,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode writer.WriteStringValue(item.Value); } writer.WriteEndObject(); - writer.WritePropertyName("editTime"u8); - writer.WriteStringValue(EditTime, "O"); + if (Optional.IsDefined(EditTime)) + { + writer.WritePropertyName("editTime"u8); + writer.WriteStringValue(EditTime.Value, "O"); + } if (Optional.IsDefined(MessageId)) { writer.WritePropertyName("messageId"u8); @@ -53,8 +56,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode writer.WritePropertyName("senderDisplayName"u8); writer.WriteStringValue(SenderDisplayName); } - writer.WritePropertyName("composeTime"u8); - writer.WriteStringValue(ComposeTime, "O"); + if (Optional.IsDefined(ComposeTime)) + { + writer.WritePropertyName("composeTime"u8); + writer.WriteStringValue(ComposeTime.Value, "O"); + } if (Optional.IsDefined(Type)) { writer.WritePropertyName("type"u8); @@ -117,11 +123,11 @@ internal static AcsChatMessageEditedEventData DeserializeAcsChatMessageEditedEve } string messageBody = default; IReadOnlyDictionary metadata = default; - DateTimeOffset editTime = default; + DateTimeOffset? editTime = default; string messageId = default; CommunicationIdentifierModel senderCommunicationIdentifier = default; string senderDisplayName = default; - DateTimeOffset composeTime = default; + DateTimeOffset? composeTime = default; string type = default; long? version = default; CommunicationIdentifierModel recipientCommunicationIdentifier = default; @@ -148,6 +154,10 @@ internal static AcsChatMessageEditedEventData DeserializeAcsChatMessageEditedEve } if (property.NameEquals("editTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } editTime = property.Value.GetDateTimeOffset("O"); continue; } @@ -168,6 +178,10 @@ internal static AcsChatMessageEditedEventData DeserializeAcsChatMessageEditedEve } if (property.NameEquals("composeTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } composeTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedEventData.cs index 92f3f537ac6c..b124a0af4025 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedEventData.cs @@ -16,18 +16,15 @@ public partial class AcsChatMessageEditedEventData : AcsChatMessageEventBaseProp /// Initializes a new instance of . /// The communication identifier of the target user. /// The communication identifier of the sender. - /// The original compose time of the message. /// The chat message metadata. - /// The time at which the message was edited. /// , or is null. - internal AcsChatMessageEditedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel senderCommunicationIdentifier, DateTimeOffset composeTime, IReadOnlyDictionary metadata, DateTimeOffset editTime) : base(recipientCommunicationIdentifier, senderCommunicationIdentifier, composeTime) + internal AcsChatMessageEditedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel senderCommunicationIdentifier, IReadOnlyDictionary metadata) : base(recipientCommunicationIdentifier, senderCommunicationIdentifier) { Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier)); Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier)); Argument.AssertNotNull(metadata, nameof(metadata)); Metadata = metadata; - EditTime = editTime; } /// Initializes a new instance of . @@ -44,7 +41,7 @@ internal AcsChatMessageEditedEventData(CommunicationIdentifierModel recipientCom /// The body of the chat message. /// The chat message metadata. /// The time at which the message was edited. - internal AcsChatMessageEditedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset composeTime, string type, long? version, string messageBody, IReadOnlyDictionary metadata, DateTimeOffset editTime) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version) + internal AcsChatMessageEditedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version, string messageBody, IReadOnlyDictionary metadata, DateTimeOffset? editTime) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version) { MessageBody = messageBody; Metadata = metadata; @@ -61,6 +58,6 @@ internal AcsChatMessageEditedEventData() /// The chat message metadata. public IReadOnlyDictionary Metadata { get; } /// The time at which the message was edited. - public DateTimeOffset EditTime { get; } + public DateTimeOffset? EditTime { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedInThreadEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedInThreadEventData.Serialization.cs index 5caa33f2df29..52c02562502e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedInThreadEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedInThreadEventData.Serialization.cs @@ -39,8 +39,11 @@ void IJsonModel.Write(Utf8JsonWriter writ writer.WriteStringValue(item.Value); } writer.WriteEndObject(); - writer.WritePropertyName("editTime"u8); - writer.WriteStringValue(EditTime, "O"); + if (Optional.IsDefined(EditTime)) + { + writer.WritePropertyName("editTime"u8); + writer.WriteStringValue(EditTime.Value, "O"); + } if (Optional.IsDefined(MessageId)) { writer.WritePropertyName("messageId"u8); @@ -53,8 +56,11 @@ void IJsonModel.Write(Utf8JsonWriter writ writer.WritePropertyName("senderDisplayName"u8); writer.WriteStringValue(SenderDisplayName); } - writer.WritePropertyName("composeTime"u8); - writer.WriteStringValue(ComposeTime, "O"); + if (Optional.IsDefined(ComposeTime)) + { + writer.WritePropertyName("composeTime"u8); + writer.WriteStringValue(ComposeTime.Value, "O"); + } if (Optional.IsDefined(Type)) { writer.WritePropertyName("type"u8); @@ -115,11 +121,11 @@ internal static AcsChatMessageEditedInThreadEventData DeserializeAcsChatMessageE } string messageBody = default; IReadOnlyDictionary metadata = default; - DateTimeOffset editTime = default; + DateTimeOffset? editTime = default; string messageId = default; CommunicationIdentifierModel senderCommunicationIdentifier = default; string senderDisplayName = default; - DateTimeOffset composeTime = default; + DateTimeOffset? composeTime = default; string type = default; long? version = default; string transactionId = default; @@ -145,6 +151,10 @@ internal static AcsChatMessageEditedInThreadEventData DeserializeAcsChatMessageE } if (property.NameEquals("editTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } editTime = property.Value.GetDateTimeOffset("O"); continue; } @@ -165,6 +175,10 @@ internal static AcsChatMessageEditedInThreadEventData DeserializeAcsChatMessageE } if (property.NameEquals("composeTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } composeTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedInThreadEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedInThreadEventData.cs index 99134233639c..70250f33da52 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedInThreadEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedInThreadEventData.cs @@ -15,17 +15,14 @@ public partial class AcsChatMessageEditedInThreadEventData : AcsChatMessageEvent { /// Initializes a new instance of . /// The communication identifier of the sender. - /// The original compose time of the message. /// The chat message metadata. - /// The time at which the message was edited. /// or is null. - internal AcsChatMessageEditedInThreadEventData(CommunicationIdentifierModel senderCommunicationIdentifier, DateTimeOffset composeTime, IReadOnlyDictionary metadata, DateTimeOffset editTime) : base(senderCommunicationIdentifier, composeTime) + internal AcsChatMessageEditedInThreadEventData(CommunicationIdentifierModel senderCommunicationIdentifier, IReadOnlyDictionary metadata) : base(senderCommunicationIdentifier) { Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier)); Argument.AssertNotNull(metadata, nameof(metadata)); Metadata = metadata; - EditTime = editTime; } /// Initializes a new instance of . @@ -41,7 +38,7 @@ internal AcsChatMessageEditedInThreadEventData(CommunicationIdentifierModel send /// The body of the chat message. /// The chat message metadata. /// The time at which the message was edited. - internal AcsChatMessageEditedInThreadEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset composeTime, string type, long? version, string messageBody, IReadOnlyDictionary metadata, DateTimeOffset editTime) : base(transactionId, threadId, serializedAdditionalRawData, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version) + internal AcsChatMessageEditedInThreadEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version, string messageBody, IReadOnlyDictionary metadata, DateTimeOffset? editTime) : base(transactionId, threadId, serializedAdditionalRawData, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version) { MessageBody = messageBody; Metadata = metadata; @@ -58,6 +55,6 @@ internal AcsChatMessageEditedInThreadEventData() /// The chat message metadata. public IReadOnlyDictionary Metadata { get; } /// The time at which the message was edited. - public DateTimeOffset EditTime { get; } + public DateTimeOffset? EditTime { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventBaseProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventBaseProperties.Serialization.cs index e91d6c8d1ec1..fd64fd00f375 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventBaseProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventBaseProperties.Serialization.cs @@ -38,8 +38,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WritePropertyName("senderDisplayName"u8); writer.WriteStringValue(SenderDisplayName); } - writer.WritePropertyName("composeTime"u8); - writer.WriteStringValue(ComposeTime, "O"); + if (Optional.IsDefined(ComposeTime)) + { + writer.WritePropertyName("composeTime"u8); + writer.WriteStringValue(ComposeTime.Value, "O"); + } if (Optional.IsDefined(Type)) { writer.WritePropertyName("type"u8); @@ -103,7 +106,7 @@ internal static AcsChatMessageEventBaseProperties DeserializeAcsChatMessageEvent string messageId = default; CommunicationIdentifierModel senderCommunicationIdentifier = default; string senderDisplayName = default; - DateTimeOffset composeTime = default; + DateTimeOffset? composeTime = default; string type = default; long? version = default; CommunicationIdentifierModel recipientCommunicationIdentifier = default; @@ -130,6 +133,10 @@ internal static AcsChatMessageEventBaseProperties DeserializeAcsChatMessageEvent } if (property.NameEquals("composeTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } composeTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventBaseProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventBaseProperties.cs index d0109a86be03..0d2231a308ce 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventBaseProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventBaseProperties.cs @@ -16,15 +16,13 @@ public partial class AcsChatMessageEventBaseProperties : AcsChatEventBasePropert /// Initializes a new instance of . /// The communication identifier of the target user. /// The communication identifier of the sender. - /// The original compose time of the message. /// or is null. - internal AcsChatMessageEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel senderCommunicationIdentifier, DateTimeOffset composeTime) : base(recipientCommunicationIdentifier) + internal AcsChatMessageEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel senderCommunicationIdentifier) : base(recipientCommunicationIdentifier) { Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier)); Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier)); SenderCommunicationIdentifier = senderCommunicationIdentifier; - ComposeTime = composeTime; } /// Initializes a new instance of . @@ -38,7 +36,7 @@ internal AcsChatMessageEventBaseProperties(CommunicationIdentifierModel recipien /// The original compose time of the message. /// The type of the message. /// The version of the message. - internal AcsChatMessageEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset composeTime, string type, long? version) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData) + internal AcsChatMessageEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData) { MessageId = messageId; SenderCommunicationIdentifier = senderCommunicationIdentifier; @@ -60,7 +58,7 @@ internal AcsChatMessageEventBaseProperties() /// The display name of the sender. public string SenderDisplayName { get; } /// The original compose time of the message. - public DateTimeOffset ComposeTime { get; } + public DateTimeOffset? ComposeTime { get; } /// The type of the message. public string Type { get; } /// The version of the message. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventInThreadBaseProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventInThreadBaseProperties.Serialization.cs index 86cfe4a2d5a6..ceb1b1a5f639 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventInThreadBaseProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventInThreadBaseProperties.Serialization.cs @@ -38,8 +38,11 @@ void IJsonModel.Write(Utf8JsonWriter writer.WritePropertyName("senderDisplayName"u8); writer.WriteStringValue(SenderDisplayName); } - writer.WritePropertyName("composeTime"u8); - writer.WriteStringValue(ComposeTime, "O"); + if (Optional.IsDefined(ComposeTime)) + { + writer.WritePropertyName("composeTime"u8); + writer.WriteStringValue(ComposeTime.Value, "O"); + } if (Optional.IsDefined(Type)) { writer.WritePropertyName("type"u8); @@ -101,7 +104,7 @@ internal static AcsChatMessageEventInThreadBaseProperties DeserializeAcsChatMess string messageId = default; CommunicationIdentifierModel senderCommunicationIdentifier = default; string senderDisplayName = default; - DateTimeOffset composeTime = default; + DateTimeOffset? composeTime = default; string type = default; long? version = default; string transactionId = default; @@ -127,6 +130,10 @@ internal static AcsChatMessageEventInThreadBaseProperties DeserializeAcsChatMess } if (property.NameEquals("composeTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } composeTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventInThreadBaseProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventInThreadBaseProperties.cs index 72fdab5e25f7..3ae4acc44ddd 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventInThreadBaseProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventInThreadBaseProperties.cs @@ -15,14 +15,12 @@ public partial class AcsChatMessageEventInThreadBaseProperties : AcsChatEventInT { /// Initializes a new instance of . /// The communication identifier of the sender. - /// The original compose time of the message. /// is null. - internal AcsChatMessageEventInThreadBaseProperties(CommunicationIdentifierModel senderCommunicationIdentifier, DateTimeOffset composeTime) + internal AcsChatMessageEventInThreadBaseProperties(CommunicationIdentifierModel senderCommunicationIdentifier) { Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier)); SenderCommunicationIdentifier = senderCommunicationIdentifier; - ComposeTime = composeTime; } /// Initializes a new instance of . @@ -35,7 +33,7 @@ internal AcsChatMessageEventInThreadBaseProperties(CommunicationIdentifierModel /// The original compose time of the message. /// The type of the message. /// The version of the message. - internal AcsChatMessageEventInThreadBaseProperties(string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset composeTime, string type, long? version) : base(transactionId, threadId, serializedAdditionalRawData) + internal AcsChatMessageEventInThreadBaseProperties(string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version) : base(transactionId, threadId, serializedAdditionalRawData) { MessageId = messageId; SenderCommunicationIdentifier = senderCommunicationIdentifier; @@ -57,7 +55,7 @@ internal AcsChatMessageEventInThreadBaseProperties() /// The display name of the sender. public string SenderDisplayName { get; } /// The original compose time of the message. - public DateTimeOffset ComposeTime { get; } + public DateTimeOffset? ComposeTime { get; } /// The type of the message. public string Type { get; } /// The version of the message. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedEventData.Serialization.cs index de232d602072..33da4e20bebe 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedEventData.Serialization.cs @@ -51,8 +51,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo writer.WritePropertyName("senderDisplayName"u8); writer.WriteStringValue(SenderDisplayName); } - writer.WritePropertyName("composeTime"u8); - writer.WriteStringValue(ComposeTime, "O"); + if (Optional.IsDefined(ComposeTime)) + { + writer.WritePropertyName("composeTime"u8); + writer.WriteStringValue(ComposeTime.Value, "O"); + } if (Optional.IsDefined(Type)) { writer.WritePropertyName("type"u8); @@ -118,7 +121,7 @@ internal static AcsChatMessageReceivedEventData DeserializeAcsChatMessageReceive string messageId = default; CommunicationIdentifierModel senderCommunicationIdentifier = default; string senderDisplayName = default; - DateTimeOffset composeTime = default; + DateTimeOffset? composeTime = default; string type = default; long? version = default; CommunicationIdentifierModel recipientCommunicationIdentifier = default; @@ -160,6 +163,10 @@ internal static AcsChatMessageReceivedEventData DeserializeAcsChatMessageReceive } if (property.NameEquals("composeTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } composeTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedEventData.cs index 2410db3e730b..1f9a4f91d206 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedEventData.cs @@ -16,10 +16,9 @@ public partial class AcsChatMessageReceivedEventData : AcsChatMessageEventBasePr /// Initializes a new instance of . /// The communication identifier of the target user. /// The communication identifier of the sender. - /// The original compose time of the message. /// The chat message metadata. /// , or is null. - internal AcsChatMessageReceivedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel senderCommunicationIdentifier, DateTimeOffset composeTime, IReadOnlyDictionary metadata) : base(recipientCommunicationIdentifier, senderCommunicationIdentifier, composeTime) + internal AcsChatMessageReceivedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel senderCommunicationIdentifier, IReadOnlyDictionary metadata) : base(recipientCommunicationIdentifier, senderCommunicationIdentifier) { Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier)); Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier)); @@ -41,7 +40,7 @@ internal AcsChatMessageReceivedEventData(CommunicationIdentifierModel recipientC /// The version of the message. /// The body of the chat message. /// The chat message metadata. - internal AcsChatMessageReceivedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset composeTime, string type, long? version, string messageBody, IReadOnlyDictionary metadata) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version) + internal AcsChatMessageReceivedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version, string messageBody, IReadOnlyDictionary metadata) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version) { MessageBody = messageBody; Metadata = metadata; diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedInThreadEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedInThreadEventData.Serialization.cs index 3f562ca687e2..0a01774108b9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedInThreadEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedInThreadEventData.Serialization.cs @@ -51,8 +51,11 @@ void IJsonModel.Write(Utf8JsonWriter wr writer.WritePropertyName("senderDisplayName"u8); writer.WriteStringValue(SenderDisplayName); } - writer.WritePropertyName("composeTime"u8); - writer.WriteStringValue(ComposeTime, "O"); + if (Optional.IsDefined(ComposeTime)) + { + writer.WritePropertyName("composeTime"u8); + writer.WriteStringValue(ComposeTime.Value, "O"); + } if (Optional.IsDefined(Type)) { writer.WritePropertyName("type"u8); @@ -116,7 +119,7 @@ internal static AcsChatMessageReceivedInThreadEventData DeserializeAcsChatMessag string messageId = default; CommunicationIdentifierModel senderCommunicationIdentifier = default; string senderDisplayName = default; - DateTimeOffset composeTime = default; + DateTimeOffset? composeTime = default; string type = default; long? version = default; string transactionId = default; @@ -157,6 +160,10 @@ internal static AcsChatMessageReceivedInThreadEventData DeserializeAcsChatMessag } if (property.NameEquals("composeTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } composeTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedInThreadEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedInThreadEventData.cs index 8698284721c1..c99363e44298 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedInThreadEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedInThreadEventData.cs @@ -15,10 +15,9 @@ public partial class AcsChatMessageReceivedInThreadEventData : AcsChatMessageEve { /// Initializes a new instance of . /// The communication identifier of the sender. - /// The original compose time of the message. /// The chat message metadata. /// or is null. - internal AcsChatMessageReceivedInThreadEventData(CommunicationIdentifierModel senderCommunicationIdentifier, DateTimeOffset composeTime, IReadOnlyDictionary metadata) : base(senderCommunicationIdentifier, composeTime) + internal AcsChatMessageReceivedInThreadEventData(CommunicationIdentifierModel senderCommunicationIdentifier, IReadOnlyDictionary metadata) : base(senderCommunicationIdentifier) { Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier)); Argument.AssertNotNull(metadata, nameof(metadata)); @@ -38,7 +37,7 @@ internal AcsChatMessageReceivedInThreadEventData(CommunicationIdentifierModel se /// The version of the message. /// The body of the chat message. /// The chat message metadata. - internal AcsChatMessageReceivedInThreadEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset composeTime, string type, long? version, string messageBody, IReadOnlyDictionary metadata) : base(transactionId, threadId, serializedAdditionalRawData, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version) + internal AcsChatMessageReceivedInThreadEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version, string messageBody, IReadOnlyDictionary metadata) : base(transactionId, threadId, serializedAdditionalRawData, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version) { MessageBody = messageBody; Metadata = metadata; diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadEventData.Serialization.cs index 8149e4a55184..76e4b55b686e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter w } writer.WriteStartObject(); - writer.WritePropertyName("time"u8); - writer.WriteStringValue(Time, "O"); + if (Optional.IsDefined(Time)) + { + writer.WritePropertyName("time"u8); + writer.WriteStringValue(Time.Value, "O"); + } writer.WritePropertyName("addedByCommunicationIdentifier"u8); writer.WriteObjectValue(AddedByCommunicationIdentifier, options); writer.WritePropertyName("participantAdded"u8); @@ -85,7 +88,7 @@ internal static AcsChatParticipantAddedToThreadEventData DeserializeAcsChatParti { return null; } - DateTimeOffset time = default; + DateTimeOffset? time = default; CommunicationIdentifierModel addedByCommunicationIdentifier = default; AcsChatThreadParticipantProperties participantAdded = default; long? version = default; @@ -97,6 +100,10 @@ internal static AcsChatParticipantAddedToThreadEventData DeserializeAcsChatParti { if (property.NameEquals("time"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } time = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadEventData.cs index 0c74e23af594..5ae69978e278 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadEventData.cs @@ -14,16 +14,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsChatParticipantAddedToThreadEventData : AcsChatEventInThreadBaseProperties { /// Initializes a new instance of . - /// The time at which the user was added to the thread. /// The communication identifier of the user who added the user. /// The details of the user who was added. /// or is null. - internal AcsChatParticipantAddedToThreadEventData(DateTimeOffset time, CommunicationIdentifierModel addedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantAdded) + internal AcsChatParticipantAddedToThreadEventData(CommunicationIdentifierModel addedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantAdded) { Argument.AssertNotNull(addedByCommunicationIdentifier, nameof(addedByCommunicationIdentifier)); Argument.AssertNotNull(participantAdded, nameof(participantAdded)); - Time = time; AddedByCommunicationIdentifier = addedByCommunicationIdentifier; ParticipantAdded = participantAdded; } @@ -36,7 +34,7 @@ internal AcsChatParticipantAddedToThreadEventData(DateTimeOffset time, Communica /// The communication identifier of the user who added the user. /// The details of the user who was added. /// The version of the thread. - internal AcsChatParticipantAddedToThreadEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset time, CommunicationIdentifierModel addedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantAdded, long? version) : base(transactionId, threadId, serializedAdditionalRawData) + internal AcsChatParticipantAddedToThreadEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset? time, CommunicationIdentifierModel addedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantAdded, long? version) : base(transactionId, threadId, serializedAdditionalRawData) { Time = time; AddedByCommunicationIdentifier = addedByCommunicationIdentifier; @@ -50,7 +48,7 @@ internal AcsChatParticipantAddedToThreadEventData() } /// The time at which the user was added to the thread. - public DateTimeOffset Time { get; } + public DateTimeOffset? Time { get; } /// The communication identifier of the user who added the user. public CommunicationIdentifierModel AddedByCommunicationIdentifier { get; } /// The details of the user who was added. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadWithUserEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadWithUserEventData.Serialization.cs index b105a0d9f4b5..ea812f2030ed 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadWithUserEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadWithUserEventData.Serialization.cs @@ -26,14 +26,20 @@ void IJsonModel.Write(Utf8Json } writer.WriteStartObject(); - writer.WritePropertyName("time"u8); - writer.WriteStringValue(Time, "O"); + if (Optional.IsDefined(Time)) + { + writer.WritePropertyName("time"u8); + writer.WriteStringValue(Time.Value, "O"); + } writer.WritePropertyName("addedByCommunicationIdentifier"u8); writer.WriteObjectValue(AddedByCommunicationIdentifier, options); writer.WritePropertyName("participantAdded"u8); writer.WriteObjectValue(ParticipantAdded, options); - writer.WritePropertyName("createTime"u8); - writer.WriteStringValue(CreateTime, "O"); + if (Optional.IsDefined(CreateTime)) + { + writer.WritePropertyName("createTime"u8); + writer.WriteStringValue(CreateTime.Value, "O"); + } if (Optional.IsDefined(Version)) { writer.WritePropertyName("version"u8); @@ -89,10 +95,10 @@ internal static AcsChatParticipantAddedToThreadWithUserEventData DeserializeAcsC { return null; } - DateTimeOffset time = default; + DateTimeOffset? time = default; CommunicationIdentifierModel addedByCommunicationIdentifier = default; AcsChatThreadParticipantProperties participantAdded = default; - DateTimeOffset createTime = default; + DateTimeOffset? createTime = default; long? version = default; CommunicationIdentifierModel recipientCommunicationIdentifier = default; string transactionId = default; @@ -103,6 +109,10 @@ internal static AcsChatParticipantAddedToThreadWithUserEventData DeserializeAcsC { if (property.NameEquals("time"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } time = property.Value.GetDateTimeOffset("O"); continue; } @@ -118,6 +128,10 @@ internal static AcsChatParticipantAddedToThreadWithUserEventData DeserializeAcsC } if (property.NameEquals("createTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } createTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadWithUserEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadWithUserEventData.cs index 95e15aab1526..407412eb394b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadWithUserEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadWithUserEventData.cs @@ -15,18 +15,15 @@ public partial class AcsChatParticipantAddedToThreadWithUserEventData : AcsChatT { /// Initializes a new instance of . /// The communication identifier of the target user. - /// The original creation time of the thread. - /// The time at which the user was added to the thread. /// The communication identifier of the user who added the user. /// The details of the user who was added. /// , or is null. - internal AcsChatParticipantAddedToThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, DateTimeOffset createTime, DateTimeOffset time, CommunicationIdentifierModel addedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantAdded) : base(recipientCommunicationIdentifier, createTime) + internal AcsChatParticipantAddedToThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel addedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantAdded) : base(recipientCommunicationIdentifier) { Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier)); Argument.AssertNotNull(addedByCommunicationIdentifier, nameof(addedByCommunicationIdentifier)); Argument.AssertNotNull(participantAdded, nameof(participantAdded)); - Time = time; AddedByCommunicationIdentifier = addedByCommunicationIdentifier; ParticipantAdded = participantAdded; } @@ -41,7 +38,7 @@ internal AcsChatParticipantAddedToThreadWithUserEventData(CommunicationIdentifie /// The time at which the user was added to the thread. /// The communication identifier of the user who added the user. /// The details of the user who was added. - internal AcsChatParticipantAddedToThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset createTime, long? version, DateTimeOffset time, CommunicationIdentifierModel addedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantAdded) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, createTime, version) + internal AcsChatParticipantAddedToThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset? createTime, long? version, DateTimeOffset? time, CommunicationIdentifierModel addedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantAdded) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, createTime, version) { Time = time; AddedByCommunicationIdentifier = addedByCommunicationIdentifier; @@ -54,7 +51,7 @@ internal AcsChatParticipantAddedToThreadWithUserEventData() } /// The time at which the user was added to the thread. - public DateTimeOffset Time { get; } + public DateTimeOffset? Time { get; } /// The communication identifier of the user who added the user. public CommunicationIdentifierModel AddedByCommunicationIdentifier { get; } /// The details of the user who was added. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadEventData.Serialization.cs index 9edc7fa55d10..4bf5b1a6ef97 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWrit } writer.WriteStartObject(); - writer.WritePropertyName("time"u8); - writer.WriteStringValue(Time, "O"); + if (Optional.IsDefined(Time)) + { + writer.WritePropertyName("time"u8); + writer.WriteStringValue(Time.Value, "O"); + } writer.WritePropertyName("removedByCommunicationIdentifier"u8); writer.WriteObjectValue(RemovedByCommunicationIdentifier, options); writer.WritePropertyName("participantRemoved"u8); @@ -85,7 +88,7 @@ internal static AcsChatParticipantRemovedFromThreadEventData DeserializeAcsChatP { return null; } - DateTimeOffset time = default; + DateTimeOffset? time = default; CommunicationIdentifierModel removedByCommunicationIdentifier = default; AcsChatThreadParticipantProperties participantRemoved = default; long? version = default; @@ -97,6 +100,10 @@ internal static AcsChatParticipantRemovedFromThreadEventData DeserializeAcsChatP { if (property.NameEquals("time"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } time = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadEventData.cs index 2984453d0a26..b3b2328112b9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadEventData.cs @@ -14,16 +14,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsChatParticipantRemovedFromThreadEventData : AcsChatEventInThreadBaseProperties { /// Initializes a new instance of . - /// The time at which the user was removed to the thread. /// The communication identifier of the user who removed the user. /// The details of the user who was removed. /// or is null. - internal AcsChatParticipantRemovedFromThreadEventData(DateTimeOffset time, CommunicationIdentifierModel removedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantRemoved) + internal AcsChatParticipantRemovedFromThreadEventData(CommunicationIdentifierModel removedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantRemoved) { Argument.AssertNotNull(removedByCommunicationIdentifier, nameof(removedByCommunicationIdentifier)); Argument.AssertNotNull(participantRemoved, nameof(participantRemoved)); - Time = time; RemovedByCommunicationIdentifier = removedByCommunicationIdentifier; ParticipantRemoved = participantRemoved; } @@ -36,7 +34,7 @@ internal AcsChatParticipantRemovedFromThreadEventData(DateTimeOffset time, Commu /// The communication identifier of the user who removed the user. /// The details of the user who was removed. /// The version of the thread. - internal AcsChatParticipantRemovedFromThreadEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset time, CommunicationIdentifierModel removedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantRemoved, long? version) : base(transactionId, threadId, serializedAdditionalRawData) + internal AcsChatParticipantRemovedFromThreadEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset? time, CommunicationIdentifierModel removedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantRemoved, long? version) : base(transactionId, threadId, serializedAdditionalRawData) { Time = time; RemovedByCommunicationIdentifier = removedByCommunicationIdentifier; @@ -50,7 +48,7 @@ internal AcsChatParticipantRemovedFromThreadEventData() } /// The time at which the user was removed to the thread. - public DateTimeOffset Time { get; } + public DateTimeOffset? Time { get; } /// The communication identifier of the user who removed the user. public CommunicationIdentifierModel RemovedByCommunicationIdentifier { get; } /// The details of the user who was removed. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadWithUserEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadWithUserEventData.Serialization.cs index df7207f1ca51..25c5b4c35d84 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadWithUserEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadWithUserEventData.Serialization.cs @@ -26,14 +26,20 @@ void IJsonModel.Write(Utf8 } writer.WriteStartObject(); - writer.WritePropertyName("time"u8); - writer.WriteStringValue(Time, "O"); + if (Optional.IsDefined(Time)) + { + writer.WritePropertyName("time"u8); + writer.WriteStringValue(Time.Value, "O"); + } writer.WritePropertyName("removedByCommunicationIdentifier"u8); writer.WriteObjectValue(RemovedByCommunicationIdentifier, options); writer.WritePropertyName("participantRemoved"u8); writer.WriteObjectValue(ParticipantRemoved, options); - writer.WritePropertyName("createTime"u8); - writer.WriteStringValue(CreateTime, "O"); + if (Optional.IsDefined(CreateTime)) + { + writer.WritePropertyName("createTime"u8); + writer.WriteStringValue(CreateTime.Value, "O"); + } if (Optional.IsDefined(Version)) { writer.WritePropertyName("version"u8); @@ -89,10 +95,10 @@ internal static AcsChatParticipantRemovedFromThreadWithUserEventData Deserialize { return null; } - DateTimeOffset time = default; + DateTimeOffset? time = default; CommunicationIdentifierModel removedByCommunicationIdentifier = default; AcsChatThreadParticipantProperties participantRemoved = default; - DateTimeOffset createTime = default; + DateTimeOffset? createTime = default; long? version = default; CommunicationIdentifierModel recipientCommunicationIdentifier = default; string transactionId = default; @@ -103,6 +109,10 @@ internal static AcsChatParticipantRemovedFromThreadWithUserEventData Deserialize { if (property.NameEquals("time"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } time = property.Value.GetDateTimeOffset("O"); continue; } @@ -118,6 +128,10 @@ internal static AcsChatParticipantRemovedFromThreadWithUserEventData Deserialize } if (property.NameEquals("createTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } createTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadWithUserEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadWithUserEventData.cs index 109684ffc523..d99153a59c67 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadWithUserEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadWithUserEventData.cs @@ -15,18 +15,15 @@ public partial class AcsChatParticipantRemovedFromThreadWithUserEventData : AcsC { /// Initializes a new instance of . /// The communication identifier of the target user. - /// The original creation time of the thread. - /// The time at which the user was removed to the thread. /// The communication identifier of the user who removed the user. /// The details of the user who was removed. /// , or is null. - internal AcsChatParticipantRemovedFromThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, DateTimeOffset createTime, DateTimeOffset time, CommunicationIdentifierModel removedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantRemoved) : base(recipientCommunicationIdentifier, createTime) + internal AcsChatParticipantRemovedFromThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel removedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantRemoved) : base(recipientCommunicationIdentifier) { Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier)); Argument.AssertNotNull(removedByCommunicationIdentifier, nameof(removedByCommunicationIdentifier)); Argument.AssertNotNull(participantRemoved, nameof(participantRemoved)); - Time = time; RemovedByCommunicationIdentifier = removedByCommunicationIdentifier; ParticipantRemoved = participantRemoved; } @@ -41,7 +38,7 @@ internal AcsChatParticipantRemovedFromThreadWithUserEventData(CommunicationIdent /// The time at which the user was removed to the thread. /// The communication identifier of the user who removed the user. /// The details of the user who was removed. - internal AcsChatParticipantRemovedFromThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset createTime, long? version, DateTimeOffset time, CommunicationIdentifierModel removedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantRemoved) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, createTime, version) + internal AcsChatParticipantRemovedFromThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset? createTime, long? version, DateTimeOffset? time, CommunicationIdentifierModel removedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantRemoved) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, createTime, version) { Time = time; RemovedByCommunicationIdentifier = removedByCommunicationIdentifier; @@ -54,7 +51,7 @@ internal AcsChatParticipantRemovedFromThreadWithUserEventData() } /// The time at which the user was removed to the thread. - public DateTimeOffset Time { get; } + public DateTimeOffset? Time { get; } /// The communication identifier of the user who removed the user. public CommunicationIdentifierModel RemovedByCommunicationIdentifier { get; } /// The details of the user who was removed. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedEventData.Serialization.cs index 35cc001d00cf..79e744fed4d3 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedEventData.Serialization.cs @@ -63,8 +63,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode writer.WriteObjectValue(item, options); } writer.WriteEndArray(); - writer.WritePropertyName("createTime"u8); - writer.WriteStringValue(CreateTime, "O"); + if (Optional.IsDefined(CreateTime)) + { + writer.WritePropertyName("createTime"u8); + writer.WriteStringValue(CreateTime.Value, "O"); + } if (Optional.IsDefined(Version)) { writer.WritePropertyName("version"u8); @@ -122,7 +125,7 @@ internal static AcsChatThreadCreatedEventData DeserializeAcsChatThreadCreatedEve IReadOnlyDictionary properties = default; IReadOnlyDictionary metadata = default; IReadOnlyList participants = default; - DateTimeOffset createTime = default; + DateTimeOffset? createTime = default; long? version = default; string transactionId = default; string threadId = default; @@ -174,6 +177,10 @@ internal static AcsChatThreadCreatedEventData DeserializeAcsChatThreadCreatedEve } if (property.NameEquals("createTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } createTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedEventData.cs index 30a77e8200e9..dd366f600f08 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedEventData.cs @@ -15,13 +15,12 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsChatThreadCreatedEventData : AcsChatThreadEventInThreadBaseProperties { /// Initializes a new instance of . - /// The original creation time of the thread. /// The communication identifier of the user who created the thread. /// The thread properties. /// The thread metadata. /// The list of properties of participants who are part of the thread. /// , , or is null. - internal AcsChatThreadCreatedEventData(DateTimeOffset createTime, CommunicationIdentifierModel createdByCommunicationIdentifier, IReadOnlyDictionary properties, IReadOnlyDictionary metadata, IEnumerable participants) : base(createTime) + internal AcsChatThreadCreatedEventData(CommunicationIdentifierModel createdByCommunicationIdentifier, IReadOnlyDictionary properties, IReadOnlyDictionary metadata, IEnumerable participants) { Argument.AssertNotNull(createdByCommunicationIdentifier, nameof(createdByCommunicationIdentifier)); Argument.AssertNotNull(properties, nameof(properties)); @@ -44,7 +43,7 @@ internal AcsChatThreadCreatedEventData(DateTimeOffset createTime, CommunicationI /// The thread properties. /// The thread metadata. /// The list of properties of participants who are part of the thread. - internal AcsChatThreadCreatedEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset createTime, long? version, CommunicationIdentifierModel createdByCommunicationIdentifier, IReadOnlyDictionary properties, IReadOnlyDictionary metadata, IReadOnlyList participants) : base(transactionId, threadId, serializedAdditionalRawData, createTime, version) + internal AcsChatThreadCreatedEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel createdByCommunicationIdentifier, IReadOnlyDictionary properties, IReadOnlyDictionary metadata, IReadOnlyList participants) : base(transactionId, threadId, serializedAdditionalRawData, createTime, version) { CreatedByCommunicationIdentifier = createdByCommunicationIdentifier; Properties = properties; diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedWithUserEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedWithUserEventData.Serialization.cs index 6b404c6b6d3f..edafdf9a4d8a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedWithUserEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedWithUserEventData.Serialization.cs @@ -63,8 +63,11 @@ void IJsonModel.Write(Utf8JsonWriter writ writer.WriteObjectValue(item, options); } writer.WriteEndArray(); - writer.WritePropertyName("createTime"u8); - writer.WriteStringValue(CreateTime, "O"); + if (Optional.IsDefined(CreateTime)) + { + writer.WritePropertyName("createTime"u8); + writer.WriteStringValue(CreateTime.Value, "O"); + } if (Optional.IsDefined(Version)) { writer.WritePropertyName("version"u8); @@ -124,7 +127,7 @@ internal static AcsChatThreadCreatedWithUserEventData DeserializeAcsChatThreadCr IReadOnlyDictionary properties = default; IReadOnlyDictionary metadata = default; IReadOnlyList participants = default; - DateTimeOffset createTime = default; + DateTimeOffset? createTime = default; long? version = default; CommunicationIdentifierModel recipientCommunicationIdentifier = default; string transactionId = default; @@ -177,6 +180,10 @@ internal static AcsChatThreadCreatedWithUserEventData DeserializeAcsChatThreadCr } if (property.NameEquals("createTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } createTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedWithUserEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedWithUserEventData.cs index 1016b59134b6..428a332bf9a3 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedWithUserEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedWithUserEventData.cs @@ -16,13 +16,12 @@ public partial class AcsChatThreadCreatedWithUserEventData : AcsChatThreadEventB { /// Initializes a new instance of . /// The communication identifier of the target user. - /// The original creation time of the thread. /// The communication identifier of the user who created the thread. /// The thread properties. /// The thread metadata. /// The list of properties of participants who are part of the thread. /// , , , or is null. - internal AcsChatThreadCreatedWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, DateTimeOffset createTime, CommunicationIdentifierModel createdByCommunicationIdentifier, IReadOnlyDictionary properties, IReadOnlyDictionary metadata, IEnumerable participants) : base(recipientCommunicationIdentifier, createTime) + internal AcsChatThreadCreatedWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel createdByCommunicationIdentifier, IReadOnlyDictionary properties, IReadOnlyDictionary metadata, IEnumerable participants) : base(recipientCommunicationIdentifier) { Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier)); Argument.AssertNotNull(createdByCommunicationIdentifier, nameof(createdByCommunicationIdentifier)); @@ -47,7 +46,7 @@ internal AcsChatThreadCreatedWithUserEventData(CommunicationIdentifierModel reci /// The thread properties. /// The thread metadata. /// The list of properties of participants who are part of the thread. - internal AcsChatThreadCreatedWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset createTime, long? version, CommunicationIdentifierModel createdByCommunicationIdentifier, IReadOnlyDictionary properties, IReadOnlyDictionary metadata, IReadOnlyList participants) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, createTime, version) + internal AcsChatThreadCreatedWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel createdByCommunicationIdentifier, IReadOnlyDictionary properties, IReadOnlyDictionary metadata, IReadOnlyList participants) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, createTime, version) { CreatedByCommunicationIdentifier = createdByCommunicationIdentifier; Properties = properties; diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadDeletedEventData.Serialization.cs index abdb7611c8e8..853a18cacfe9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadDeletedEventData.Serialization.cs @@ -28,10 +28,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode writer.WriteStartObject(); writer.WritePropertyName("deletedByCommunicationIdentifier"u8); writer.WriteObjectValue(DeletedByCommunicationIdentifier, options); - writer.WritePropertyName("deleteTime"u8); - writer.WriteStringValue(DeleteTime, "O"); - writer.WritePropertyName("createTime"u8); - writer.WriteStringValue(CreateTime, "O"); + if (Optional.IsDefined(DeleteTime)) + { + writer.WritePropertyName("deleteTime"u8); + writer.WriteStringValue(DeleteTime.Value, "O"); + } + if (Optional.IsDefined(CreateTime)) + { + writer.WritePropertyName("createTime"u8); + writer.WriteStringValue(CreateTime.Value, "O"); + } if (Optional.IsDefined(Version)) { writer.WritePropertyName("version"u8); @@ -86,8 +92,8 @@ internal static AcsChatThreadDeletedEventData DeserializeAcsChatThreadDeletedEve return null; } CommunicationIdentifierModel deletedByCommunicationIdentifier = default; - DateTimeOffset deleteTime = default; - DateTimeOffset createTime = default; + DateTimeOffset? deleteTime = default; + DateTimeOffset? createTime = default; long? version = default; string transactionId = default; string threadId = default; @@ -102,11 +108,19 @@ internal static AcsChatThreadDeletedEventData DeserializeAcsChatThreadDeletedEve } if (property.NameEquals("deleteTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } deleteTime = property.Value.GetDateTimeOffset("O"); continue; } if (property.NameEquals("createTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } createTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadDeletedEventData.cs index 68b39610ce9d..249893e1f9ee 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadDeletedEventData.cs @@ -14,16 +14,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsChatThreadDeletedEventData : AcsChatThreadEventInThreadBaseProperties { /// Initializes a new instance of . - /// The original creation time of the thread. /// The communication identifier of the user who deleted the thread. - /// The deletion time of the thread. /// is null. - internal AcsChatThreadDeletedEventData(DateTimeOffset createTime, CommunicationIdentifierModel deletedByCommunicationIdentifier, DateTimeOffset deleteTime) : base(createTime) + internal AcsChatThreadDeletedEventData(CommunicationIdentifierModel deletedByCommunicationIdentifier) { Argument.AssertNotNull(deletedByCommunicationIdentifier, nameof(deletedByCommunicationIdentifier)); DeletedByCommunicationIdentifier = deletedByCommunicationIdentifier; - DeleteTime = deleteTime; } /// Initializes a new instance of . @@ -34,7 +31,7 @@ internal AcsChatThreadDeletedEventData(DateTimeOffset createTime, CommunicationI /// The version of the thread. /// The communication identifier of the user who deleted the thread. /// The deletion time of the thread. - internal AcsChatThreadDeletedEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset createTime, long? version, CommunicationIdentifierModel deletedByCommunicationIdentifier, DateTimeOffset deleteTime) : base(transactionId, threadId, serializedAdditionalRawData, createTime, version) + internal AcsChatThreadDeletedEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel deletedByCommunicationIdentifier, DateTimeOffset? deleteTime) : base(transactionId, threadId, serializedAdditionalRawData, createTime, version) { DeletedByCommunicationIdentifier = deletedByCommunicationIdentifier; DeleteTime = deleteTime; @@ -48,6 +45,6 @@ internal AcsChatThreadDeletedEventData() /// The communication identifier of the user who deleted the thread. public CommunicationIdentifierModel DeletedByCommunicationIdentifier { get; } /// The deletion time of the thread. - public DateTimeOffset DeleteTime { get; } + public DateTimeOffset? DeleteTime { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventBaseProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventBaseProperties.Serialization.cs index 56eaaae150e5..5e3865c3147f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventBaseProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventBaseProperties.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, M } writer.WriteStartObject(); - writer.WritePropertyName("createTime"u8); - writer.WriteStringValue(CreateTime, "O"); + if (Optional.IsDefined(CreateTime)) + { + writer.WritePropertyName("createTime"u8); + writer.WriteStringValue(CreateTime.Value, "O"); + } if (Optional.IsDefined(Version)) { writer.WritePropertyName("version"u8); @@ -83,7 +86,7 @@ internal static AcsChatThreadEventBaseProperties DeserializeAcsChatThreadEventBa { return null; } - DateTimeOffset createTime = default; + DateTimeOffset? createTime = default; long? version = default; CommunicationIdentifierModel recipientCommunicationIdentifier = default; string transactionId = default; @@ -94,6 +97,10 @@ internal static AcsChatThreadEventBaseProperties DeserializeAcsChatThreadEventBa { if (property.NameEquals("createTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } createTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventBaseProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventBaseProperties.cs index d2a25d81594d..1ead8005f0c1 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventBaseProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventBaseProperties.cs @@ -15,13 +15,10 @@ public partial class AcsChatThreadEventBaseProperties : AcsChatEventBaseProperti { /// Initializes a new instance of . /// The communication identifier of the target user. - /// The original creation time of the thread. /// is null. - internal AcsChatThreadEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier, DateTimeOffset createTime) : base(recipientCommunicationIdentifier) + internal AcsChatThreadEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier) : base(recipientCommunicationIdentifier) { Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier)); - - CreateTime = createTime; } /// Initializes a new instance of . @@ -31,7 +28,7 @@ internal AcsChatThreadEventBaseProperties(CommunicationIdentifierModel recipient /// Keeps track of any properties unknown to the library. /// The original creation time of the thread. /// The version of the thread. - internal AcsChatThreadEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset createTime, long? version) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData) + internal AcsChatThreadEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset? createTime, long? version) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData) { CreateTime = createTime; Version = version; @@ -43,7 +40,7 @@ internal AcsChatThreadEventBaseProperties() } /// The original creation time of the thread. - public DateTimeOffset CreateTime { get; } + public DateTimeOffset? CreateTime { get; } /// The version of the thread. public long? Version { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventInThreadBaseProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventInThreadBaseProperties.Serialization.cs index 8b7c98aabf32..f2c1c8f7daac 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventInThreadBaseProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventInThreadBaseProperties.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter w } writer.WriteStartObject(); - writer.WritePropertyName("createTime"u8); - writer.WriteStringValue(CreateTime, "O"); + if (Optional.IsDefined(CreateTime)) + { + writer.WritePropertyName("createTime"u8); + writer.WriteStringValue(CreateTime.Value, "O"); + } if (Optional.IsDefined(Version)) { writer.WritePropertyName("version"u8); @@ -81,7 +84,7 @@ internal static AcsChatThreadEventInThreadBaseProperties DeserializeAcsChatThrea { return null; } - DateTimeOffset createTime = default; + DateTimeOffset? createTime = default; long? version = default; string transactionId = default; string threadId = default; @@ -91,6 +94,10 @@ internal static AcsChatThreadEventInThreadBaseProperties DeserializeAcsChatThrea { if (property.NameEquals("createTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } createTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventInThreadBaseProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventInThreadBaseProperties.cs index 6f41f0fe85ee..511e7ddeba0e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventInThreadBaseProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadEventInThreadBaseProperties.cs @@ -14,10 +14,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsChatThreadEventInThreadBaseProperties : AcsChatEventInThreadBaseProperties { /// Initializes a new instance of . - /// The original creation time of the thread. - internal AcsChatThreadEventInThreadBaseProperties(DateTimeOffset createTime) + internal AcsChatThreadEventInThreadBaseProperties() { - CreateTime = createTime; } /// Initializes a new instance of . @@ -26,19 +24,14 @@ internal AcsChatThreadEventInThreadBaseProperties(DateTimeOffset createTime) /// Keeps track of any properties unknown to the library. /// The original creation time of the thread. /// The version of the thread. - internal AcsChatThreadEventInThreadBaseProperties(string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset createTime, long? version) : base(transactionId, threadId, serializedAdditionalRawData) + internal AcsChatThreadEventInThreadBaseProperties(string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset? createTime, long? version) : base(transactionId, threadId, serializedAdditionalRawData) { CreateTime = createTime; Version = version; } - /// Initializes a new instance of for deserialization. - internal AcsChatThreadEventInThreadBaseProperties() - { - } - /// The original creation time of the thread. - public DateTimeOffset CreateTime { get; } + public DateTimeOffset? CreateTime { get; } /// The version of the thread. public long? Version { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedEventData.Serialization.cs index c9701f563c00..a318236b35f5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedEventData.Serialization.cs @@ -28,8 +28,11 @@ void IJsonModel.Write(Utf8JsonWriter wr writer.WriteStartObject(); writer.WritePropertyName("editedByCommunicationIdentifier"u8); writer.WriteObjectValue(EditedByCommunicationIdentifier, options); - writer.WritePropertyName("editTime"u8); - writer.WriteStringValue(EditTime, "O"); + if (Optional.IsDefined(EditTime)) + { + writer.WritePropertyName("editTime"u8); + writer.WriteStringValue(EditTime.Value, "O"); + } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); foreach (var item in Properties) @@ -58,8 +61,11 @@ void IJsonModel.Write(Utf8JsonWriter wr writer.WriteStringValue(item.Value); } writer.WriteEndObject(); - writer.WritePropertyName("createTime"u8); - writer.WriteStringValue(CreateTime, "O"); + if (Optional.IsDefined(CreateTime)) + { + writer.WritePropertyName("createTime"u8); + writer.WriteStringValue(CreateTime.Value, "O"); + } if (Optional.IsDefined(Version)) { writer.WritePropertyName("version"u8); @@ -114,10 +120,10 @@ internal static AcsChatThreadPropertiesUpdatedEventData DeserializeAcsChatThread return null; } CommunicationIdentifierModel editedByCommunicationIdentifier = default; - DateTimeOffset editTime = default; + DateTimeOffset? editTime = default; IReadOnlyDictionary properties = default; IReadOnlyDictionary metadata = default; - DateTimeOffset createTime = default; + DateTimeOffset? createTime = default; long? version = default; string transactionId = default; string threadId = default; @@ -132,6 +138,10 @@ internal static AcsChatThreadPropertiesUpdatedEventData DeserializeAcsChatThread } if (property.NameEquals("editTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } editTime = property.Value.GetDateTimeOffset("O"); continue; } @@ -164,6 +174,10 @@ internal static AcsChatThreadPropertiesUpdatedEventData DeserializeAcsChatThread } if (property.NameEquals("createTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } createTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedEventData.cs index 44f774f4f9a4..748afca8b6d6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedEventData.cs @@ -14,20 +14,17 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsChatThreadPropertiesUpdatedEventData : AcsChatThreadEventInThreadBaseProperties { /// Initializes a new instance of . - /// The original creation time of the thread. /// The communication identifier of the user who updated the thread properties. - /// The time at which the properties of the thread were updated. /// The updated thread properties. /// The thread metadata. /// , or is null. - internal AcsChatThreadPropertiesUpdatedEventData(DateTimeOffset createTime, CommunicationIdentifierModel editedByCommunicationIdentifier, DateTimeOffset editTime, IReadOnlyDictionary properties, IReadOnlyDictionary metadata) : base(createTime) + internal AcsChatThreadPropertiesUpdatedEventData(CommunicationIdentifierModel editedByCommunicationIdentifier, IReadOnlyDictionary properties, IReadOnlyDictionary metadata) { Argument.AssertNotNull(editedByCommunicationIdentifier, nameof(editedByCommunicationIdentifier)); Argument.AssertNotNull(properties, nameof(properties)); Argument.AssertNotNull(metadata, nameof(metadata)); EditedByCommunicationIdentifier = editedByCommunicationIdentifier; - EditTime = editTime; Properties = properties; Metadata = metadata; } @@ -42,7 +39,7 @@ internal AcsChatThreadPropertiesUpdatedEventData(DateTimeOffset createTime, Comm /// The time at which the properties of the thread were updated. /// The updated thread properties. /// The thread metadata. - internal AcsChatThreadPropertiesUpdatedEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset createTime, long? version, CommunicationIdentifierModel editedByCommunicationIdentifier, DateTimeOffset editTime, IReadOnlyDictionary properties, IReadOnlyDictionary metadata) : base(transactionId, threadId, serializedAdditionalRawData, createTime, version) + internal AcsChatThreadPropertiesUpdatedEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel editedByCommunicationIdentifier, DateTimeOffset? editTime, IReadOnlyDictionary properties, IReadOnlyDictionary metadata) : base(transactionId, threadId, serializedAdditionalRawData, createTime, version) { EditedByCommunicationIdentifier = editedByCommunicationIdentifier; EditTime = editTime; @@ -58,7 +55,7 @@ internal AcsChatThreadPropertiesUpdatedEventData() /// The communication identifier of the user who updated the thread properties. public CommunicationIdentifierModel EditedByCommunicationIdentifier { get; } /// The time at which the properties of the thread were updated. - public DateTimeOffset EditTime { get; } + public DateTimeOffset? EditTime { get; } /// /// The updated thread properties /// diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedPerUserEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedPerUserEventData.Serialization.cs index 6eb2f618ae84..125b74c9f7ea 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedPerUserEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedPerUserEventData.Serialization.cs @@ -28,8 +28,11 @@ void IJsonModel.Write(Utf8JsonWr writer.WriteStartObject(); writer.WritePropertyName("editedByCommunicationIdentifier"u8); writer.WriteObjectValue(EditedByCommunicationIdentifier, options); - writer.WritePropertyName("editTime"u8); - writer.WriteStringValue(EditTime, "O"); + if (Optional.IsDefined(EditTime)) + { + writer.WritePropertyName("editTime"u8); + writer.WriteStringValue(EditTime.Value, "O"); + } writer.WritePropertyName("metadata"u8); writer.WriteStartObject(); foreach (var item in Metadata) @@ -58,8 +61,11 @@ void IJsonModel.Write(Utf8JsonWr #endif } writer.WriteEndObject(); - writer.WritePropertyName("createTime"u8); - writer.WriteStringValue(CreateTime, "O"); + if (Optional.IsDefined(CreateTime)) + { + writer.WritePropertyName("createTime"u8); + writer.WriteStringValue(CreateTime.Value, "O"); + } if (Optional.IsDefined(Version)) { writer.WritePropertyName("version"u8); @@ -116,10 +122,10 @@ internal static AcsChatThreadPropertiesUpdatedPerUserEventData DeserializeAcsCha return null; } CommunicationIdentifierModel editedByCommunicationIdentifier = default; - DateTimeOffset editTime = default; + DateTimeOffset? editTime = default; IReadOnlyDictionary metadata = default; IReadOnlyDictionary properties = default; - DateTimeOffset createTime = default; + DateTimeOffset? createTime = default; long? version = default; CommunicationIdentifierModel recipientCommunicationIdentifier = default; string transactionId = default; @@ -135,6 +141,10 @@ internal static AcsChatThreadPropertiesUpdatedPerUserEventData DeserializeAcsCha } if (property.NameEquals("editTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } editTime = property.Value.GetDateTimeOffset("O"); continue; } @@ -167,6 +177,10 @@ internal static AcsChatThreadPropertiesUpdatedPerUserEventData DeserializeAcsCha } if (property.NameEquals("createTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } createTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedPerUserEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedPerUserEventData.cs index 571ff029f325..dc53eadefb4c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedPerUserEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadPropertiesUpdatedPerUserEventData.cs @@ -15,13 +15,11 @@ public partial class AcsChatThreadPropertiesUpdatedPerUserEventData : AcsChatThr { /// Initializes a new instance of . /// The communication identifier of the target user. - /// The original creation time of the thread. /// The communication identifier of the user who updated the thread properties. - /// The time at which the properties of the thread were updated. /// The thread metadata. /// The updated thread properties. /// , , or is null. - internal AcsChatThreadPropertiesUpdatedPerUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, DateTimeOffset createTime, CommunicationIdentifierModel editedByCommunicationIdentifier, DateTimeOffset editTime, IReadOnlyDictionary metadata, IReadOnlyDictionary properties) : base(recipientCommunicationIdentifier, createTime) + internal AcsChatThreadPropertiesUpdatedPerUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel editedByCommunicationIdentifier, IReadOnlyDictionary metadata, IReadOnlyDictionary properties) : base(recipientCommunicationIdentifier) { Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier)); Argument.AssertNotNull(editedByCommunicationIdentifier, nameof(editedByCommunicationIdentifier)); @@ -29,7 +27,6 @@ internal AcsChatThreadPropertiesUpdatedPerUserEventData(CommunicationIdentifierM Argument.AssertNotNull(properties, nameof(properties)); EditedByCommunicationIdentifier = editedByCommunicationIdentifier; - EditTime = editTime; Metadata = metadata; Properties = properties; } @@ -45,7 +42,7 @@ internal AcsChatThreadPropertiesUpdatedPerUserEventData(CommunicationIdentifierM /// The time at which the properties of the thread were updated. /// The thread metadata. /// The updated thread properties. - internal AcsChatThreadPropertiesUpdatedPerUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset createTime, long? version, CommunicationIdentifierModel editedByCommunicationIdentifier, DateTimeOffset editTime, IReadOnlyDictionary metadata, IReadOnlyDictionary properties) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, createTime, version) + internal AcsChatThreadPropertiesUpdatedPerUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel editedByCommunicationIdentifier, DateTimeOffset? editTime, IReadOnlyDictionary metadata, IReadOnlyDictionary properties) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, createTime, version) { EditedByCommunicationIdentifier = editedByCommunicationIdentifier; EditTime = editTime; @@ -61,7 +58,7 @@ internal AcsChatThreadPropertiesUpdatedPerUserEventData() /// The communication identifier of the user who updated the thread properties. public CommunicationIdentifierModel EditedByCommunicationIdentifier { get; } /// The time at which the properties of the thread were updated. - public DateTimeOffset EditTime { get; } + public DateTimeOffset? EditTime { get; } /// The thread metadata. public IReadOnlyDictionary Metadata { get; } /// diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadWithUserDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadWithUserDeletedEventData.Serialization.cs index 140744d9a62f..a771ac56e4fd 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadWithUserDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadWithUserDeletedEventData.Serialization.cs @@ -28,10 +28,16 @@ void IJsonModel.Write(Utf8JsonWriter writ writer.WriteStartObject(); writer.WritePropertyName("deletedByCommunicationIdentifier"u8); writer.WriteObjectValue(DeletedByCommunicationIdentifier, options); - writer.WritePropertyName("deleteTime"u8); - writer.WriteStringValue(DeleteTime, "O"); - writer.WritePropertyName("createTime"u8); - writer.WriteStringValue(CreateTime, "O"); + if (Optional.IsDefined(DeleteTime)) + { + writer.WritePropertyName("deleteTime"u8); + writer.WriteStringValue(DeleteTime.Value, "O"); + } + if (Optional.IsDefined(CreateTime)) + { + writer.WritePropertyName("createTime"u8); + writer.WriteStringValue(CreateTime.Value, "O"); + } if (Optional.IsDefined(Version)) { writer.WritePropertyName("version"u8); @@ -88,8 +94,8 @@ internal static AcsChatThreadWithUserDeletedEventData DeserializeAcsChatThreadWi return null; } CommunicationIdentifierModel deletedByCommunicationIdentifier = default; - DateTimeOffset deleteTime = default; - DateTimeOffset createTime = default; + DateTimeOffset? deleteTime = default; + DateTimeOffset? createTime = default; long? version = default; CommunicationIdentifierModel recipientCommunicationIdentifier = default; string transactionId = default; @@ -105,11 +111,19 @@ internal static AcsChatThreadWithUserDeletedEventData DeserializeAcsChatThreadWi } if (property.NameEquals("deleteTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } deleteTime = property.Value.GetDateTimeOffset("O"); continue; } if (property.NameEquals("createTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } createTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadWithUserDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadWithUserDeletedEventData.cs index 2b366137bfd7..d0c52952554e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadWithUserDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadWithUserDeletedEventData.cs @@ -15,17 +15,14 @@ public partial class AcsChatThreadWithUserDeletedEventData : AcsChatThreadEventB { /// Initializes a new instance of . /// The communication identifier of the target user. - /// The original creation time of the thread. /// The communication identifier of the user who deleted the thread. - /// The deletion time of the thread. /// or is null. - internal AcsChatThreadWithUserDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, DateTimeOffset createTime, CommunicationIdentifierModel deletedByCommunicationIdentifier, DateTimeOffset deleteTime) : base(recipientCommunicationIdentifier, createTime) + internal AcsChatThreadWithUserDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel deletedByCommunicationIdentifier) : base(recipientCommunicationIdentifier) { Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier)); Argument.AssertNotNull(deletedByCommunicationIdentifier, nameof(deletedByCommunicationIdentifier)); DeletedByCommunicationIdentifier = deletedByCommunicationIdentifier; - DeleteTime = deleteTime; } /// Initializes a new instance of . @@ -37,7 +34,7 @@ internal AcsChatThreadWithUserDeletedEventData(CommunicationIdentifierModel reci /// The version of the thread. /// The communication identifier of the user who deleted the thread. /// The deletion time of the thread. - internal AcsChatThreadWithUserDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset createTime, long? version, CommunicationIdentifierModel deletedByCommunicationIdentifier, DateTimeOffset deleteTime) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, createTime, version) + internal AcsChatThreadWithUserDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel deletedByCommunicationIdentifier, DateTimeOffset? deleteTime) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, createTime, version) { DeletedByCommunicationIdentifier = deletedByCommunicationIdentifier; DeleteTime = deleteTime; @@ -51,6 +48,6 @@ internal AcsChatThreadWithUserDeletedEventData() /// The communication identifier of the user who deleted the thread. public CommunicationIdentifierModel DeletedByCommunicationIdentifier { get; } /// The deletion time of the thread. - public DateTimeOffset DeleteTime { get; } + public DateTimeOffset? DeleteTime { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailDeliveryReportReceivedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailDeliveryReportReceivedEventData.Serialization.cs index eb0dcfad8451..2526b1531166 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailDeliveryReportReceivedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailDeliveryReportReceivedEventData.Serialization.cs @@ -41,12 +41,18 @@ void IJsonModel.Write(Utf8JsonWriter wr writer.WritePropertyName("messageId"u8); writer.WriteStringValue(MessageId); } - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.ToString()); + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } writer.WritePropertyName("deliveryStatusDetails"u8); writer.WriteObjectValue(DeliveryStatusDetails, options); - writer.WritePropertyName("deliveryAttemptTimeStamp"u8); - writer.WriteStringValue(DeliveryAttemptTimestamp, "O"); + if (Optional.IsDefined(DeliveryAttemptTimestamp)) + { + writer.WritePropertyName("deliveryAttemptTimestamp"u8); + writer.WriteStringValue(DeliveryAttemptTimestamp.Value, "O"); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -88,9 +94,9 @@ internal static AcsEmailDeliveryReportReceivedEventData DeserializeAcsEmailDeliv string sender = default; string recipient = default; string messageId = default; - AcsEmailDeliveryReportStatus status = default; + AcsEmailDeliveryReportStatus? status = default; AcsEmailDeliveryReportStatusDetails deliveryStatusDetails = default; - DateTimeOffset deliveryAttemptTimeStamp = default; + DateTimeOffset? deliveryAttemptTimestamp = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -112,6 +118,10 @@ internal static AcsEmailDeliveryReportReceivedEventData DeserializeAcsEmailDeliv } if (property.NameEquals("status"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } status = new AcsEmailDeliveryReportStatus(property.Value.GetString()); continue; } @@ -120,9 +130,13 @@ internal static AcsEmailDeliveryReportReceivedEventData DeserializeAcsEmailDeliv deliveryStatusDetails = AcsEmailDeliveryReportStatusDetails.DeserializeAcsEmailDeliveryReportStatusDetails(property.Value, options); continue; } - if (property.NameEquals("deliveryAttemptTimeStamp"u8)) + if (property.NameEquals("deliveryAttemptTimestamp"u8)) { - deliveryAttemptTimeStamp = property.Value.GetDateTimeOffset("O"); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + deliveryAttemptTimestamp = property.Value.GetDateTimeOffset("O"); continue; } if (options.Format != "W") @@ -137,7 +151,7 @@ internal static AcsEmailDeliveryReportReceivedEventData DeserializeAcsEmailDeliv messageId, status, deliveryStatusDetails, - deliveryAttemptTimeStamp, + deliveryAttemptTimestamp, serializedAdditionalRawData); } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailDeliveryReportReceivedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailDeliveryReportReceivedEventData.cs index f733218d6093..6b5ccc21acf3 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailDeliveryReportReceivedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailDeliveryReportReceivedEventData.cs @@ -46,17 +46,13 @@ public partial class AcsEmailDeliveryReportReceivedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The status of the email. Any value other than Delivered is considered failed. /// Detailed information about the status if any. - /// The time at which the email delivery report received timestamp. /// is null. - internal AcsEmailDeliveryReportReceivedEventData(AcsEmailDeliveryReportStatus status, AcsEmailDeliveryReportStatusDetails deliveryStatusDetails, DateTimeOffset deliveryAttemptTimestamp) + internal AcsEmailDeliveryReportReceivedEventData(AcsEmailDeliveryReportStatusDetails deliveryStatusDetails) { Argument.AssertNotNull(deliveryStatusDetails, nameof(deliveryStatusDetails)); - Status = status; DeliveryStatusDetails = deliveryStatusDetails; - DeliveryAttemptTimestamp = deliveryAttemptTimestamp; } /// Initializes a new instance of . @@ -67,7 +63,7 @@ internal AcsEmailDeliveryReportReceivedEventData(AcsEmailDeliveryReportStatus st /// Detailed information about the status if any. /// The time at which the email delivery report received timestamp. /// Keeps track of any properties unknown to the library. - internal AcsEmailDeliveryReportReceivedEventData(string sender, string recipient, string messageId, AcsEmailDeliveryReportStatus status, AcsEmailDeliveryReportStatusDetails deliveryStatusDetails, DateTimeOffset deliveryAttemptTimestamp, IDictionary serializedAdditionalRawData) + internal AcsEmailDeliveryReportReceivedEventData(string sender, string recipient, string messageId, AcsEmailDeliveryReportStatus? status, AcsEmailDeliveryReportStatusDetails deliveryStatusDetails, DateTimeOffset? deliveryAttemptTimestamp, IDictionary serializedAdditionalRawData) { Sender = sender; Recipient = recipient; @@ -90,10 +86,10 @@ internal AcsEmailDeliveryReportReceivedEventData() /// The Id of the email been sent. public string MessageId { get; } /// The status of the email. Any value other than Delivered is considered failed. - public AcsEmailDeliveryReportStatus Status { get; } + public AcsEmailDeliveryReportStatus? Status { get; } /// Detailed information about the status if any. public AcsEmailDeliveryReportStatusDetails DeliveryStatusDetails { get; } /// The time at which the email delivery report received timestamp. - public DateTimeOffset DeliveryAttemptTimestamp { get; } + public DateTimeOffset? DeliveryAttemptTimestamp { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailEngagementTrackingReportReceivedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailEngagementTrackingReportReceivedEventData.Serialization.cs index e7b4a52f0c68..4cbac52b9288 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailEngagementTrackingReportReceivedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailEngagementTrackingReportReceivedEventData.Serialization.cs @@ -41,8 +41,11 @@ void IJsonModel.Write(Utf8Jso writer.WritePropertyName("messageId"u8); writer.WriteStringValue(MessageId); } - writer.WritePropertyName("userActionTimeStamp"u8); - writer.WriteStringValue(UserActionTimestamp, "O"); + if (Optional.IsDefined(UserActionTimestamp)) + { + writer.WritePropertyName("userActionTimestamp"u8); + writer.WriteStringValue(UserActionTimestamp.Value, "O"); + } if (Optional.IsDefined(EngagementContext)) { writer.WritePropertyName("engagementContext"u8); @@ -53,8 +56,11 @@ void IJsonModel.Write(Utf8Jso writer.WritePropertyName("userAgent"u8); writer.WriteStringValue(UserAgent); } - writer.WritePropertyName("engagementType"u8); - writer.WriteStringValue(Engagement.ToString()); + if (Optional.IsDefined(Engagement)) + { + writer.WritePropertyName("engagementType"u8); + writer.WriteStringValue(Engagement.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -96,10 +102,10 @@ internal static AcsEmailEngagementTrackingReportReceivedEventData DeserializeAcs string sender = default; string recipient = default; string messageId = default; - DateTimeOffset userActionTimeStamp = default; + DateTimeOffset? userActionTimestamp = default; string engagementContext = default; string userAgent = default; - AcsUserEngagement engagementType = default; + AcsUserEngagement? engagementType = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -119,9 +125,13 @@ internal static AcsEmailEngagementTrackingReportReceivedEventData DeserializeAcs messageId = property.Value.GetString(); continue; } - if (property.NameEquals("userActionTimeStamp"u8)) + if (property.NameEquals("userActionTimestamp"u8)) { - userActionTimeStamp = property.Value.GetDateTimeOffset("O"); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + userActionTimestamp = property.Value.GetDateTimeOffset("O"); continue; } if (property.NameEquals("engagementContext"u8)) @@ -136,6 +146,10 @@ internal static AcsEmailEngagementTrackingReportReceivedEventData DeserializeAcs } if (property.NameEquals("engagementType"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } engagementType = new AcsUserEngagement(property.Value.GetString()); continue; } @@ -149,7 +163,7 @@ internal static AcsEmailEngagementTrackingReportReceivedEventData DeserializeAcs sender, recipient, messageId, - userActionTimeStamp, + userActionTimestamp, engagementContext, userAgent, engagementType, diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailEngagementTrackingReportReceivedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailEngagementTrackingReportReceivedEventData.cs index 9de2267639d7..78ece94104a5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailEngagementTrackingReportReceivedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsEmailEngagementTrackingReportReceivedEventData.cs @@ -46,12 +46,8 @@ public partial class AcsEmailEngagementTrackingReportReceivedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time at which the user interacted with the email. - /// The type of engagement user have with email. - internal AcsEmailEngagementTrackingReportReceivedEventData(DateTimeOffset userActionTimestamp, AcsUserEngagement engagement) + internal AcsEmailEngagementTrackingReportReceivedEventData() { - UserActionTimestamp = userActionTimestamp; - Engagement = engagement; } /// Initializes a new instance of . @@ -63,7 +59,7 @@ internal AcsEmailEngagementTrackingReportReceivedEventData(DateTimeOffset userAc /// The user agent interacting with the email. /// The type of engagement user have with email. /// Keeps track of any properties unknown to the library. - internal AcsEmailEngagementTrackingReportReceivedEventData(string sender, string recipient, string messageId, DateTimeOffset userActionTimestamp, string engagementContext, string userAgent, AcsUserEngagement engagement, IDictionary serializedAdditionalRawData) + internal AcsEmailEngagementTrackingReportReceivedEventData(string sender, string recipient, string messageId, DateTimeOffset? userActionTimestamp, string engagementContext, string userAgent, AcsUserEngagement? engagement, IDictionary serializedAdditionalRawData) { Sender = sender; Recipient = recipient; @@ -75,11 +71,6 @@ internal AcsEmailEngagementTrackingReportReceivedEventData(string sender, string _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal AcsEmailEngagementTrackingReportReceivedEventData() - { - } - /// The Sender Email Address. public string Sender { get; } /// The Recipient Email Address. @@ -87,12 +78,12 @@ internal AcsEmailEngagementTrackingReportReceivedEventData() /// The Id of the email that has been sent. public string MessageId { get; } /// The time at which the user interacted with the email. - public DateTimeOffset UserActionTimestamp { get; } + public DateTimeOffset? UserActionTimestamp { get; } /// The context of the type of engagement user had with email. public string EngagementContext { get; } /// The user agent interacting with the email. public string UserAgent { get; } /// The type of engagement user have with email. - public AcsUserEngagement Engagement { get; } + public AcsUserEngagement? Engagement { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageDeliveryStatusUpdatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageDeliveryStatusUpdatedEventData.Serialization.cs index 883ae3964591..488ef3417da5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageDeliveryStatusUpdatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageDeliveryStatusUpdatedEventData.Serialization.cs @@ -31,10 +31,16 @@ void IJsonModel.Write(Utf8JsonWriter w writer.WritePropertyName("messageId"u8); writer.WriteStringValue(MessageId); } - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.ToString()); - writer.WritePropertyName("channelType"u8); - writer.WriteStringValue(ChannelKind.ToString()); + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (Optional.IsDefined(ChannelKind)) + { + writer.WritePropertyName("channelType"u8); + writer.WriteStringValue(ChannelKind.Value.ToString()); + } if (Optional.IsDefined(From)) { writer.WritePropertyName("from"u8); @@ -45,8 +51,11 @@ void IJsonModel.Write(Utf8JsonWriter w writer.WritePropertyName("to"u8); writer.WriteStringValue(To); } - writer.WritePropertyName("receivedTimeStamp"u8); - writer.WriteStringValue(ReceivedTimestamp, "O"); + if (Optional.IsDefined(ReceivedTimestamp)) + { + writer.WritePropertyName("receivedTimeStamp"u8); + writer.WriteStringValue(ReceivedTimestamp.Value, "O"); + } writer.WritePropertyName("error"u8); writer.WriteObjectValue(Error, options); if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -88,11 +97,11 @@ internal static AcsMessageDeliveryStatusUpdatedEventData DeserializeAcsMessageDe return null; } string messageId = default; - AcsMessageDeliveryStatus status = default; - AcsMessageChannelKind channelType = default; + AcsMessageDeliveryStatus? status = default; + AcsMessageChannelKind? channelType = default; string @from = default; string to = default; - DateTimeOffset receivedTimeStamp = default; + DateTimeOffset? receivedTimeStamp = default; AcsMessageChannelEventError error = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -105,11 +114,19 @@ internal static AcsMessageDeliveryStatusUpdatedEventData DeserializeAcsMessageDe } if (property.NameEquals("status"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } status = new AcsMessageDeliveryStatus(property.Value.GetString()); continue; } if (property.NameEquals("channelType"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } channelType = new AcsMessageChannelKind(property.Value.GetString()); continue; } @@ -125,6 +142,10 @@ internal static AcsMessageDeliveryStatusUpdatedEventData DeserializeAcsMessageDe } if (property.NameEquals("receivedTimeStamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } receivedTimeStamp = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageDeliveryStatusUpdatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageDeliveryStatusUpdatedEventData.cs index 08ee6836ec0e..f4bd6f681f1e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageDeliveryStatusUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageDeliveryStatusUpdatedEventData.cs @@ -14,17 +14,11 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsMessageDeliveryStatusUpdatedEventData : AcsMessageEventData { /// Initializes a new instance of . - /// The time message was received. /// The channel event error. - /// The updated message status. - /// The updated message channel type. /// is null. - internal AcsMessageDeliveryStatusUpdatedEventData(DateTimeOffset receivedTimestamp, AcsMessageChannelEventError error, AcsMessageDeliveryStatus status, AcsMessageChannelKind channelKind) : base(receivedTimestamp, error) + internal AcsMessageDeliveryStatusUpdatedEventData(AcsMessageChannelEventError error) : base(error) { Argument.AssertNotNull(error, nameof(error)); - - Status = status; - ChannelKind = channelKind; } /// Initializes a new instance of . @@ -36,7 +30,7 @@ internal AcsMessageDeliveryStatusUpdatedEventData(DateTimeOffset receivedTimesta /// The message id. /// The updated message status. /// The updated message channel type. - internal AcsMessageDeliveryStatusUpdatedEventData(string @from, string to, DateTimeOffset receivedTimestamp, AcsMessageChannelEventError error, IDictionary serializedAdditionalRawData, string messageId, AcsMessageDeliveryStatus status, AcsMessageChannelKind channelKind) : base(@from, to, receivedTimestamp, error, serializedAdditionalRawData) + internal AcsMessageDeliveryStatusUpdatedEventData(string @from, string to, DateTimeOffset? receivedTimestamp, AcsMessageChannelEventError error, IDictionary serializedAdditionalRawData, string messageId, AcsMessageDeliveryStatus? status, AcsMessageChannelKind? channelKind) : base(@from, to, receivedTimestamp, error, serializedAdditionalRawData) { MessageId = messageId; Status = status; @@ -51,8 +45,8 @@ internal AcsMessageDeliveryStatusUpdatedEventData() /// The message id. public string MessageId { get; } /// The updated message status. - public AcsMessageDeliveryStatus Status { get; } + public AcsMessageDeliveryStatus? Status { get; } /// The updated message channel type. - public AcsMessageChannelKind ChannelKind { get; } + public AcsMessageChannelKind? ChannelKind { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageEventData.Serialization.cs index 88ba683f049b..85084fdd2334 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageEventData.Serialization.cs @@ -36,8 +36,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("to"u8); writer.WriteStringValue(To); } - writer.WritePropertyName("receivedTimeStamp"u8); - writer.WriteStringValue(ReceivedTimestamp, "O"); + if (Optional.IsDefined(ReceivedTimestamp)) + { + writer.WritePropertyName("receivedTimeStamp"u8); + writer.WriteStringValue(ReceivedTimestamp.Value, "O"); + } writer.WritePropertyName("error"u8); writer.WriteObjectValue(Error, options); if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -80,7 +83,7 @@ internal static AcsMessageEventData DeserializeAcsMessageEventData(JsonElement e } string @from = default; string to = default; - DateTimeOffset receivedTimeStamp = default; + DateTimeOffset? receivedTimeStamp = default; AcsMessageChannelEventError error = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -98,6 +101,10 @@ internal static AcsMessageEventData DeserializeAcsMessageEventData(JsonElement e } if (property.NameEquals("receivedTimeStamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } receivedTimeStamp = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageEventData.cs index cedcc1dc0758..7bcb742ac6ae 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageEventData.cs @@ -46,14 +46,12 @@ public partial class AcsMessageEventData private protected IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time message was received. /// The channel event error. /// is null. - internal AcsMessageEventData(DateTimeOffset receivedTimestamp, AcsMessageChannelEventError error) + internal AcsMessageEventData(AcsMessageChannelEventError error) { Argument.AssertNotNull(error, nameof(error)); - ReceivedTimestamp = receivedTimestamp; Error = error; } @@ -63,7 +61,7 @@ internal AcsMessageEventData(DateTimeOffset receivedTimestamp, AcsMessageChannel /// The time message was received. /// The channel event error. /// Keeps track of any properties unknown to the library. - internal AcsMessageEventData(string @from, string to, DateTimeOffset receivedTimestamp, AcsMessageChannelEventError error, IDictionary serializedAdditionalRawData) + internal AcsMessageEventData(string @from, string to, DateTimeOffset? receivedTimestamp, AcsMessageChannelEventError error, IDictionary serializedAdditionalRawData) { From = @from; To = to; @@ -82,7 +80,7 @@ internal AcsMessageEventData() /// The message recipient. public string To { get; } /// The time message was received. - public DateTimeOffset ReceivedTimestamp { get; } + public DateTimeOffset? ReceivedTimestamp { get; } /// The channel event error. public AcsMessageChannelEventError Error { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveContent.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveContent.Serialization.cs index cb1f26eb8cfc..4ca652c9c616 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveContent.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveContent.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model } writer.WriteStartObject(); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ReplyKind.ToString()); + if (Optional.IsDefined(ReplyKind)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ReplyKind.Value.ToString()); + } writer.WritePropertyName("buttonReply"u8); writer.WriteObjectValue(ButtonReply, options); writer.WritePropertyName("listReply"u8); @@ -70,7 +73,7 @@ internal static AcsMessageInteractiveContent DeserializeAcsMessageInteractiveCon { return null; } - AcsInteractiveReplyKind type = default; + AcsInteractiveReplyKind? type = default; AcsMessageInteractiveButtonReplyContent buttonReply = default; AcsMessageInteractiveListReplyContent listReply = default; IDictionary serializedAdditionalRawData = default; @@ -79,6 +82,10 @@ internal static AcsMessageInteractiveContent DeserializeAcsMessageInteractiveCon { if (property.NameEquals("type"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } type = new AcsInteractiveReplyKind(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveContent.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveContent.cs index 0d59cf31c2ff..9b8cdb2ab40a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveContent.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageInteractiveContent.cs @@ -46,16 +46,14 @@ public partial class AcsMessageInteractiveContent private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The Message interactive reply type. /// The Message Sent when a customer clicks a button. /// The Message Sent when a customer selects an item from a list. /// or is null. - internal AcsMessageInteractiveContent(AcsInteractiveReplyKind replyKind, AcsMessageInteractiveButtonReplyContent buttonReply, AcsMessageInteractiveListReplyContent listReply) + internal AcsMessageInteractiveContent(AcsMessageInteractiveButtonReplyContent buttonReply, AcsMessageInteractiveListReplyContent listReply) { Argument.AssertNotNull(buttonReply, nameof(buttonReply)); Argument.AssertNotNull(listReply, nameof(listReply)); - ReplyKind = replyKind; ButtonReply = buttonReply; ListReply = listReply; } @@ -65,7 +63,7 @@ internal AcsMessageInteractiveContent(AcsInteractiveReplyKind replyKind, AcsMess /// The Message Sent when a customer clicks a button. /// The Message Sent when a customer selects an item from a list. /// Keeps track of any properties unknown to the library. - internal AcsMessageInteractiveContent(AcsInteractiveReplyKind replyKind, AcsMessageInteractiveButtonReplyContent buttonReply, AcsMessageInteractiveListReplyContent listReply, IDictionary serializedAdditionalRawData) + internal AcsMessageInteractiveContent(AcsInteractiveReplyKind? replyKind, AcsMessageInteractiveButtonReplyContent buttonReply, AcsMessageInteractiveListReplyContent listReply, IDictionary serializedAdditionalRawData) { ReplyKind = replyKind; ButtonReply = buttonReply; @@ -79,7 +77,7 @@ internal AcsMessageInteractiveContent() } /// The Message interactive reply type. - public AcsInteractiveReplyKind ReplyKind { get; } + public AcsInteractiveReplyKind? ReplyKind { get; } /// The Message Sent when a customer clicks a button. public AcsMessageInteractiveButtonReplyContent ButtonReply { get; } /// The Message Sent when a customer selects an item from a list. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageReceivedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageReceivedEventData.Serialization.cs index e35e1bb137aa..f9d053bd7287 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageReceivedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageReceivedEventData.Serialization.cs @@ -51,8 +51,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WritePropertyName("to"u8); writer.WriteStringValue(To); } - writer.WritePropertyName("receivedTimeStamp"u8); - writer.WriteStringValue(ReceivedTimestamp, "O"); + if (Optional.IsDefined(ReceivedTimestamp)) + { + writer.WritePropertyName("receivedTimeStamp"u8); + writer.WriteStringValue(ReceivedTimestamp.Value, "O"); + } writer.WritePropertyName("error"u8); writer.WriteObjectValue(Error, options); if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -101,7 +104,7 @@ internal static AcsMessageReceivedEventData DeserializeAcsMessageReceivedEventDa AcsMessageInteractiveContent interactive = default; string @from = default; string to = default; - DateTimeOffset receivedTimeStamp = default; + DateTimeOffset? receivedTimeStamp = default; AcsMessageChannelEventError error = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -149,6 +152,10 @@ internal static AcsMessageReceivedEventData DeserializeAcsMessageReceivedEventDa } if (property.NameEquals("receivedTimeStamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } receivedTimeStamp = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageReceivedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageReceivedEventData.cs index b7435b051bdf..a15a9991bdda 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageReceivedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsMessageReceivedEventData.cs @@ -14,7 +14,6 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsMessageReceivedEventData : AcsMessageEventData { /// Initializes a new instance of . - /// The time message was received. /// The channel event error. /// The message channel type. /// The received message media content. @@ -22,7 +21,7 @@ public partial class AcsMessageReceivedEventData : AcsMessageEventData /// The received message button content. /// The received message interactive content. /// , , , or is null. - internal AcsMessageReceivedEventData(DateTimeOffset receivedTimestamp, AcsMessageChannelEventError error, AcsMessageChannelKind channelKind, AcsMessageMediaContent mediaContent, AcsMessageContext context, AcsMessageButtonContent button, AcsMessageInteractiveContent interactiveContent) : base(receivedTimestamp, error) + internal AcsMessageReceivedEventData(AcsMessageChannelEventError error, AcsMessageChannelKind channelKind, AcsMessageMediaContent mediaContent, AcsMessageContext context, AcsMessageButtonContent button, AcsMessageInteractiveContent interactiveContent) : base(error) { Argument.AssertNotNull(error, nameof(error)); Argument.AssertNotNull(mediaContent, nameof(mediaContent)); @@ -49,7 +48,7 @@ internal AcsMessageReceivedEventData(DateTimeOffset receivedTimestamp, AcsMessag /// The received message context. /// The received message button content. /// The received message interactive content. - internal AcsMessageReceivedEventData(string @from, string to, DateTimeOffset receivedTimestamp, AcsMessageChannelEventError error, IDictionary serializedAdditionalRawData, string content, AcsMessageChannelKind channelKind, AcsMessageMediaContent mediaContent, AcsMessageContext context, AcsMessageButtonContent button, AcsMessageInteractiveContent interactiveContent) : base(@from, to, receivedTimestamp, error, serializedAdditionalRawData) + internal AcsMessageReceivedEventData(string @from, string to, DateTimeOffset? receivedTimestamp, AcsMessageChannelEventError error, IDictionary serializedAdditionalRawData, string content, AcsMessageChannelKind channelKind, AcsMessageMediaContent mediaContent, AcsMessageContext context, AcsMessageButtonContent button, AcsMessageInteractiveContent interactiveContent) : base(@from, to, receivedTimestamp, error, serializedAdditionalRawData) { Content = content; ChannelKind = channelKind; diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingFileStatusUpdatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingFileStatusUpdatedEventData.Serialization.cs index 89ee1da445a1..51f9f6f344a9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingFileStatusUpdatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingFileStatusUpdatedEventData.Serialization.cs @@ -28,19 +28,31 @@ void IJsonModel.Write(Utf8JsonWriter wri writer.WriteStartObject(); writer.WritePropertyName("recordingStorageInfo"u8); writer.WriteObjectValue(RecordingStorageInfo, options); - writer.WritePropertyName("recordingStartTime"u8); - writer.WriteStringValue(RecordingStartTime, "O"); + if (Optional.IsDefined(RecordingStartTime)) + { + writer.WritePropertyName("recordingStartTime"u8); + writer.WriteStringValue(RecordingStartTime.Value, "O"); + } if (Optional.IsDefined(RecordingDurationMs)) { writer.WritePropertyName("recordingDurationMs"u8); writer.WriteNumberValue(RecordingDurationMs.Value); } - writer.WritePropertyName("recordingContentType"u8); - writer.WriteStringValue(RecordingContentType.ToString()); - writer.WritePropertyName("recordingChannelType"u8); - writer.WriteStringValue(RecordingChannelKind.ToString()); - writer.WritePropertyName("recordingFormatType"u8); - writer.WriteStringValue(RecordingFormatType.ToString()); + if (Optional.IsDefined(RecordingContentType)) + { + writer.WritePropertyName("recordingContentType"u8); + writer.WriteStringValue(RecordingContentType.Value.ToString()); + } + if (Optional.IsDefined(RecordingChannelKind)) + { + writer.WritePropertyName("recordingChannelType"u8); + writer.WriteStringValue(RecordingChannelKind.Value.ToString()); + } + if (Optional.IsDefined(RecordingFormatType)) + { + writer.WritePropertyName("recordingFormatType"u8); + writer.WriteStringValue(RecordingFormatType.Value.ToString()); + } if (Optional.IsDefined(SessionEndReason)) { writer.WritePropertyName("sessionEndReason"u8); @@ -85,11 +97,11 @@ internal static AcsRecordingFileStatusUpdatedEventData DeserializeAcsRecordingFi return null; } AcsRecordingStorageInfoProperties recordingStorageInfo = default; - DateTimeOffset recordingStartTime = default; + DateTimeOffset? recordingStartTime = default; long? recordingDurationMs = default; - RecordingContentType recordingContentType = default; - RecordingChannelType recordingChannelType = default; - RecordingFormatType recordingFormatType = default; + RecordingContentType? recordingContentType = default; + RecordingChannelType? recordingChannelType = default; + RecordingFormatType? recordingFormatType = default; string sessionEndReason = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -102,6 +114,10 @@ internal static AcsRecordingFileStatusUpdatedEventData DeserializeAcsRecordingFi } if (property.NameEquals("recordingStartTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } recordingStartTime = property.Value.GetDateTimeOffset("O"); continue; } @@ -116,16 +132,28 @@ internal static AcsRecordingFileStatusUpdatedEventData DeserializeAcsRecordingFi } if (property.NameEquals("recordingContentType"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } recordingContentType = new RecordingContentType(property.Value.GetString()); continue; } if (property.NameEquals("recordingChannelType"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } recordingChannelType = new RecordingChannelType(property.Value.GetString()); continue; } if (property.NameEquals("recordingFormatType"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } recordingFormatType = new RecordingFormatType(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingFileStatusUpdatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingFileStatusUpdatedEventData.cs index a5e50aee2cc8..6e00dccf4760 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingFileStatusUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRecordingFileStatusUpdatedEventData.cs @@ -47,20 +47,12 @@ public partial class AcsRecordingFileStatusUpdatedEventData /// Initializes a new instance of . /// The details of recording storage information. - /// The time at which the recording started. - /// The recording content type- AudioVideo, or Audio. - /// The recording channel type - Mixed, Unmixed. - /// The recording format type - Mp4, Mp3, Wav. /// is null. - internal AcsRecordingFileStatusUpdatedEventData(AcsRecordingStorageInfoProperties recordingStorageInfo, DateTimeOffset recordingStartTime, RecordingContentType recordingContentType, RecordingChannelType recordingChannelKind, RecordingFormatType recordingFormatType) + internal AcsRecordingFileStatusUpdatedEventData(AcsRecordingStorageInfoProperties recordingStorageInfo) { Argument.AssertNotNull(recordingStorageInfo, nameof(recordingStorageInfo)); RecordingStorageInfo = recordingStorageInfo; - RecordingStartTime = recordingStartTime; - RecordingContentType = recordingContentType; - RecordingChannelKind = recordingChannelKind; - RecordingFormatType = recordingFormatType; } /// Initializes a new instance of . @@ -72,7 +64,7 @@ internal AcsRecordingFileStatusUpdatedEventData(AcsRecordingStorageInfoPropertie /// The recording format type - Mp4, Mp3, Wav. /// The reason for ending recording session. /// Keeps track of any properties unknown to the library. - internal AcsRecordingFileStatusUpdatedEventData(AcsRecordingStorageInfoProperties recordingStorageInfo, DateTimeOffset recordingStartTime, long? recordingDurationMs, RecordingContentType recordingContentType, RecordingChannelType recordingChannelKind, RecordingFormatType recordingFormatType, string sessionEndReason, IDictionary serializedAdditionalRawData) + internal AcsRecordingFileStatusUpdatedEventData(AcsRecordingStorageInfoProperties recordingStorageInfo, DateTimeOffset? recordingStartTime, long? recordingDurationMs, RecordingContentType? recordingContentType, RecordingChannelType? recordingChannelKind, RecordingFormatType? recordingFormatType, string sessionEndReason, IDictionary serializedAdditionalRawData) { RecordingStorageInfo = recordingStorageInfo; RecordingStartTime = recordingStartTime; @@ -92,15 +84,15 @@ internal AcsRecordingFileStatusUpdatedEventData() /// The details of recording storage information. public AcsRecordingStorageInfoProperties RecordingStorageInfo { get; } /// The time at which the recording started. - public DateTimeOffset RecordingStartTime { get; } + public DateTimeOffset? RecordingStartTime { get; } /// The recording duration in milliseconds. public long? RecordingDurationMs { get; } /// The recording content type- AudioVideo, or Audio. - public RecordingContentType RecordingContentType { get; } + public RecordingContentType? RecordingContentType { get; } /// The recording channel type - Mixed, Unmixed. - public RecordingChannelType RecordingChannelKind { get; } + public RecordingChannelType? RecordingChannelKind { get; } /// The recording format type - Mp4, Mp3, Wav. - public RecordingFormatType RecordingFormatType { get; } + public RecordingFormatType? RecordingFormatType { get; } /// The reason for ending recording session. public string SessionEndReason { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobReceivedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobReceivedEventData.Serialization.cs index abb876deca81..655772773de2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobReceivedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobReceivedEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode } writer.WriteStartObject(); - writer.WritePropertyName("jobStatus"u8); - writer.WriteStringValue(JobStatus.ToString()); + if (Optional.IsDefined(JobStatus)) + { + writer.WritePropertyName("jobStatus"u8); + writer.WriteStringValue(JobStatus.Value.ToString()); + } if (Optional.IsDefined(ClassificationPolicyId)) { writer.WritePropertyName("classificationPolicyId"u8); @@ -45,8 +48,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode writer.WriteObjectValue(item, options); } writer.WriteEndArray(); - writer.WritePropertyName("scheduledOn"u8); - writer.WriteStringValue(ScheduledOn, "O"); + if (Optional.IsDefined(ScheduledOn)) + { + writer.WritePropertyName("scheduledOn"u8); + writer.WriteStringValue(ScheduledOn.Value, "O"); + } writer.WritePropertyName("unavailableForMatching"u8); writer.WriteBooleanValue(UnavailableForMatching); if (Optional.IsDefined(QueueId)) @@ -123,11 +129,11 @@ internal static AcsRouterJobReceivedEventData DeserializeAcsRouterJobReceivedEve { return null; } - AcsRouterJobStatus jobStatus = default; + AcsRouterJobStatus? jobStatus = default; string classificationPolicyId = default; int? priority = default; IReadOnlyList requestedWorkerSelectors = default; - DateTimeOffset scheduledOn = default; + DateTimeOffset? scheduledOn = default; bool unavailableForMatching = default; string queueId = default; IReadOnlyDictionary labels = default; @@ -141,6 +147,10 @@ internal static AcsRouterJobReceivedEventData DeserializeAcsRouterJobReceivedEve { if (property.NameEquals("jobStatus"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } jobStatus = new AcsRouterJobStatus(property.Value.GetString()); continue; } @@ -170,6 +180,10 @@ internal static AcsRouterJobReceivedEventData DeserializeAcsRouterJobReceivedEve } if (property.NameEquals("scheduledOn"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } scheduledOn = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobReceivedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobReceivedEventData.cs index 3a5d5a136ea7..e13d3fb3647b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobReceivedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobReceivedEventData.cs @@ -17,20 +17,16 @@ public partial class AcsRouterJobReceivedEventData : AcsRouterJobEventData /// Initializes a new instance of . /// Router Job events Labels. /// Router Jobs events Tags. - /// Router Job Received Job Status. /// Router Job Received Requested Worker Selectors. - /// Router Job Received Scheduled Time in UTC. /// Unavailable For Matching for Router Job Received. /// , or is null. - internal AcsRouterJobReceivedEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags, AcsRouterJobStatus jobStatus, IEnumerable requestedWorkerSelectors, DateTimeOffset scheduledOn, bool unavailableForMatching) : base(labels, tags) + internal AcsRouterJobReceivedEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags, IEnumerable requestedWorkerSelectors, bool unavailableForMatching) : base(labels, tags) { Argument.AssertNotNull(labels, nameof(labels)); Argument.AssertNotNull(tags, nameof(tags)); Argument.AssertNotNull(requestedWorkerSelectors, nameof(requestedWorkerSelectors)); - JobStatus = jobStatus; RequestedWorkerSelectors = requestedWorkerSelectors.ToList(); - ScheduledOn = scheduledOn; UnavailableForMatching = unavailableForMatching; } @@ -48,7 +44,7 @@ internal AcsRouterJobReceivedEventData(IReadOnlyDictionary label /// Router Job Received Requested Worker Selectors. /// Router Job Received Scheduled Time in UTC. /// Unavailable For Matching for Router Job Received. - internal AcsRouterJobReceivedEventData(string jobId, string channelReference, string channelId, IDictionary serializedAdditionalRawData, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, AcsRouterJobStatus jobStatus, string classificationPolicyId, int? priority, IReadOnlyList requestedWorkerSelectors, DateTimeOffset scheduledOn, bool unavailableForMatching) : base(jobId, channelReference, channelId, serializedAdditionalRawData, queueId, labels, tags) + internal AcsRouterJobReceivedEventData(string jobId, string channelReference, string channelId, IDictionary serializedAdditionalRawData, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, AcsRouterJobStatus? jobStatus, string classificationPolicyId, int? priority, IReadOnlyList requestedWorkerSelectors, DateTimeOffset? scheduledOn, bool unavailableForMatching) : base(jobId, channelReference, channelId, serializedAdditionalRawData, queueId, labels, tags) { JobStatus = jobStatus; ClassificationPolicyId = classificationPolicyId; @@ -64,7 +60,7 @@ internal AcsRouterJobReceivedEventData() } /// Router Job Received Job Status. - public AcsRouterJobStatus JobStatus { get; } + public AcsRouterJobStatus? JobStatus { get; } /// Router Job Classification Policy Id. public string ClassificationPolicyId { get; } /// Router Job Priority. @@ -72,7 +68,7 @@ internal AcsRouterJobReceivedEventData() /// Router Job Received Requested Worker Selectors. public IReadOnlyList RequestedWorkerSelectors { get; } /// Router Job Received Scheduled Time in UTC. - public DateTimeOffset ScheduledOn { get; } + public DateTimeOffset? ScheduledOn { get; } /// Unavailable For Matching for Router Job Received. public bool UnavailableForMatching { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobSchedulingFailedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobSchedulingFailedEventData.Serialization.cs index c58f9f019aa8..b0a931a00cac 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobSchedulingFailedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobSchedulingFailedEventData.Serialization.cs @@ -45,8 +45,11 @@ void IJsonModel.Write(Utf8JsonWriter writ writer.WriteObjectValue(item, options); } writer.WriteEndArray(); - writer.WritePropertyName("scheduledOn"u8); - writer.WriteStringValue(ScheduledOn, "O"); + if (Optional.IsDefined(ScheduledOn)) + { + writer.WritePropertyName("scheduledOn"u8); + writer.WriteStringValue(ScheduledOn.Value, "O"); + } if (Optional.IsDefined(FailureReason)) { writer.WritePropertyName("failureReason"u8); @@ -129,7 +132,7 @@ internal static AcsRouterJobSchedulingFailedEventData DeserializeAcsRouterJobSch int? priority = default; IReadOnlyList expiredAttachedWorkerSelectors = default; IReadOnlyList expiredRequestedWorkerSelectors = default; - DateTimeOffset scheduledOn = default; + DateTimeOffset? scheduledOn = default; string failureReason = default; string queueId = default; IReadOnlyDictionary labels = default; @@ -172,6 +175,10 @@ internal static AcsRouterJobSchedulingFailedEventData DeserializeAcsRouterJobSch } if (property.NameEquals("scheduledOn"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } scheduledOn = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobSchedulingFailedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobSchedulingFailedEventData.cs index 6d55b80f185a..2f38f8a6466d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobSchedulingFailedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobSchedulingFailedEventData.cs @@ -19,9 +19,8 @@ public partial class AcsRouterJobSchedulingFailedEventData : AcsRouterJobEventDa /// Router Jobs events Tags. /// Router Job Scheduling Failed Attached Worker Selector Expired. /// Router Job Scheduling Failed Requested Worker Selector Expired. - /// Router Job Scheduling Failed Scheduled Time in UTC. /// , , or is null. - internal AcsRouterJobSchedulingFailedEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags, IEnumerable expiredAttachedWorkerSelectors, IEnumerable expiredRequestedWorkerSelectors, DateTimeOffset scheduledOn) : base(labels, tags) + internal AcsRouterJobSchedulingFailedEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags, IEnumerable expiredAttachedWorkerSelectors, IEnumerable expiredRequestedWorkerSelectors) : base(labels, tags) { Argument.AssertNotNull(labels, nameof(labels)); Argument.AssertNotNull(tags, nameof(tags)); @@ -30,7 +29,6 @@ internal AcsRouterJobSchedulingFailedEventData(IReadOnlyDictionary Initializes a new instance of . @@ -46,7 +44,7 @@ internal AcsRouterJobSchedulingFailedEventData(IReadOnlyDictionary Router Job Scheduling Failed Requested Worker Selector Expired. /// Router Job Scheduling Failed Scheduled Time in UTC. /// Router Job Scheduling Failed Reason. - internal AcsRouterJobSchedulingFailedEventData(string jobId, string channelReference, string channelId, IDictionary serializedAdditionalRawData, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, int? priority, IReadOnlyList expiredAttachedWorkerSelectors, IReadOnlyList expiredRequestedWorkerSelectors, DateTimeOffset scheduledOn, string failureReason) : base(jobId, channelReference, channelId, serializedAdditionalRawData, queueId, labels, tags) + internal AcsRouterJobSchedulingFailedEventData(string jobId, string channelReference, string channelId, IDictionary serializedAdditionalRawData, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, int? priority, IReadOnlyList expiredAttachedWorkerSelectors, IReadOnlyList expiredRequestedWorkerSelectors, DateTimeOffset? scheduledOn, string failureReason) : base(jobId, channelReference, channelId, serializedAdditionalRawData, queueId, labels, tags) { Priority = priority; ExpiredAttachedWorkerSelectors = expiredAttachedWorkerSelectors; @@ -67,7 +65,7 @@ internal AcsRouterJobSchedulingFailedEventData() /// Router Job Scheduling Failed Requested Worker Selector Expired. public IReadOnlyList ExpiredRequestedWorkerSelectors { get; } /// Router Job Scheduling Failed Scheduled Time in UTC. - public DateTimeOffset ScheduledOn { get; } + public DateTimeOffset? ScheduledOn { get; } /// Router Job Scheduling Failed Reason. public string FailureReason { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWaitingForActivationEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWaitingForActivationEventData.Serialization.cs index 887097bdd33a..628fb9c0a489 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWaitingForActivationEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWaitingForActivationEventData.Serialization.cs @@ -45,8 +45,11 @@ void IJsonModel.Write(Utf8JsonWriter writer.WriteObjectValue(item, options); } writer.WriteEndArray(); - writer.WritePropertyName("scheduledOn"u8); - writer.WriteStringValue(ScheduledOn, "O"); + if (Optional.IsDefined(ScheduledOn)) + { + writer.WritePropertyName("scheduledOn"u8); + writer.WriteStringValue(ScheduledOn.Value, "O"); + } writer.WritePropertyName("unavailableForMatching"u8); writer.WriteBooleanValue(UnavailableForMatching); if (Optional.IsDefined(QueueId)) @@ -126,7 +129,7 @@ internal static AcsRouterJobWaitingForActivationEventData DeserializeAcsRouterJo int? priority = default; IReadOnlyList expiredAttachedWorkerSelectors = default; IReadOnlyList expiredRequestedWorkerSelectors = default; - DateTimeOffset scheduledOn = default; + DateTimeOffset? scheduledOn = default; bool unavailableForMatching = default; string queueId = default; IReadOnlyDictionary labels = default; @@ -169,6 +172,10 @@ internal static AcsRouterJobWaitingForActivationEventData DeserializeAcsRouterJo } if (property.NameEquals("scheduledOn"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } scheduledOn = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWaitingForActivationEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWaitingForActivationEventData.cs index 445da526d6c0..df1a3085421f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWaitingForActivationEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterJobWaitingForActivationEventData.cs @@ -19,10 +19,9 @@ public partial class AcsRouterJobWaitingForActivationEventData : AcsRouterJobEve /// Router Jobs events Tags. /// Router Job Waiting For Activation Worker Selector Expired. /// Router Job Waiting For Activation Requested Worker Selector Expired. - /// Router Job Waiting For Activation Scheduled Time in UTC. /// Router Job Waiting For Activation Unavailable For Matching. /// , , or is null. - internal AcsRouterJobWaitingForActivationEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags, IEnumerable expiredAttachedWorkerSelectors, IEnumerable expiredRequestedWorkerSelectors, DateTimeOffset scheduledOn, bool unavailableForMatching) : base(labels, tags) + internal AcsRouterJobWaitingForActivationEventData(IReadOnlyDictionary labels, IReadOnlyDictionary tags, IEnumerable expiredAttachedWorkerSelectors, IEnumerable expiredRequestedWorkerSelectors, bool unavailableForMatching) : base(labels, tags) { Argument.AssertNotNull(labels, nameof(labels)); Argument.AssertNotNull(tags, nameof(tags)); @@ -31,7 +30,6 @@ internal AcsRouterJobWaitingForActivationEventData(IReadOnlyDictionary Router Job Waiting For Activation Requested Worker Selector Expired. /// Router Job Waiting For Activation Scheduled Time in UTC. /// Router Job Waiting For Activation Unavailable For Matching. - internal AcsRouterJobWaitingForActivationEventData(string jobId, string channelReference, string channelId, IDictionary serializedAdditionalRawData, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, int? priority, IReadOnlyList expiredAttachedWorkerSelectors, IReadOnlyList expiredRequestedWorkerSelectors, DateTimeOffset scheduledOn, bool unavailableForMatching) : base(jobId, channelReference, channelId, serializedAdditionalRawData, queueId, labels, tags) + internal AcsRouterJobWaitingForActivationEventData(string jobId, string channelReference, string channelId, IDictionary serializedAdditionalRawData, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, int? priority, IReadOnlyList expiredAttachedWorkerSelectors, IReadOnlyList expiredRequestedWorkerSelectors, DateTimeOffset? scheduledOn, bool unavailableForMatching) : base(jobId, channelReference, channelId, serializedAdditionalRawData, queueId, labels, tags) { Priority = priority; ExpiredAttachedWorkerSelectors = expiredAttachedWorkerSelectors; @@ -69,7 +67,7 @@ internal AcsRouterJobWaitingForActivationEventData() /// Router Job Waiting For Activation Requested Worker Selector Expired. public IReadOnlyList ExpiredRequestedWorkerSelectors { get; } /// Router Job Waiting For Activation Scheduled Time in UTC. - public DateTimeOffset ScheduledOn { get; } + public DateTimeOffset? ScheduledOn { get; } /// Router Job Waiting For Activation Unavailable For Matching. public bool UnavailableForMatching { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferIssuedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferIssuedEventData.Serialization.cs index 9a1073b87251..ccf679cdea50 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferIssuedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferIssuedEventData.Serialization.cs @@ -49,10 +49,16 @@ void IJsonModel.Write(Utf8JsonWriter writer writer.WriteStringValue(item.Value); } writer.WriteEndObject(); - writer.WritePropertyName("offeredOn"u8); - writer.WriteStringValue(OfferedOn, "O"); - writer.WritePropertyName("expiresOn"u8); - writer.WriteStringValue(ExpiresOn, "O"); + if (Optional.IsDefined(OfferedOn)) + { + writer.WritePropertyName("offeredOn"u8); + writer.WriteStringValue(OfferedOn.Value, "O"); + } + if (Optional.IsDefined(ExpiresOn)) + { + writer.WritePropertyName("expiresOn"u8); + writer.WriteStringValue(ExpiresOn.Value, "O"); + } writer.WritePropertyName("workerTags"u8); writer.WriteStartObject(); foreach (var item in WorkerTags) @@ -139,8 +145,8 @@ internal static AcsRouterWorkerOfferIssuedEventData DeserializeAcsRouterWorkerOf string offerId = default; int? jobPriority = default; IReadOnlyDictionary workerLabels = default; - DateTimeOffset offeredOn = default; - DateTimeOffset expiresOn = default; + DateTimeOffset? offeredOn = default; + DateTimeOffset? expiresOn = default; IReadOnlyDictionary workerTags = default; IReadOnlyDictionary jobLabels = default; IReadOnlyDictionary jobTags = default; @@ -183,11 +189,19 @@ internal static AcsRouterWorkerOfferIssuedEventData DeserializeAcsRouterWorkerOf } if (property.NameEquals("offeredOn"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } offeredOn = property.Value.GetDateTimeOffset("O"); continue; } if (property.NameEquals("expiresOn"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } expiresOn = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferIssuedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferIssuedEventData.cs index f964beba9d50..ac8aee0106c3 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferIssuedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerOfferIssuedEventData.cs @@ -15,13 +15,11 @@ public partial class AcsRouterWorkerOfferIssuedEventData : AcsRouterWorkerEventD { /// Initializes a new instance of . /// Router Worker Offer Issued Worker Labels. - /// Router Worker Offer Issued Time in UTC. - /// Router Worker Offer Issued Expiration Time in UTC. /// Router Worker Offer Issued Worker Tags. /// Router Worker Offer Issued Job Labels. /// Router Worker Offer Issued Job Tags. /// , , or is null. - internal AcsRouterWorkerOfferIssuedEventData(IReadOnlyDictionary workerLabels, DateTimeOffset offeredOn, DateTimeOffset expiresOn, IReadOnlyDictionary workerTags, IReadOnlyDictionary jobLabels, IReadOnlyDictionary jobTags) + internal AcsRouterWorkerOfferIssuedEventData(IReadOnlyDictionary workerLabels, IReadOnlyDictionary workerTags, IReadOnlyDictionary jobLabels, IReadOnlyDictionary jobTags) { Argument.AssertNotNull(workerLabels, nameof(workerLabels)); Argument.AssertNotNull(workerTags, nameof(workerTags)); @@ -29,8 +27,6 @@ internal AcsRouterWorkerOfferIssuedEventData(IReadOnlyDictionary Argument.AssertNotNull(jobTags, nameof(jobTags)); WorkerLabels = workerLabels; - OfferedOn = offeredOn; - ExpiresOn = expiresOn; WorkerTags = workerTags; JobLabels = jobLabels; JobTags = jobTags; @@ -51,7 +47,7 @@ internal AcsRouterWorkerOfferIssuedEventData(IReadOnlyDictionary /// Router Worker Offer Issued Worker Tags. /// Router Worker Offer Issued Job Labels. /// Router Worker Offer Issued Job Tags. - internal AcsRouterWorkerOfferIssuedEventData(string jobId, string channelReference, string channelId, IDictionary serializedAdditionalRawData, string workerId, string queueId, string offerId, int? jobPriority, IReadOnlyDictionary workerLabels, DateTimeOffset offeredOn, DateTimeOffset expiresOn, IReadOnlyDictionary workerTags, IReadOnlyDictionary jobLabels, IReadOnlyDictionary jobTags) : base(jobId, channelReference, channelId, serializedAdditionalRawData, workerId) + internal AcsRouterWorkerOfferIssuedEventData(string jobId, string channelReference, string channelId, IDictionary serializedAdditionalRawData, string workerId, string queueId, string offerId, int? jobPriority, IReadOnlyDictionary workerLabels, DateTimeOffset? offeredOn, DateTimeOffset? expiresOn, IReadOnlyDictionary workerTags, IReadOnlyDictionary jobLabels, IReadOnlyDictionary jobTags) : base(jobId, channelReference, channelId, serializedAdditionalRawData, workerId) { QueueId = queueId; OfferId = offerId; @@ -78,9 +74,9 @@ internal AcsRouterWorkerOfferIssuedEventData() /// Router Worker Offer Issued Worker Labels. public IReadOnlyDictionary WorkerLabels { get; } /// Router Worker Offer Issued Time in UTC. - public DateTimeOffset OfferedOn { get; } + public DateTimeOffset? OfferedOn { get; } /// Router Worker Offer Issued Expiration Time in UTC. - public DateTimeOffset ExpiresOn { get; } + public DateTimeOffset? ExpiresOn { get; } /// Router Worker Offer Issued Worker Tags. public IReadOnlyDictionary WorkerTags { get; } /// Router Worker Offer Issued Job Labels. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerSelector.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerSelector.Serialization.cs index bf357f3f303a..37c85b96aeb9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerSelector.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerSelector.Serialization.cs @@ -31,8 +31,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade writer.WritePropertyName("key"u8); writer.WriteStringValue(Key); } - writer.WritePropertyName("labelOperator"u8); - writer.WriteStringValue(LabelOperator.ToString()); + if (Optional.IsDefined(LabelOperator)) + { + writer.WritePropertyName("labelOperator"u8); + writer.WriteStringValue(LabelOperator.Value.ToString()); + } writer.WritePropertyName("value"u8); #if NET6_0_OR_GREATER writer.WriteRawValue(LabelValue); @@ -44,10 +47,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade #endif writer.WritePropertyName("ttlSeconds"u8); writer.WriteNumberValue(TimeToLive); - writer.WritePropertyName("state"u8); - writer.WriteStringValue(SelectorState.ToString()); - writer.WritePropertyName("expirationTime"u8); - writer.WriteStringValue(ExpirationTime, "O"); + if (Optional.IsDefined(SelectorState)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(SelectorState.Value.ToString()); + } + if (Optional.IsDefined(ExpirationTime)) + { + writer.WritePropertyName("expirationTime"u8); + writer.WriteStringValue(ExpirationTime.Value, "O"); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -87,11 +96,11 @@ internal static AcsRouterWorkerSelector DeserializeAcsRouterWorkerSelector(JsonE return null; } string key = default; - AcsRouterLabelOperator labelOperator = default; + AcsRouterLabelOperator? labelOperator = default; BinaryData value = default; double ttlSeconds = default; - AcsRouterWorkerSelectorState state = default; - DateTimeOffset expirationTime = default; + AcsRouterWorkerSelectorState? state = default; + DateTimeOffset? expirationTime = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -103,6 +112,10 @@ internal static AcsRouterWorkerSelector DeserializeAcsRouterWorkerSelector(JsonE } if (property.NameEquals("labelOperator"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } labelOperator = new AcsRouterLabelOperator(property.Value.GetString()); continue; } @@ -118,11 +131,19 @@ internal static AcsRouterWorkerSelector DeserializeAcsRouterWorkerSelector(JsonE } if (property.NameEquals("state"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } state = new AcsRouterWorkerSelectorState(property.Value.GetString()); continue; } if (property.NameEquals("expirationTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } expirationTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerSelector.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerSelector.cs index 0de728036de4..fa8232506cbe 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerSelector.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsRouterWorkerSelector.cs @@ -46,21 +46,15 @@ public partial class AcsRouterWorkerSelector private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Router Job Worker Selector Label Operator. /// Router Job Worker Selector Value. /// Router Job Worker Selector Time to Live in Seconds. - /// Router Job Worker Selector State. - /// Router Job Worker Selector Expiration Time. /// is null. - internal AcsRouterWorkerSelector(AcsRouterLabelOperator labelOperator, BinaryData labelValue, double timeToLive, AcsRouterWorkerSelectorState selectorState, DateTimeOffset expirationTime) + internal AcsRouterWorkerSelector(BinaryData labelValue, double timeToLive) { Argument.AssertNotNull(labelValue, nameof(labelValue)); - LabelOperator = labelOperator; LabelValue = labelValue; TimeToLive = timeToLive; - SelectorState = selectorState; - ExpirationTime = expirationTime; } /// Initializes a new instance of . @@ -71,7 +65,7 @@ internal AcsRouterWorkerSelector(AcsRouterLabelOperator labelOperator, BinaryDat /// Router Job Worker Selector State. /// Router Job Worker Selector Expiration Time. /// Keeps track of any properties unknown to the library. - internal AcsRouterWorkerSelector(string key, AcsRouterLabelOperator labelOperator, BinaryData labelValue, double timeToLive, AcsRouterWorkerSelectorState selectorState, DateTimeOffset expirationTime, IDictionary serializedAdditionalRawData) + internal AcsRouterWorkerSelector(string key, AcsRouterLabelOperator? labelOperator, BinaryData labelValue, double timeToLive, AcsRouterWorkerSelectorState? selectorState, DateTimeOffset? expirationTime, IDictionary serializedAdditionalRawData) { Key = key; LabelOperator = labelOperator; @@ -90,7 +84,7 @@ internal AcsRouterWorkerSelector() /// Router Job Worker Selector Key. public string Key { get; } /// Router Job Worker Selector Label Operator. - public AcsRouterLabelOperator LabelOperator { get; } + public AcsRouterLabelOperator? LabelOperator { get; } /// /// Router Job Worker Selector Value /// @@ -125,8 +119,8 @@ internal AcsRouterWorkerSelector() /// Router Job Worker Selector Time to Live in Seconds. public double TimeToLive { get; } /// Router Job Worker Selector State. - public AcsRouterWorkerSelectorState SelectorState { get; } + public AcsRouterWorkerSelectorState? SelectorState { get; } /// Router Job Worker Selector Expiration Time. - public DateTimeOffset ExpirationTime { get; } + public DateTimeOffset? ExpirationTime { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryAttemptProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryAttemptProperties.Serialization.cs index 80548b839ba3..103fc7067f93 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryAttemptProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryAttemptProperties.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo } writer.WriteStartObject(); - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } if (Optional.IsDefined(SegmentsSucceeded)) { writer.WritePropertyName("segmentsSucceeded"u8); @@ -76,7 +79,7 @@ internal static AcsSmsDeliveryAttemptProperties DeserializeAcsSmsDeliveryAttempt { return null; } - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; int? segmentsSucceeded = default; int? segmentsFailed = default; IDictionary serializedAdditionalRawData = default; @@ -85,6 +88,10 @@ internal static AcsSmsDeliveryAttemptProperties DeserializeAcsSmsDeliveryAttempt { if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryAttemptProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryAttemptProperties.cs index 79cc8014347e..21453a993a3f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryAttemptProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryAttemptProperties.cs @@ -46,10 +46,8 @@ public partial class AcsSmsDeliveryAttemptProperties private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// TimeStamp when delivery was attempted. - internal AcsSmsDeliveryAttemptProperties(DateTimeOffset timestamp) + internal AcsSmsDeliveryAttemptProperties() { - Timestamp = timestamp; } /// Initializes a new instance of . @@ -57,7 +55,7 @@ internal AcsSmsDeliveryAttemptProperties(DateTimeOffset timestamp) /// Number of segments that were successfully delivered. /// Number of segments whose delivery failed. /// Keeps track of any properties unknown to the library. - internal AcsSmsDeliveryAttemptProperties(DateTimeOffset timestamp, int? segmentsSucceeded, int? segmentsFailed, IDictionary serializedAdditionalRawData) + internal AcsSmsDeliveryAttemptProperties(DateTimeOffset? timestamp, int? segmentsSucceeded, int? segmentsFailed, IDictionary serializedAdditionalRawData) { Timestamp = timestamp; SegmentsSucceeded = segmentsSucceeded; @@ -65,13 +63,8 @@ internal AcsSmsDeliveryAttemptProperties(DateTimeOffset timestamp, int? segments _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal AcsSmsDeliveryAttemptProperties() - { - } - /// TimeStamp when delivery was attempted. - public DateTimeOffset Timestamp { get; } + public DateTimeOffset? Timestamp { get; } /// Number of segments that were successfully delivered. public int? SegmentsSucceeded { get; } /// Number of segments whose delivery failed. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryReportReceivedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryReportReceivedEventData.Serialization.cs index b9d9ab9043f0..56655757187b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryReportReceivedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryReportReceivedEventData.Serialization.cs @@ -43,8 +43,11 @@ void IJsonModel.Write(Utf8JsonWriter writ writer.WriteObjectValue(item, options); } writer.WriteEndArray(); - writer.WritePropertyName("receivedTimestamp"u8); - writer.WriteStringValue(ReceivedTimestamp, "O"); + if (Optional.IsDefined(ReceivedTimestamp)) + { + writer.WritePropertyName("receivedTimestamp"u8); + writer.WriteStringValue(ReceivedTimestamp.Value, "O"); + } if (Optional.IsDefined(Tag)) { writer.WritePropertyName("tag"u8); @@ -106,7 +109,7 @@ internal static AcsSmsDeliveryReportReceivedEventData DeserializeAcsSmsDeliveryR string deliveryStatus = default; string deliveryStatusDetails = default; IReadOnlyList deliveryAttempts = default; - DateTimeOffset receivedTimestamp = default; + DateTimeOffset? receivedTimestamp = default; string tag = default; string messageId = default; string @from = default; @@ -137,6 +140,10 @@ internal static AcsSmsDeliveryReportReceivedEventData DeserializeAcsSmsDeliveryR } if (property.NameEquals("receivedTimestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } receivedTimestamp = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryReportReceivedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryReportReceivedEventData.cs index 3f14eeca621a..3e3649e9affe 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryReportReceivedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsDeliveryReportReceivedEventData.cs @@ -16,14 +16,12 @@ public partial class AcsSmsDeliveryReportReceivedEventData : AcsSmsEventBaseProp { /// Initializes a new instance of . /// List of details of delivery attempts made. - /// The time at which the SMS delivery report was received. /// is null. - internal AcsSmsDeliveryReportReceivedEventData(IEnumerable deliveryAttempts, DateTimeOffset receivedTimestamp) + internal AcsSmsDeliveryReportReceivedEventData(IEnumerable deliveryAttempts) { Argument.AssertNotNull(deliveryAttempts, nameof(deliveryAttempts)); DeliveryAttempts = deliveryAttempts.ToList(); - ReceivedTimestamp = receivedTimestamp; } /// Initializes a new instance of . @@ -36,7 +34,7 @@ internal AcsSmsDeliveryReportReceivedEventData(IEnumerable List of details of delivery attempts made. /// The time at which the SMS delivery report was received. /// Customer Content. - internal AcsSmsDeliveryReportReceivedEventData(string messageId, string @from, string to, IDictionary serializedAdditionalRawData, string deliveryStatus, string deliveryStatusDetails, IReadOnlyList deliveryAttempts, DateTimeOffset receivedTimestamp, string tag) : base(messageId, @from, to, serializedAdditionalRawData) + internal AcsSmsDeliveryReportReceivedEventData(string messageId, string @from, string to, IDictionary serializedAdditionalRawData, string deliveryStatus, string deliveryStatusDetails, IReadOnlyList deliveryAttempts, DateTimeOffset? receivedTimestamp, string tag) : base(messageId, @from, to, serializedAdditionalRawData) { DeliveryStatus = deliveryStatus; DeliveryStatusDetails = deliveryStatusDetails; @@ -57,7 +55,7 @@ internal AcsSmsDeliveryReportReceivedEventData() /// List of details of delivery attempts made. public IReadOnlyList DeliveryAttempts { get; } /// The time at which the SMS delivery report was received. - public DateTimeOffset ReceivedTimestamp { get; } + public DateTimeOffset? ReceivedTimestamp { get; } /// Customer Content. public string Tag { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsReceivedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsReceivedEventData.Serialization.cs index 9d31fb716cde..bfda2ef8cd7e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsReceivedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsReceivedEventData.Serialization.cs @@ -31,8 +31,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade writer.WritePropertyName("message"u8); writer.WriteStringValue(Message); } - writer.WritePropertyName("receivedTimestamp"u8); - writer.WriteStringValue(ReceivedTimestamp, "O"); + if (Optional.IsDefined(ReceivedTimestamp)) + { + writer.WritePropertyName("receivedTimestamp"u8); + writer.WriteStringValue(ReceivedTimestamp.Value, "O"); + } if (Optional.IsDefined(MessageId)) { writer.WritePropertyName("messageId"u8); @@ -87,7 +90,7 @@ internal static AcsSmsReceivedEventData DeserializeAcsSmsReceivedEventData(JsonE return null; } string message = default; - DateTimeOffset receivedTimestamp = default; + DateTimeOffset? receivedTimestamp = default; string messageId = default; string @from = default; string to = default; @@ -102,6 +105,10 @@ internal static AcsSmsReceivedEventData DeserializeAcsSmsReceivedEventData(JsonE } if (property.NameEquals("receivedTimestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } receivedTimestamp = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsReceivedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsReceivedEventData.cs index 75b7cdc072c2..3891a5e2fa73 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsReceivedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsSmsReceivedEventData.cs @@ -14,10 +14,8 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class AcsSmsReceivedEventData : AcsSmsEventBaseProperties { /// Initializes a new instance of . - /// The time at which the SMS was received. - internal AcsSmsReceivedEventData(DateTimeOffset receivedTimestamp) + internal AcsSmsReceivedEventData() { - ReceivedTimestamp = receivedTimestamp; } /// Initializes a new instance of . @@ -27,20 +25,15 @@ internal AcsSmsReceivedEventData(DateTimeOffset receivedTimestamp) /// Keeps track of any properties unknown to the library. /// The SMS content. /// The time at which the SMS was received. - internal AcsSmsReceivedEventData(string messageId, string @from, string to, IDictionary serializedAdditionalRawData, string message, DateTimeOffset receivedTimestamp) : base(messageId, @from, to, serializedAdditionalRawData) + internal AcsSmsReceivedEventData(string messageId, string @from, string to, IDictionary serializedAdditionalRawData, string message, DateTimeOffset? receivedTimestamp) : base(messageId, @from, to, serializedAdditionalRawData) { Message = message; ReceivedTimestamp = receivedTimestamp; } - /// Initializes a new instance of for deserialization. - internal AcsSmsReceivedEventData() - { - } - /// The SMS content. public string Message { get; } /// The time at which the SMS was received. - public DateTimeOffset ReceivedTimestamp { get; } + public DateTimeOffset? ReceivedTimestamp { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppEventTypeDetail.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppEventTypeDetail.Serialization.cs index dd8ec339d1e5..b6036da6e5e1 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppEventTypeDetail.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppEventTypeDetail.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit } writer.WriteStartObject(); - writer.WritePropertyName("action"u8); - writer.WriteStringValue(Action.ToString()); + if (Optional.IsDefined(Action)) + { + writer.WritePropertyName("action"u8); + writer.WriteStringValue(Action.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -66,13 +69,17 @@ internal static AppEventTypeDetail DeserializeAppEventTypeDetail(JsonElement ele { return null; } - AppAction action = default; + AppAction? action = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("action"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } action = new AppAction(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppEventTypeDetail.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppEventTypeDetail.cs index 43550772de8f..236b12ab039c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppEventTypeDetail.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppEventTypeDetail.cs @@ -46,27 +46,20 @@ public partial class AppEventTypeDetail private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Type of action of the operation. - internal AppEventTypeDetail(AppAction action) + internal AppEventTypeDetail() { - Action = action; } /// Initializes a new instance of . /// Type of action of the operation. /// Keeps track of any properties unknown to the library. - internal AppEventTypeDetail(AppAction action, IDictionary serializedAdditionalRawData) + internal AppEventTypeDetail(AppAction? action, IDictionary serializedAdditionalRawData) { Action = action; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal AppEventTypeDetail() - { - } - /// Type of action of the operation. - public AppAction Action { get; } + public AppAction? Action { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppServicePlanEventTypeDetail.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppServicePlanEventTypeDetail.Serialization.cs index 08acdc74acc7..fbc2bc30f422 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppServicePlanEventTypeDetail.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppServicePlanEventTypeDetail.Serialization.cs @@ -26,12 +26,21 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode } writer.WriteStartObject(); - writer.WritePropertyName("stampKind"u8); - writer.WriteStringValue(StampKind.ToString()); - writer.WritePropertyName("action"u8); - writer.WriteStringValue(Action.ToString()); - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.ToString()); + if (Optional.IsDefined(StampKind)) + { + writer.WritePropertyName("stampKind"u8); + writer.WriteStringValue(StampKind.Value.ToString()); + } + if (Optional.IsDefined(Action)) + { + writer.WritePropertyName("action"u8); + writer.WriteStringValue(Action.Value.ToString()); + } + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -70,25 +79,37 @@ internal static AppServicePlanEventTypeDetail DeserializeAppServicePlanEventType { return null; } - StampKind stampKind = default; - AppServicePlanAction action = default; - AsyncStatus status = default; + StampKind? stampKind = default; + AppServicePlanAction? action = default; + AsyncStatus? status = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("stampKind"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } stampKind = new StampKind(property.Value.GetString()); continue; } if (property.NameEquals("action"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } action = new AppServicePlanAction(property.Value.GetString()); continue; } if (property.NameEquals("status"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } status = new AsyncStatus(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppServicePlanEventTypeDetail.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppServicePlanEventTypeDetail.cs index f4c61633045b..52cf7ca3592a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppServicePlanEventTypeDetail.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AppServicePlanEventTypeDetail.cs @@ -46,14 +46,8 @@ public partial class AppServicePlanEventTypeDetail private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Kind of environment where app service plan is. - /// Type of action on the app service plan. - /// Asynchronous operation status of the operation on the app service plan. - internal AppServicePlanEventTypeDetail(StampKind stampKind, AppServicePlanAction action, AsyncStatus status) + internal AppServicePlanEventTypeDetail() { - StampKind = stampKind; - Action = action; - Status = status; } /// Initializes a new instance of . @@ -61,7 +55,7 @@ internal AppServicePlanEventTypeDetail(StampKind stampKind, AppServicePlanAction /// Type of action on the app service plan. /// Asynchronous operation status of the operation on the app service plan. /// Keeps track of any properties unknown to the library. - internal AppServicePlanEventTypeDetail(StampKind stampKind, AppServicePlanAction action, AsyncStatus status, IDictionary serializedAdditionalRawData) + internal AppServicePlanEventTypeDetail(StampKind? stampKind, AppServicePlanAction? action, AsyncStatus? status, IDictionary serializedAdditionalRawData) { StampKind = stampKind; Action = action; @@ -69,16 +63,11 @@ internal AppServicePlanEventTypeDetail(StampKind stampKind, AppServicePlanAction _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal AppServicePlanEventTypeDetail() - { - } - /// Kind of environment where app service plan is. - public StampKind StampKind { get; } + public StampKind? StampKind { get; } /// Type of action on the app service plan. - public AppServicePlanAction Action { get; } + public AppServicePlanAction? Action { get; } /// Asynchronous operation status of the operation on the app service plan. - public AsyncStatus Status { get; } + public AsyncStatus? Status { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/CommunicationIdentifierModel.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/CommunicationIdentifierModel.Serialization.cs index ee382d67f2db..8f8c8383eb59 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/CommunicationIdentifierModel.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/CommunicationIdentifierModel.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model } writer.WriteStartObject(); - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind.Value.ToString()); + } if (Optional.IsDefined(RawId)) { writer.WritePropertyName("rawId"u8); @@ -79,7 +82,7 @@ internal static CommunicationIdentifierModel DeserializeCommunicationIdentifierM { return null; } - CommunicationIdentifierModelKind kind = default; + CommunicationIdentifierModelKind? kind = default; string rawId = default; CommunicationUserIdentifierModel communicationUser = default; PhoneNumberIdentifierModel phoneNumber = default; @@ -91,6 +94,10 @@ internal static CommunicationIdentifierModel DeserializeCommunicationIdentifierM { if (property.NameEquals("kind"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } kind = new CommunicationIdentifierModelKind(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/CommunicationIdentifierModel.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/CommunicationIdentifierModel.cs index 391730bf3a99..00e7ea22dcd5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/CommunicationIdentifierModel.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/CommunicationIdentifierModel.cs @@ -46,20 +46,18 @@ public partial class CommunicationIdentifierModel private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The identifier kind. Only required in responses. /// The communication user. /// The phone number. /// The Microsoft Teams user. /// The Microsoft Teams application. /// , , or is null. - internal CommunicationIdentifierModel(CommunicationIdentifierModelKind kind, CommunicationUserIdentifierModel communicationUser, PhoneNumberIdentifierModel phoneNumber, MicrosoftTeamsUserIdentifierModel microsoftTeamsUser, MicrosoftTeamsAppIdentifierModel microsoftTeamsApp) + internal CommunicationIdentifierModel(CommunicationUserIdentifierModel communicationUser, PhoneNumberIdentifierModel phoneNumber, MicrosoftTeamsUserIdentifierModel microsoftTeamsUser, MicrosoftTeamsAppIdentifierModel microsoftTeamsApp) { Argument.AssertNotNull(communicationUser, nameof(communicationUser)); Argument.AssertNotNull(phoneNumber, nameof(phoneNumber)); Argument.AssertNotNull(microsoftTeamsUser, nameof(microsoftTeamsUser)); Argument.AssertNotNull(microsoftTeamsApp, nameof(microsoftTeamsApp)); - Kind = kind; CommunicationUser = communicationUser; PhoneNumber = phoneNumber; MicrosoftTeamsUser = microsoftTeamsUser; @@ -74,7 +72,7 @@ internal CommunicationIdentifierModel(CommunicationIdentifierModelKind kind, Com /// The Microsoft Teams user. /// The Microsoft Teams application. /// Keeps track of any properties unknown to the library. - internal CommunicationIdentifierModel(CommunicationIdentifierModelKind kind, string rawId, CommunicationUserIdentifierModel communicationUser, PhoneNumberIdentifierModel phoneNumber, MicrosoftTeamsUserIdentifierModel microsoftTeamsUser, MicrosoftTeamsAppIdentifierModel microsoftTeamsApp, IDictionary serializedAdditionalRawData) + internal CommunicationIdentifierModel(CommunicationIdentifierModelKind? kind, string rawId, CommunicationUserIdentifierModel communicationUser, PhoneNumberIdentifierModel phoneNumber, MicrosoftTeamsUserIdentifierModel microsoftTeamsUser, MicrosoftTeamsAppIdentifierModel microsoftTeamsApp, IDictionary serializedAdditionalRawData) { Kind = kind; RawId = rawId; @@ -91,7 +89,7 @@ internal CommunicationIdentifierModel() } /// The identifier kind. Only required in responses. - public CommunicationIdentifierModelKind Kind { get; } + public CommunicationIdentifierModelKind? Kind { get; } /// Raw Id of the identifier. Optional in requests, required in responses. public string RawId { get; } /// The communication user. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryArtifactEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryArtifactEventData.Serialization.cs index e5ad95b47aec..fc59a5762926 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryArtifactEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryArtifactEventData.Serialization.cs @@ -31,8 +31,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WritePropertyName("id"u8); writer.WriteStringValue(Id); } - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } if (Optional.IsDefined(Action)) { writer.WritePropertyName("action"u8); @@ -86,7 +89,7 @@ internal static ContainerRegistryArtifactEventData DeserializeContainerRegistryA return null; } string id = default; - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string action = default; string location = default; ContainerRegistryArtifactEventTarget target = default; @@ -102,6 +105,10 @@ internal static ContainerRegistryArtifactEventData DeserializeContainerRegistryA } if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryArtifactEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryArtifactEventData.cs index 9fb1972e3d56..4f0d15c62790 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryArtifactEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryArtifactEventData.cs @@ -46,16 +46,14 @@ public partial class ContainerRegistryArtifactEventData private protected IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time at which the event occurred. /// The target of the event. /// The connected registry information if the event is generated by a connected registry. /// or is null. - internal ContainerRegistryArtifactEventData(DateTimeOffset timestamp, ContainerRegistryArtifactEventTarget target, ContainerRegistryEventConnectedRegistry connectedRegistry) + internal ContainerRegistryArtifactEventData(ContainerRegistryArtifactEventTarget target, ContainerRegistryEventConnectedRegistry connectedRegistry) { Argument.AssertNotNull(target, nameof(target)); Argument.AssertNotNull(connectedRegistry, nameof(connectedRegistry)); - Timestamp = timestamp; Target = target; ConnectedRegistry = connectedRegistry; } @@ -68,7 +66,7 @@ internal ContainerRegistryArtifactEventData(DateTimeOffset timestamp, ContainerR /// The target of the event. /// The connected registry information if the event is generated by a connected registry. /// Keeps track of any properties unknown to the library. - internal ContainerRegistryArtifactEventData(string id, DateTimeOffset timestamp, string action, string location, ContainerRegistryArtifactEventTarget target, ContainerRegistryEventConnectedRegistry connectedRegistry, IDictionary serializedAdditionalRawData) + internal ContainerRegistryArtifactEventData(string id, DateTimeOffset? timestamp, string action, string location, ContainerRegistryArtifactEventTarget target, ContainerRegistryEventConnectedRegistry connectedRegistry, IDictionary serializedAdditionalRawData) { Id = id; Timestamp = timestamp; @@ -87,7 +85,7 @@ internal ContainerRegistryArtifactEventData() /// The event ID. public string Id { get; } /// The time at which the event occurred. - public DateTimeOffset Timestamp { get; } + public DateTimeOffset? Timestamp { get; } /// The action that encompasses the provided event. public string Action { get; } /// The location of the event. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartDeletedEventData.Serialization.cs index 79582df5c7f6..7430e3eb3089 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartDeletedEventData.Serialization.cs @@ -31,8 +31,11 @@ void IJsonModel.Write(Utf8JsonWriter wri writer.WritePropertyName("id"u8); writer.WriteStringValue(Id); } - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } if (Optional.IsDefined(Action)) { writer.WritePropertyName("action"u8); @@ -86,7 +89,7 @@ internal static ContainerRegistryChartDeletedEventData DeserializeContainerRegis return null; } string id = default; - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string action = default; string location = default; ContainerRegistryArtifactEventTarget target = default; @@ -102,6 +105,10 @@ internal static ContainerRegistryChartDeletedEventData DeserializeContainerRegis } if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartDeletedEventData.cs index c51cacba09e9..1e84b783aed2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartDeletedEventData.cs @@ -14,11 +14,10 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class ContainerRegistryChartDeletedEventData : ContainerRegistryArtifactEventData { /// Initializes a new instance of . - /// The time at which the event occurred. /// The target of the event. /// The connected registry information if the event is generated by a connected registry. /// or is null. - internal ContainerRegistryChartDeletedEventData(DateTimeOffset timestamp, ContainerRegistryArtifactEventTarget target, ContainerRegistryEventConnectedRegistry connectedRegistry) : base(timestamp, target, connectedRegistry) + internal ContainerRegistryChartDeletedEventData(ContainerRegistryArtifactEventTarget target, ContainerRegistryEventConnectedRegistry connectedRegistry) : base(target, connectedRegistry) { Argument.AssertNotNull(target, nameof(target)); Argument.AssertNotNull(connectedRegistry, nameof(connectedRegistry)); @@ -32,7 +31,7 @@ internal ContainerRegistryChartDeletedEventData(DateTimeOffset timestamp, Contai /// The target of the event. /// The connected registry information if the event is generated by a connected registry. /// Keeps track of any properties unknown to the library. - internal ContainerRegistryChartDeletedEventData(string id, DateTimeOffset timestamp, string action, string location, ContainerRegistryArtifactEventTarget target, ContainerRegistryEventConnectedRegistry connectedRegistry, IDictionary serializedAdditionalRawData) : base(id, timestamp, action, location, target, connectedRegistry, serializedAdditionalRawData) + internal ContainerRegistryChartDeletedEventData(string id, DateTimeOffset? timestamp, string action, string location, ContainerRegistryArtifactEventTarget target, ContainerRegistryEventConnectedRegistry connectedRegistry, IDictionary serializedAdditionalRawData) : base(id, timestamp, action, location, target, connectedRegistry, serializedAdditionalRawData) { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartPushedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartPushedEventData.Serialization.cs index 026fad8fb588..ab8f85385723 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartPushedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartPushedEventData.Serialization.cs @@ -31,8 +31,11 @@ void IJsonModel.Write(Utf8JsonWriter writ writer.WritePropertyName("id"u8); writer.WriteStringValue(Id); } - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } if (Optional.IsDefined(Action)) { writer.WritePropertyName("action"u8); @@ -86,7 +89,7 @@ internal static ContainerRegistryChartPushedEventData DeserializeContainerRegist return null; } string id = default; - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string action = default; string location = default; ContainerRegistryArtifactEventTarget target = default; @@ -102,6 +105,10 @@ internal static ContainerRegistryChartPushedEventData DeserializeContainerRegist } if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartPushedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartPushedEventData.cs index 1e05ff576eac..276a12341e2f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartPushedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryChartPushedEventData.cs @@ -14,11 +14,10 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class ContainerRegistryChartPushedEventData : ContainerRegistryArtifactEventData { /// Initializes a new instance of . - /// The time at which the event occurred. /// The target of the event. /// The connected registry information if the event is generated by a connected registry. /// or is null. - internal ContainerRegistryChartPushedEventData(DateTimeOffset timestamp, ContainerRegistryArtifactEventTarget target, ContainerRegistryEventConnectedRegistry connectedRegistry) : base(timestamp, target, connectedRegistry) + internal ContainerRegistryChartPushedEventData(ContainerRegistryArtifactEventTarget target, ContainerRegistryEventConnectedRegistry connectedRegistry) : base(target, connectedRegistry) { Argument.AssertNotNull(target, nameof(target)); Argument.AssertNotNull(connectedRegistry, nameof(connectedRegistry)); @@ -32,7 +31,7 @@ internal ContainerRegistryChartPushedEventData(DateTimeOffset timestamp, Contain /// The target of the event. /// The connected registry information if the event is generated by a connected registry. /// Keeps track of any properties unknown to the library. - internal ContainerRegistryChartPushedEventData(string id, DateTimeOffset timestamp, string action, string location, ContainerRegistryArtifactEventTarget target, ContainerRegistryEventConnectedRegistry connectedRegistry, IDictionary serializedAdditionalRawData) : base(id, timestamp, action, location, target, connectedRegistry, serializedAdditionalRawData) + internal ContainerRegistryChartPushedEventData(string id, DateTimeOffset? timestamp, string action, string location, ContainerRegistryArtifactEventTarget target, ContainerRegistryEventConnectedRegistry connectedRegistry, IDictionary serializedAdditionalRawData) : base(id, timestamp, action, location, target, connectedRegistry, serializedAdditionalRawData) { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventData.Serialization.cs index 99e7b410c73a..7204aef8ab50 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventData.Serialization.cs @@ -31,8 +31,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe writer.WritePropertyName("id"u8); writer.WriteStringValue(Id); } - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } if (Optional.IsDefined(Action)) { writer.WritePropertyName("action"u8); @@ -92,7 +95,7 @@ internal static ContainerRegistryEventData DeserializeContainerRegistryEventData return null; } string id = default; - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string action = default; string location = default; ContainerRegistryEventTarget target = default; @@ -111,6 +114,10 @@ internal static ContainerRegistryEventData DeserializeContainerRegistryEventData } if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventData.cs index 6f9e05701bed..76f516a629a2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryEventData.cs @@ -46,14 +46,13 @@ public partial class ContainerRegistryEventData private protected IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time at which the event occurred. /// The target of the event. /// The request that generated the event. /// The agent that initiated the event. For most situations, this could be from the authorization context of the request. /// The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it. /// The connected registry information if the event is generated by a connected registry. /// , , , or is null. - internal ContainerRegistryEventData(DateTimeOffset timestamp, ContainerRegistryEventTarget target, ContainerRegistryEventRequest request, ContainerRegistryEventActor actor, ContainerRegistryEventSource source, ContainerRegistryEventConnectedRegistry connectedRegistry) + internal ContainerRegistryEventData(ContainerRegistryEventTarget target, ContainerRegistryEventRequest request, ContainerRegistryEventActor actor, ContainerRegistryEventSource source, ContainerRegistryEventConnectedRegistry connectedRegistry) { Argument.AssertNotNull(target, nameof(target)); Argument.AssertNotNull(request, nameof(request)); @@ -61,7 +60,6 @@ internal ContainerRegistryEventData(DateTimeOffset timestamp, ContainerRegistryE Argument.AssertNotNull(source, nameof(source)); Argument.AssertNotNull(connectedRegistry, nameof(connectedRegistry)); - Timestamp = timestamp; Target = target; Request = request; Actor = actor; @@ -80,7 +78,7 @@ internal ContainerRegistryEventData(DateTimeOffset timestamp, ContainerRegistryE /// The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it. /// The connected registry information if the event is generated by a connected registry. /// Keeps track of any properties unknown to the library. - internal ContainerRegistryEventData(string id, DateTimeOffset timestamp, string action, string location, ContainerRegistryEventTarget target, ContainerRegistryEventRequest request, ContainerRegistryEventActor actor, ContainerRegistryEventSource source, ContainerRegistryEventConnectedRegistry connectedRegistry, IDictionary serializedAdditionalRawData) + internal ContainerRegistryEventData(string id, DateTimeOffset? timestamp, string action, string location, ContainerRegistryEventTarget target, ContainerRegistryEventRequest request, ContainerRegistryEventActor actor, ContainerRegistryEventSource source, ContainerRegistryEventConnectedRegistry connectedRegistry, IDictionary serializedAdditionalRawData) { Id = id; Timestamp = timestamp; @@ -102,7 +100,7 @@ internal ContainerRegistryEventData() /// The event ID. public string Id { get; } /// The time at which the event occurred. - public DateTimeOffset Timestamp { get; } + public DateTimeOffset? Timestamp { get; } /// The action that encompasses the provided event. public string Action { get; } /// The location of the event. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImageDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImageDeletedEventData.Serialization.cs index 4455d40dd005..f8fd9a1db32d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImageDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImageDeletedEventData.Serialization.cs @@ -31,8 +31,11 @@ void IJsonModel.Write(Utf8JsonWriter wri writer.WritePropertyName("id"u8); writer.WriteStringValue(Id); } - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } if (Optional.IsDefined(Action)) { writer.WritePropertyName("action"u8); @@ -92,7 +95,7 @@ internal static ContainerRegistryImageDeletedEventData DeserializeContainerRegis return null; } string id = default; - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string action = default; string location = default; ContainerRegistryEventTarget target = default; @@ -111,6 +114,10 @@ internal static ContainerRegistryImageDeletedEventData DeserializeContainerRegis } if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImageDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImageDeletedEventData.cs index c839e9590b91..d6c928eaa580 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImageDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImageDeletedEventData.cs @@ -14,14 +14,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class ContainerRegistryImageDeletedEventData : ContainerRegistryEventData { /// Initializes a new instance of . - /// The time at which the event occurred. /// The target of the event. /// The request that generated the event. /// The agent that initiated the event. For most situations, this could be from the authorization context of the request. /// The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it. /// The connected registry information if the event is generated by a connected registry. /// , , , or is null. - internal ContainerRegistryImageDeletedEventData(DateTimeOffset timestamp, ContainerRegistryEventTarget target, ContainerRegistryEventRequest request, ContainerRegistryEventActor actor, ContainerRegistryEventSource source, ContainerRegistryEventConnectedRegistry connectedRegistry) : base(timestamp, target, request, actor, source, connectedRegistry) + internal ContainerRegistryImageDeletedEventData(ContainerRegistryEventTarget target, ContainerRegistryEventRequest request, ContainerRegistryEventActor actor, ContainerRegistryEventSource source, ContainerRegistryEventConnectedRegistry connectedRegistry) : base(target, request, actor, source, connectedRegistry) { Argument.AssertNotNull(target, nameof(target)); Argument.AssertNotNull(request, nameof(request)); @@ -41,7 +40,7 @@ internal ContainerRegistryImageDeletedEventData(DateTimeOffset timestamp, Contai /// The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it. /// The connected registry information if the event is generated by a connected registry. /// Keeps track of any properties unknown to the library. - internal ContainerRegistryImageDeletedEventData(string id, DateTimeOffset timestamp, string action, string location, ContainerRegistryEventTarget target, ContainerRegistryEventRequest request, ContainerRegistryEventActor actor, ContainerRegistryEventSource source, ContainerRegistryEventConnectedRegistry connectedRegistry, IDictionary serializedAdditionalRawData) : base(id, timestamp, action, location, target, request, actor, source, connectedRegistry, serializedAdditionalRawData) + internal ContainerRegistryImageDeletedEventData(string id, DateTimeOffset? timestamp, string action, string location, ContainerRegistryEventTarget target, ContainerRegistryEventRequest request, ContainerRegistryEventActor actor, ContainerRegistryEventSource source, ContainerRegistryEventConnectedRegistry connectedRegistry, IDictionary serializedAdditionalRawData) : base(id, timestamp, action, location, target, request, actor, source, connectedRegistry, serializedAdditionalRawData) { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImagePushedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImagePushedEventData.Serialization.cs index c2b595879fe7..3672163ec71e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImagePushedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImagePushedEventData.Serialization.cs @@ -31,8 +31,11 @@ void IJsonModel.Write(Utf8JsonWriter writ writer.WritePropertyName("id"u8); writer.WriteStringValue(Id); } - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } if (Optional.IsDefined(Action)) { writer.WritePropertyName("action"u8); @@ -92,7 +95,7 @@ internal static ContainerRegistryImagePushedEventData DeserializeContainerRegist return null; } string id = default; - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string action = default; string location = default; ContainerRegistryEventTarget target = default; @@ -111,6 +114,10 @@ internal static ContainerRegistryImagePushedEventData DeserializeContainerRegist } if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImagePushedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImagePushedEventData.cs index 32fbf481e6df..429b19cf91b5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImagePushedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ContainerRegistryImagePushedEventData.cs @@ -14,14 +14,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class ContainerRegistryImagePushedEventData : ContainerRegistryEventData { /// Initializes a new instance of . - /// The time at which the event occurred. /// The target of the event. /// The request that generated the event. /// The agent that initiated the event. For most situations, this could be from the authorization context of the request. /// The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it. /// The connected registry information if the event is generated by a connected registry. /// , , , or is null. - internal ContainerRegistryImagePushedEventData(DateTimeOffset timestamp, ContainerRegistryEventTarget target, ContainerRegistryEventRequest request, ContainerRegistryEventActor actor, ContainerRegistryEventSource source, ContainerRegistryEventConnectedRegistry connectedRegistry) : base(timestamp, target, request, actor, source, connectedRegistry) + internal ContainerRegistryImagePushedEventData(ContainerRegistryEventTarget target, ContainerRegistryEventRequest request, ContainerRegistryEventActor actor, ContainerRegistryEventSource source, ContainerRegistryEventConnectedRegistry connectedRegistry) : base(target, request, actor, source, connectedRegistry) { Argument.AssertNotNull(target, nameof(target)); Argument.AssertNotNull(request, nameof(request)); @@ -41,7 +40,7 @@ internal ContainerRegistryImagePushedEventData(DateTimeOffset timestamp, Contain /// The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it. /// The connected registry information if the event is generated by a connected registry. /// Keeps track of any properties unknown to the library. - internal ContainerRegistryImagePushedEventData(string id, DateTimeOffset timestamp, string action, string location, ContainerRegistryEventTarget target, ContainerRegistryEventRequest request, ContainerRegistryEventActor actor, ContainerRegistryEventSource source, ContainerRegistryEventConnectedRegistry connectedRegistry, IDictionary serializedAdditionalRawData) : base(id, timestamp, action, location, target, request, actor, source, connectedRegistry, serializedAdditionalRawData) + internal ContainerRegistryImagePushedEventData(string id, DateTimeOffset? timestamp, string action, string location, ContainerRegistryEventTarget target, ContainerRegistryEventRequest request, ContainerRegistryEventActor actor, ContainerRegistryEventSource source, ContainerRegistryEventConnectedRegistry connectedRegistry, IDictionary serializedAdditionalRawData) : base(id, timestamp, action, location, target, request, actor, source, connectedRegistry, serializedAdditionalRawData) { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyCompletedEventData.Serialization.cs index 3abd95697358..f6d1c91fc3e6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyCompletedEventData.Serialization.cs @@ -31,10 +31,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode writer.WritePropertyName("serialNumber"u8); writer.WriteStringValue(SerialNumber); } - writer.WritePropertyName("stageName"u8); - writer.WriteStringValue(StageName.ToString()); - writer.WritePropertyName("stageTime"u8); - writer.WriteStringValue(StageTime, "O"); + if (Optional.IsDefined(StageName)) + { + writer.WritePropertyName("stageName"u8); + writer.WriteStringValue(StageName.Value.ToString()); + } + if (Optional.IsDefined(StageTime)) + { + writer.WritePropertyName("stageTime"u8); + writer.WriteStringValue(StageTime.Value, "O"); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -74,8 +80,8 @@ internal static DataBoxCopyCompletedEventData DeserializeDataBoxCopyCompletedEve return null; } string serialNumber = default; - DataBoxStageName stageName = default; - DateTimeOffset stageTime = default; + DataBoxStageName? stageName = default; + DateTimeOffset? stageTime = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -87,11 +93,19 @@ internal static DataBoxCopyCompletedEventData DeserializeDataBoxCopyCompletedEve } if (property.NameEquals("stageName"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } stageName = new DataBoxStageName(property.Value.GetString()); continue; } if (property.NameEquals("stageTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } stageTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyCompletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyCompletedEventData.cs index 75a73c0475e9..9ec03066cd5e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyCompletedEventData.cs @@ -46,12 +46,8 @@ public partial class DataBoxCopyCompletedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Name of the current Stage. - /// The time at which the stage happened. - internal DataBoxCopyCompletedEventData(DataBoxStageName stageName, DateTimeOffset stageTime) + internal DataBoxCopyCompletedEventData() { - StageName = stageName; - StageTime = stageTime; } /// Initializes a new instance of . @@ -59,7 +55,7 @@ internal DataBoxCopyCompletedEventData(DataBoxStageName stageName, DateTimeOffse /// Name of the current Stage. /// The time at which the stage happened. /// Keeps track of any properties unknown to the library. - internal DataBoxCopyCompletedEventData(string serialNumber, DataBoxStageName stageName, DateTimeOffset stageTime, IDictionary serializedAdditionalRawData) + internal DataBoxCopyCompletedEventData(string serialNumber, DataBoxStageName? stageName, DateTimeOffset? stageTime, IDictionary serializedAdditionalRawData) { SerialNumber = serialNumber; StageName = stageName; @@ -67,16 +63,11 @@ internal DataBoxCopyCompletedEventData(string serialNumber, DataBoxStageName sta _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal DataBoxCopyCompletedEventData() - { - } - /// Serial Number of the device associated with the event. The list is comma separated if more than one serial number is associated. public string SerialNumber { get; } /// Name of the current Stage. - public DataBoxStageName StageName { get; } + public DataBoxStageName? StageName { get; } /// The time at which the stage happened. - public DateTimeOffset StageTime { get; } + public DateTimeOffset? StageTime { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyStartedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyStartedEventData.Serialization.cs index ba8950a8e9b2..e649959117c2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyStartedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyStartedEventData.Serialization.cs @@ -31,10 +31,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WritePropertyName("serialNumber"u8); writer.WriteStringValue(SerialNumber); } - writer.WritePropertyName("stageName"u8); - writer.WriteStringValue(StageName.ToString()); - writer.WritePropertyName("stageTime"u8); - writer.WriteStringValue(StageTime, "O"); + if (Optional.IsDefined(StageName)) + { + writer.WritePropertyName("stageName"u8); + writer.WriteStringValue(StageName.Value.ToString()); + } + if (Optional.IsDefined(StageTime)) + { + writer.WritePropertyName("stageTime"u8); + writer.WriteStringValue(StageTime.Value, "O"); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -74,8 +80,8 @@ internal static DataBoxCopyStartedEventData DeserializeDataBoxCopyStartedEventDa return null; } string serialNumber = default; - DataBoxStageName stageName = default; - DateTimeOffset stageTime = default; + DataBoxStageName? stageName = default; + DateTimeOffset? stageTime = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -87,11 +93,19 @@ internal static DataBoxCopyStartedEventData DeserializeDataBoxCopyStartedEventDa } if (property.NameEquals("stageName"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } stageName = new DataBoxStageName(property.Value.GetString()); continue; } if (property.NameEquals("stageTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } stageTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyStartedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyStartedEventData.cs index 2c607fcec991..137e68ee45c7 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyStartedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxCopyStartedEventData.cs @@ -46,12 +46,8 @@ public partial class DataBoxCopyStartedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Name of the current Stage. - /// The time at which the stage happened. - internal DataBoxCopyStartedEventData(DataBoxStageName stageName, DateTimeOffset stageTime) + internal DataBoxCopyStartedEventData() { - StageName = stageName; - StageTime = stageTime; } /// Initializes a new instance of . @@ -59,7 +55,7 @@ internal DataBoxCopyStartedEventData(DataBoxStageName stageName, DateTimeOffset /// Name of the current Stage. /// The time at which the stage happened. /// Keeps track of any properties unknown to the library. - internal DataBoxCopyStartedEventData(string serialNumber, DataBoxStageName stageName, DateTimeOffset stageTime, IDictionary serializedAdditionalRawData) + internal DataBoxCopyStartedEventData(string serialNumber, DataBoxStageName? stageName, DateTimeOffset? stageTime, IDictionary serializedAdditionalRawData) { SerialNumber = serialNumber; StageName = stageName; @@ -67,16 +63,11 @@ internal DataBoxCopyStartedEventData(string serialNumber, DataBoxStageName stage _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal DataBoxCopyStartedEventData() - { - } - /// Serial Number of the device associated with the event. The list is comma separated if more than one serial number is associated. public string SerialNumber { get; } /// Name of the current Stage. - public DataBoxStageName StageName { get; } + public DataBoxStageName? StageName { get; } /// The time at which the stage happened. - public DateTimeOffset StageTime { get; } + public DateTimeOffset? StageTime { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxOrderCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxOrderCompletedEventData.Serialization.cs index 52901785663d..9139088ced83 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxOrderCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxOrderCompletedEventData.Serialization.cs @@ -31,10 +31,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod writer.WritePropertyName("serialNumber"u8); writer.WriteStringValue(SerialNumber); } - writer.WritePropertyName("stageName"u8); - writer.WriteStringValue(StageName.ToString()); - writer.WritePropertyName("stageTime"u8); - writer.WriteStringValue(StageTime, "O"); + if (Optional.IsDefined(StageName)) + { + writer.WritePropertyName("stageName"u8); + writer.WriteStringValue(StageName.Value.ToString()); + } + if (Optional.IsDefined(StageTime)) + { + writer.WritePropertyName("stageTime"u8); + writer.WriteStringValue(StageTime.Value, "O"); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -74,8 +80,8 @@ internal static DataBoxOrderCompletedEventData DeserializeDataBoxOrderCompletedE return null; } string serialNumber = default; - DataBoxStageName stageName = default; - DateTimeOffset stageTime = default; + DataBoxStageName? stageName = default; + DateTimeOffset? stageTime = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -87,11 +93,19 @@ internal static DataBoxOrderCompletedEventData DeserializeDataBoxOrderCompletedE } if (property.NameEquals("stageName"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } stageName = new DataBoxStageName(property.Value.GetString()); continue; } if (property.NameEquals("stageTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } stageTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxOrderCompletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxOrderCompletedEventData.cs index b610d5819b26..7e38471a034c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxOrderCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/DataBoxOrderCompletedEventData.cs @@ -46,12 +46,8 @@ public partial class DataBoxOrderCompletedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Name of the current Stage. - /// The time at which the stage happened. - internal DataBoxOrderCompletedEventData(DataBoxStageName stageName, DateTimeOffset stageTime) + internal DataBoxOrderCompletedEventData() { - StageName = stageName; - StageTime = stageTime; } /// Initializes a new instance of . @@ -59,7 +55,7 @@ internal DataBoxOrderCompletedEventData(DataBoxStageName stageName, DateTimeOffs /// Name of the current Stage. /// The time at which the stage happened. /// Keeps track of any properties unknown to the library. - internal DataBoxOrderCompletedEventData(string serialNumber, DataBoxStageName stageName, DateTimeOffset stageTime, IDictionary serializedAdditionalRawData) + internal DataBoxOrderCompletedEventData(string serialNumber, DataBoxStageName? stageName, DateTimeOffset? stageTime, IDictionary serializedAdditionalRawData) { SerialNumber = serialNumber; StageName = stageName; @@ -67,16 +63,11 @@ internal DataBoxOrderCompletedEventData(string serialNumber, DataBoxStageName st _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal DataBoxOrderCompletedEventData() - { - } - /// Serial Number of the device associated with the event. The list is comma separated if more than one serial number is associated. public string SerialNumber { get; } /// Name of the current Stage. - public DataBoxStageName StageName { get; } + public DataBoxStageName? StageName { get; } /// The time at which the stage happened. - public DateTimeOffset StageTime { get; } + public DateTimeOffset? StageTime { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientCreatedOrUpdatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientCreatedOrUpdatedEventData.Serialization.cs similarity index 72% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientCreatedOrUpdatedEventData.Serialization.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientCreatedOrUpdatedEventData.Serialization.cs index 49fb2fc01a8d..5048a122d6b6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientCreatedOrUpdatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientCreatedOrUpdatedEventData.Serialization.cs @@ -13,25 +13,34 @@ namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class EventGridMQTTClientCreatedOrUpdatedEventData : IUtf8JsonSerializable, IJsonModel + public partial class EventGridMqttClientCreatedOrUpdatedEventData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(EventGridMQTTClientCreatedOrUpdatedEventData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientCreatedOrUpdatedEventData)} does not support writing '{format}' format."); } writer.WriteStartObject(); - writer.WritePropertyName("state"u8); - writer.WriteStringValue(State.ToString()); - writer.WritePropertyName("createdOn"u8); - writer.WriteStringValue(CreatedOn, "O"); - writer.WritePropertyName("updatedOn"u8); - writer.WriteStringValue(UpdatedOn, "O"); + if (Optional.IsDefined(State)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.Value.ToString()); + } + if (Optional.IsDefined(CreatedOn)) + { + writer.WritePropertyName("createdOn"u8); + writer.WriteStringValue(CreatedOn.Value, "O"); + } + if (Optional.IsDefined(UpdatedOn)) + { + writer.WritePropertyName("updatedOn"u8); + writer.WriteStringValue(UpdatedOn.Value, "O"); + } writer.WritePropertyName("attributes"u8); writer.WriteStartObject(); foreach (var item in Attributes) @@ -73,19 +82,19 @@ void IJsonModel.Write(Utf8JsonWrit writer.WriteEndObject(); } - EventGridMQTTClientCreatedOrUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + EventGridMqttClientCreatedOrUpdatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(EventGridMQTTClientCreatedOrUpdatedEventData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientCreatedOrUpdatedEventData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeEventGridMQTTClientCreatedOrUpdatedEventData(document.RootElement, options); + return DeserializeEventGridMqttClientCreatedOrUpdatedEventData(document.RootElement, options); } - internal static EventGridMQTTClientCreatedOrUpdatedEventData DeserializeEventGridMQTTClientCreatedOrUpdatedEventData(JsonElement element, ModelReaderWriterOptions options = null) + internal static EventGridMqttClientCreatedOrUpdatedEventData DeserializeEventGridMqttClientCreatedOrUpdatedEventData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -93,9 +102,9 @@ internal static EventGridMQTTClientCreatedOrUpdatedEventData DeserializeEventGri { return null; } - EventGridMQTTClientState state = default; - DateTimeOffset createdOn = default; - DateTimeOffset updatedOn = default; + EventGridMqttClientState? state = default; + DateTimeOffset? createdOn = default; + DateTimeOffset? updatedOn = default; IReadOnlyDictionary attributes = default; string clientAuthenticationName = default; string clientName = default; @@ -106,16 +115,28 @@ internal static EventGridMQTTClientCreatedOrUpdatedEventData DeserializeEventGri { if (property.NameEquals("state"u8)) { - state = new EventGridMQTTClientState(property.Value.GetString()); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + state = new EventGridMqttClientState(property.Value.GetString()); continue; } if (property.NameEquals("createdOn"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } createdOn = property.Value.GetDateTimeOffset("O"); continue; } if (property.NameEquals("updatedOn"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } updatedOn = property.Value.GetDateTimeOffset("O"); continue; } @@ -150,7 +171,7 @@ internal static EventGridMQTTClientCreatedOrUpdatedEventData DeserializeEventGri } } serializedAdditionalRawData = rawDataDictionary; - return new EventGridMQTTClientCreatedOrUpdatedEventData( + return new EventGridMqttClientCreatedOrUpdatedEventData( clientAuthenticationName, clientName, namespaceName, @@ -161,43 +182,43 @@ internal static EventGridMQTTClientCreatedOrUpdatedEventData DeserializeEventGri attributes); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(EventGridMQTTClientCreatedOrUpdatedEventData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientCreatedOrUpdatedEventData)} does not support writing '{options.Format}' format."); } } - EventGridMQTTClientCreatedOrUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + EventGridMqttClientCreatedOrUpdatedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeEventGridMQTTClientCreatedOrUpdatedEventData(document.RootElement, options); + return DeserializeEventGridMqttClientCreatedOrUpdatedEventData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(EventGridMQTTClientCreatedOrUpdatedEventData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientCreatedOrUpdatedEventData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static new EventGridMQTTClientCreatedOrUpdatedEventData FromResponse(Response response) + internal static new EventGridMqttClientCreatedOrUpdatedEventData FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeEventGridMQTTClientCreatedOrUpdatedEventData(document.RootElement); + return DeserializeEventGridMqttClientCreatedOrUpdatedEventData(document.RootElement); } /// Convert into a . diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientCreatedOrUpdatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientCreatedOrUpdatedEventData.cs similarity index 66% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientCreatedOrUpdatedEventData.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientCreatedOrUpdatedEventData.cs index dde0c575b475..72730dd319f6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientCreatedOrUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientCreatedOrUpdatedEventData.cs @@ -11,29 +11,19 @@ namespace Azure.Messaging.EventGrid.SystemEvents { /// Event data for Microsoft.EventGrid.MQTTClientCreatedOrUpdated event. - public partial class EventGridMQTTClientCreatedOrUpdatedEventData : EventGridMQTTClientEventData + public partial class EventGridMqttClientCreatedOrUpdatedEventData : EventGridMqttClientEventData { - /// Initializes a new instance of . - /// Configured state of the client. The value could be Enabled or Disabled. - /// Time the client resource is created based on the provider's UTC time. - /// - /// Time the client resource is last updated based on the provider's UTC time. If - /// the client resource was never updated, this value is identical to the value of - /// the 'createdOn' property. - /// + /// Initializes a new instance of . /// The key-value attributes that are assigned to the client resource. /// is null. - internal EventGridMQTTClientCreatedOrUpdatedEventData(EventGridMQTTClientState state, DateTimeOffset createdOn, DateTimeOffset updatedOn, IReadOnlyDictionary attributes) + internal EventGridMqttClientCreatedOrUpdatedEventData(IReadOnlyDictionary attributes) { Argument.AssertNotNull(attributes, nameof(attributes)); - State = state; - CreatedOn = createdOn; - UpdatedOn = updatedOn; Attributes = attributes; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// /// Unique identifier for the MQTT client that the client presents to the service /// for authentication. This case-sensitive string can be up to 128 characters @@ -50,7 +40,7 @@ internal EventGridMQTTClientCreatedOrUpdatedEventData(EventGridMQTTClientState s /// the 'createdOn' property. /// /// The key-value attributes that are assigned to the client resource. - internal EventGridMQTTClientCreatedOrUpdatedEventData(string clientAuthenticationName, string clientName, string namespaceName, IDictionary serializedAdditionalRawData, EventGridMQTTClientState state, DateTimeOffset createdOn, DateTimeOffset updatedOn, IReadOnlyDictionary attributes) : base(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData) + internal EventGridMqttClientCreatedOrUpdatedEventData(string clientAuthenticationName, string clientName, string namespaceName, IDictionary serializedAdditionalRawData, EventGridMqttClientState? state, DateTimeOffset? createdOn, DateTimeOffset? updatedOn, IReadOnlyDictionary attributes) : base(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData) { State = state; CreatedOn = createdOn; @@ -58,21 +48,21 @@ internal EventGridMQTTClientCreatedOrUpdatedEventData(string clientAuthenticatio Attributes = attributes; } - /// Initializes a new instance of for deserialization. - internal EventGridMQTTClientCreatedOrUpdatedEventData() + /// Initializes a new instance of for deserialization. + internal EventGridMqttClientCreatedOrUpdatedEventData() { } /// Configured state of the client. The value could be Enabled or Disabled. - public EventGridMQTTClientState State { get; } + public EventGridMqttClientState? State { get; } /// Time the client resource is created based on the provider's UTC time. - public DateTimeOffset CreatedOn { get; } + public DateTimeOffset? CreatedOn { get; } /// /// Time the client resource is last updated based on the provider's UTC time. If /// the client resource was never updated, this value is identical to the value of /// the 'createdOn' property. /// - public DateTimeOffset UpdatedOn { get; } + public DateTimeOffset? UpdatedOn { get; } /// The key-value attributes that are assigned to the client resource. public IReadOnlyDictionary Attributes { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientDeletedEventData.Serialization.cs similarity index 77% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientDeletedEventData.Serialization.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientDeletedEventData.Serialization.cs index 202ba7488023..d601458d16e8 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientDeletedEventData.Serialization.cs @@ -13,16 +13,16 @@ namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class EventGridMQTTClientDeletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class EventGridMqttClientDeletedEventData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(EventGridMQTTClientDeletedEventData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientDeletedEventData)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -59,19 +59,19 @@ void IJsonModel.Write(Utf8JsonWriter writer writer.WriteEndObject(); } - EventGridMQTTClientDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + EventGridMqttClientDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(EventGridMQTTClientDeletedEventData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientDeletedEventData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeEventGridMQTTClientDeletedEventData(document.RootElement, options); + return DeserializeEventGridMqttClientDeletedEventData(document.RootElement, options); } - internal static EventGridMQTTClientDeletedEventData DeserializeEventGridMQTTClientDeletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + internal static EventGridMqttClientDeletedEventData DeserializeEventGridMqttClientDeletedEventData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -107,46 +107,46 @@ internal static EventGridMQTTClientDeletedEventData DeserializeEventGridMQTTClie } } serializedAdditionalRawData = rawDataDictionary; - return new EventGridMQTTClientDeletedEventData(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData); + return new EventGridMqttClientDeletedEventData(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(EventGridMQTTClientDeletedEventData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientDeletedEventData)} does not support writing '{options.Format}' format."); } } - EventGridMQTTClientDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + EventGridMqttClientDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeEventGridMQTTClientDeletedEventData(document.RootElement, options); + return DeserializeEventGridMqttClientDeletedEventData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(EventGridMQTTClientDeletedEventData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientDeletedEventData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static new EventGridMQTTClientDeletedEventData FromResponse(Response response) + internal static new EventGridMqttClientDeletedEventData FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeEventGridMQTTClientDeletedEventData(document.RootElement); + return DeserializeEventGridMqttClientDeletedEventData(document.RootElement); } /// Convert into a . diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientDeletedEventData.cs similarity index 81% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientDeletedEventData.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientDeletedEventData.cs index a5660854989a..fe2cbeabdd6c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientDeletedEventData.cs @@ -11,14 +11,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents { /// Event data for Microsoft.EventGrid.MQTTClientDeleted event. - public partial class EventGridMQTTClientDeletedEventData : EventGridMQTTClientEventData + public partial class EventGridMqttClientDeletedEventData : EventGridMqttClientEventData { - /// Initializes a new instance of . - internal EventGridMQTTClientDeletedEventData() + /// Initializes a new instance of . + internal EventGridMqttClientDeletedEventData() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// /// Unique identifier for the MQTT client that the client presents to the service /// for authentication. This case-sensitive string can be up to 128 characters @@ -27,7 +27,7 @@ internal EventGridMQTTClientDeletedEventData() /// Name of the client resource in the Event Grid namespace. /// Name of the Event Grid namespace where the MQTT client was created or updated. /// Keeps track of any properties unknown to the library. - internal EventGridMQTTClientDeletedEventData(string clientAuthenticationName, string clientName, string namespaceName, IDictionary serializedAdditionalRawData) : base(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData) + internal EventGridMqttClientDeletedEventData(string clientAuthenticationName, string clientName, string namespaceName, IDictionary serializedAdditionalRawData) : base(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData) { } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientDisconnectionReason.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientDisconnectionReason.cs similarity index 64% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientDisconnectionReason.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientDisconnectionReason.cs index f8a93ea73d8f..a01f9343b34f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientDisconnectionReason.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientDisconnectionReason.cs @@ -11,13 +11,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents { /// EventGrid MQTT Client Disconnection Reason. - public readonly partial struct EventGridMQTTClientDisconnectionReason : IEquatable + public readonly partial struct EventGridMqttClientDisconnectionReason : IEquatable { private readonly string _value; - /// Initializes a new instance of . + /// Initializes a new instance of . /// is null. - public EventGridMQTTClientDisconnectionReason(string value) + public EventGridMqttClientDisconnectionReason(string value) { _value = value ?? throw new ArgumentNullException(nameof(value)); } @@ -35,39 +35,39 @@ public EventGridMQTTClientDisconnectionReason(string value) private const string SessionTakenOverValue = "SessionTakenOver"; /// The client got disconnected for any authentication reasons (for example, certificate expired, client got disabled, or client configuration changed). - public static EventGridMQTTClientDisconnectionReason ClientAuthenticationError { get; } = new EventGridMQTTClientDisconnectionReason(ClientAuthenticationErrorValue); + public static EventGridMqttClientDisconnectionReason ClientAuthenticationError { get; } = new EventGridMqttClientDisconnectionReason(ClientAuthenticationErrorValue); /// The client got disconnected for any authorization reasons (for example, because of a change in the configuration of topic spaces, permission bindings, or client groups). - public static EventGridMQTTClientDisconnectionReason ClientAuthorizationError { get; } = new EventGridMQTTClientDisconnectionReason(ClientAuthorizationErrorValue); + public static EventGridMqttClientDisconnectionReason ClientAuthorizationError { get; } = new EventGridMqttClientDisconnectionReason(ClientAuthorizationErrorValue); /// The client sent a bad request or used one of the unsupported features that resulted in a connection termination by the service. - public static EventGridMQTTClientDisconnectionReason ClientError { get; } = new EventGridMQTTClientDisconnectionReason(ClientErrorValue); + public static EventGridMqttClientDisconnectionReason ClientError { get; } = new EventGridMqttClientDisconnectionReason(ClientErrorValue); /// The client initiated a graceful disconnect through a DISCONNECT packet for MQTT or a close frame for MQTT over WebSocket. - public static EventGridMQTTClientDisconnectionReason ClientInitiatedDisconnect { get; } = new EventGridMQTTClientDisconnectionReason(ClientInitiatedDisconnectValue); + public static EventGridMqttClientDisconnectionReason ClientInitiatedDisconnect { get; } = new EventGridMqttClientDisconnectionReason(ClientInitiatedDisconnectValue); /// The client-server connection is lost. (EXCHANGE ONLINE PROTECTION). - public static EventGridMQTTClientDisconnectionReason ConnectionLost { get; } = new EventGridMQTTClientDisconnectionReason(ConnectionLostValue); + public static EventGridMqttClientDisconnectionReason ConnectionLost { get; } = new EventGridMqttClientDisconnectionReason(ConnectionLostValue); /// The client's IP address is blocked by IP filter or Private links configuration. - public static EventGridMQTTClientDisconnectionReason IpForbidden { get; } = new EventGridMQTTClientDisconnectionReason(IpForbiddenValue); + public static EventGridMqttClientDisconnectionReason IpForbidden { get; } = new EventGridMqttClientDisconnectionReason(IpForbiddenValue); /// The client exceeded one or more of the throttling limits that resulted in a connection termination by the service. - public static EventGridMQTTClientDisconnectionReason QuotaExceeded { get; } = new EventGridMQTTClientDisconnectionReason(QuotaExceededValue); + public static EventGridMqttClientDisconnectionReason QuotaExceeded { get; } = new EventGridMqttClientDisconnectionReason(QuotaExceededValue); /// The connection got terminated due to an unexpected server error. - public static EventGridMQTTClientDisconnectionReason ServerError { get; } = new EventGridMQTTClientDisconnectionReason(ServerErrorValue); + public static EventGridMqttClientDisconnectionReason ServerError { get; } = new EventGridMqttClientDisconnectionReason(ServerErrorValue); /// The server initiates a graceful disconnect for any operational reason. - public static EventGridMQTTClientDisconnectionReason ServerInitiatedDisconnect { get; } = new EventGridMQTTClientDisconnectionReason(ServerInitiatedDisconnectValue); + public static EventGridMqttClientDisconnectionReason ServerInitiatedDisconnect { get; } = new EventGridMqttClientDisconnectionReason(ServerInitiatedDisconnectValue); /// The client's queue for unacknowledged QoS1 messages reached its limit, which resulted in a connection termination by the server. - public static EventGridMQTTClientDisconnectionReason SessionOverflow { get; } = new EventGridMQTTClientDisconnectionReason(SessionOverflowValue); + public static EventGridMqttClientDisconnectionReason SessionOverflow { get; } = new EventGridMqttClientDisconnectionReason(SessionOverflowValue); /// The client reconnected with the same authentication name, which resulted in the termination of the previous connection. - public static EventGridMQTTClientDisconnectionReason SessionTakenOver { get; } = new EventGridMQTTClientDisconnectionReason(SessionTakenOverValue); - /// Determines if two values are the same. - public static bool operator ==(EventGridMQTTClientDisconnectionReason left, EventGridMQTTClientDisconnectionReason right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(EventGridMQTTClientDisconnectionReason left, EventGridMQTTClientDisconnectionReason right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator EventGridMQTTClientDisconnectionReason(string value) => new EventGridMQTTClientDisconnectionReason(value); + public static EventGridMqttClientDisconnectionReason SessionTakenOver { get; } = new EventGridMqttClientDisconnectionReason(SessionTakenOverValue); + /// Determines if two values are the same. + public static bool operator ==(EventGridMqttClientDisconnectionReason left, EventGridMqttClientDisconnectionReason right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(EventGridMqttClientDisconnectionReason left, EventGridMqttClientDisconnectionReason right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator EventGridMqttClientDisconnectionReason(string value) => new EventGridMqttClientDisconnectionReason(value); /// [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is EventGridMQTTClientDisconnectionReason other && Equals(other); + public override bool Equals(object obj) => obj is EventGridMqttClientDisconnectionReason other && Equals(other); /// - public bool Equals(EventGridMQTTClientDisconnectionReason other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + public bool Equals(EventGridMqttClientDisconnectionReason other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); /// [EditorBrowsable(EditorBrowsableState.Never)] diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientEventData.Serialization.cs similarity index 78% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientEventData.Serialization.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientEventData.Serialization.cs index b34b7eb136fe..6df34fcf65c0 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientEventData.Serialization.cs @@ -13,16 +13,16 @@ namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class EventGridMQTTClientEventData : IUtf8JsonSerializable, IJsonModel + public partial class EventGridMqttClientEventData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(EventGridMQTTClientEventData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientEventData)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -59,19 +59,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WriteEndObject(); } - EventGridMQTTClientEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + EventGridMqttClientEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(EventGridMQTTClientEventData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientEventData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeEventGridMQTTClientEventData(document.RootElement, options); + return DeserializeEventGridMqttClientEventData(document.RootElement, options); } - internal static EventGridMQTTClientEventData DeserializeEventGridMQTTClientEventData(JsonElement element, ModelReaderWriterOptions options = null) + internal static EventGridMqttClientEventData DeserializeEventGridMqttClientEventData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -107,46 +107,46 @@ internal static EventGridMQTTClientEventData DeserializeEventGridMQTTClientEvent } } serializedAdditionalRawData = rawDataDictionary; - return new EventGridMQTTClientEventData(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData); + return new EventGridMqttClientEventData(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(EventGridMQTTClientEventData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientEventData)} does not support writing '{options.Format}' format."); } } - EventGridMQTTClientEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + EventGridMqttClientEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeEventGridMQTTClientEventData(document.RootElement, options); + return DeserializeEventGridMqttClientEventData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(EventGridMQTTClientEventData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientEventData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static EventGridMQTTClientEventData FromResponse(Response response) + internal static EventGridMqttClientEventData FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeEventGridMQTTClientEventData(document.RootElement); + return DeserializeEventGridMqttClientEventData(document.RootElement); } /// Convert into a . diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientEventData.cs similarity index 93% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientEventData.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientEventData.cs index 8c69eb51fec2..0dd6c22cfee5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientEventData.cs @@ -11,7 +11,7 @@ namespace Azure.Messaging.EventGrid.SystemEvents { /// Schema of the Data property of an EventGridEvent for MQTT Client state changes. - public partial class EventGridMQTTClientEventData + public partial class EventGridMqttClientEventData { /// /// Keeps track of any properties unknown to the library. @@ -45,12 +45,12 @@ public partial class EventGridMQTTClientEventData /// private protected IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal EventGridMQTTClientEventData() + /// Initializes a new instance of . + internal EventGridMqttClientEventData() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// /// Unique identifier for the MQTT client that the client presents to the service /// for authentication. This case-sensitive string can be up to 128 characters @@ -59,7 +59,7 @@ internal EventGridMQTTClientEventData() /// Name of the client resource in the Event Grid namespace. /// Name of the Event Grid namespace where the MQTT client was created or updated. /// Keeps track of any properties unknown to the library. - internal EventGridMQTTClientEventData(string clientAuthenticationName, string clientName, string namespaceName, IDictionary serializedAdditionalRawData) + internal EventGridMqttClientEventData(string clientAuthenticationName, string clientName, string namespaceName, IDictionary serializedAdditionalRawData) { ClientAuthenticationName = clientAuthenticationName; ClientName = clientName; diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientSessionConnectedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionConnectedEventData.Serialization.cs similarity index 81% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientSessionConnectedEventData.Serialization.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionConnectedEventData.Serialization.cs index b3a900803938..abc1054608d0 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientSessionConnectedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionConnectedEventData.Serialization.cs @@ -13,16 +13,16 @@ namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class EventGridMQTTClientSessionConnectedEventData : IUtf8JsonSerializable, IJsonModel + public partial class EventGridMqttClientSessionConnectedEventData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(EventGridMQTTClientSessionConnectedEventData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientSessionConnectedEventData)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -69,19 +69,19 @@ void IJsonModel.Write(Utf8JsonWrit writer.WriteEndObject(); } - EventGridMQTTClientSessionConnectedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + EventGridMqttClientSessionConnectedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(EventGridMQTTClientSessionConnectedEventData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientSessionConnectedEventData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeEventGridMQTTClientSessionConnectedEventData(document.RootElement, options); + return DeserializeEventGridMqttClientSessionConnectedEventData(document.RootElement, options); } - internal static EventGridMQTTClientSessionConnectedEventData DeserializeEventGridMQTTClientSessionConnectedEventData(JsonElement element, ModelReaderWriterOptions options = null) + internal static EventGridMqttClientSessionConnectedEventData DeserializeEventGridMqttClientSessionConnectedEventData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -133,7 +133,7 @@ internal static EventGridMQTTClientSessionConnectedEventData DeserializeEventGri } } serializedAdditionalRawData = rawDataDictionary; - return new EventGridMQTTClientSessionConnectedEventData( + return new EventGridMqttClientSessionConnectedEventData( clientAuthenticationName, clientName, namespaceName, @@ -142,43 +142,43 @@ internal static EventGridMQTTClientSessionConnectedEventData DeserializeEventGri sequenceNumber); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(EventGridMQTTClientSessionConnectedEventData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientSessionConnectedEventData)} does not support writing '{options.Format}' format."); } } - EventGridMQTTClientSessionConnectedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + EventGridMqttClientSessionConnectedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeEventGridMQTTClientSessionConnectedEventData(document.RootElement, options); + return DeserializeEventGridMqttClientSessionConnectedEventData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(EventGridMQTTClientSessionConnectedEventData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientSessionConnectedEventData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static new EventGridMQTTClientSessionConnectedEventData FromResponse(Response response) + internal static new EventGridMqttClientSessionConnectedEventData FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeEventGridMQTTClientSessionConnectedEventData(document.RootElement); + return DeserializeEventGridMqttClientSessionConnectedEventData(document.RootElement); } /// Convert into a . diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientSessionConnectedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionConnectedEventData.cs similarity index 88% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientSessionConnectedEventData.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionConnectedEventData.cs index 3a8dcde09042..755f075c2a35 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientSessionConnectedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionConnectedEventData.cs @@ -11,14 +11,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents { /// Event data for Microsoft.EventGrid.MQTTClientSessionConnected event. - public partial class EventGridMQTTClientSessionConnectedEventData : EventGridMQTTClientEventData + public partial class EventGridMqttClientSessionConnectedEventData : EventGridMqttClientEventData { - /// Initializes a new instance of . - internal EventGridMQTTClientSessionConnectedEventData() + /// Initializes a new instance of . + internal EventGridMqttClientSessionConnectedEventData() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// /// Unique identifier for the MQTT client that the client presents to the service /// for authentication. This case-sensitive string can be up to 128 characters @@ -36,7 +36,7 @@ internal EventGridMQTTClientSessionConnectedEventData() /// disconnected events. Latest event will have a sequence number that is higher /// than the previous event. /// - internal EventGridMQTTClientSessionConnectedEventData(string clientAuthenticationName, string clientName, string namespaceName, IDictionary serializedAdditionalRawData, string clientSessionName, long? sequenceNumber) : base(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData) + internal EventGridMqttClientSessionConnectedEventData(string clientAuthenticationName, string clientName, string namespaceName, IDictionary serializedAdditionalRawData, string clientSessionName, long? sequenceNumber) : base(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData) { ClientSessionName = clientSessionName; SequenceNumber = sequenceNumber; diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientSessionDisconnectedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionDisconnectedEventData.Serialization.cs similarity index 77% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientSessionDisconnectedEventData.Serialization.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionDisconnectedEventData.Serialization.cs index 77166f0c803c..b3900d971e47 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientSessionDisconnectedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionDisconnectedEventData.Serialization.cs @@ -13,16 +13,16 @@ namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class EventGridMQTTClientSessionDisconnectedEventData : IUtf8JsonSerializable, IJsonModel + public partial class EventGridMqttClientSessionDisconnectedEventData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(EventGridMQTTClientSessionDisconnectedEventData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientSessionDisconnectedEventData)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -36,8 +36,11 @@ void IJsonModel.Write(Utf8JsonW writer.WritePropertyName("sequenceNumber"u8); writer.WriteNumberValue(SequenceNumber.Value); } - writer.WritePropertyName("disconnectionReason"u8); - writer.WriteStringValue(DisconnectionReason.ToString()); + if (Optional.IsDefined(DisconnectionReason)) + { + writer.WritePropertyName("disconnectionReason"u8); + writer.WriteStringValue(DisconnectionReason.Value.ToString()); + } if (Optional.IsDefined(ClientAuthenticationName)) { writer.WritePropertyName("clientAuthenticationName"u8); @@ -71,19 +74,19 @@ void IJsonModel.Write(Utf8JsonW writer.WriteEndObject(); } - EventGridMQTTClientSessionDisconnectedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + EventGridMqttClientSessionDisconnectedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(EventGridMQTTClientSessionDisconnectedEventData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientSessionDisconnectedEventData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeEventGridMQTTClientSessionDisconnectedEventData(document.RootElement, options); + return DeserializeEventGridMqttClientSessionDisconnectedEventData(document.RootElement, options); } - internal static EventGridMQTTClientSessionDisconnectedEventData DeserializeEventGridMQTTClientSessionDisconnectedEventData(JsonElement element, ModelReaderWriterOptions options = null) + internal static EventGridMqttClientSessionDisconnectedEventData DeserializeEventGridMqttClientSessionDisconnectedEventData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -93,7 +96,7 @@ internal static EventGridMQTTClientSessionDisconnectedEventData DeserializeEvent } string clientSessionName = default; long? sequenceNumber = default; - EventGridMQTTClientDisconnectionReason disconnectionReason = default; + EventGridMqttClientDisconnectionReason? disconnectionReason = default; string clientAuthenticationName = default; string clientName = default; string namespaceName = default; @@ -117,7 +120,11 @@ internal static EventGridMQTTClientSessionDisconnectedEventData DeserializeEvent } if (property.NameEquals("disconnectionReason"u8)) { - disconnectionReason = new EventGridMQTTClientDisconnectionReason(property.Value.GetString()); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + disconnectionReason = new EventGridMqttClientDisconnectionReason(property.Value.GetString()); continue; } if (property.NameEquals("clientAuthenticationName"u8)) @@ -141,7 +148,7 @@ internal static EventGridMQTTClientSessionDisconnectedEventData DeserializeEvent } } serializedAdditionalRawData = rawDataDictionary; - return new EventGridMQTTClientSessionDisconnectedEventData( + return new EventGridMqttClientSessionDisconnectedEventData( clientAuthenticationName, clientName, namespaceName, @@ -151,43 +158,43 @@ internal static EventGridMQTTClientSessionDisconnectedEventData DeserializeEvent disconnectionReason); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(EventGridMQTTClientSessionDisconnectedEventData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientSessionDisconnectedEventData)} does not support writing '{options.Format}' format."); } } - EventGridMQTTClientSessionDisconnectedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + EventGridMqttClientSessionDisconnectedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeEventGridMQTTClientSessionDisconnectedEventData(document.RootElement, options); + return DeserializeEventGridMqttClientSessionDisconnectedEventData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(EventGridMQTTClientSessionDisconnectedEventData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(EventGridMqttClientSessionDisconnectedEventData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static new EventGridMQTTClientSessionDisconnectedEventData FromResponse(Response response) + internal static new EventGridMqttClientSessionDisconnectedEventData FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeEventGridMQTTClientSessionDisconnectedEventData(document.RootElement); + return DeserializeEventGridMqttClientSessionDisconnectedEventData(document.RootElement); } /// Convert into a . diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientSessionDisconnectedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionDisconnectedEventData.cs similarity index 72% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientSessionDisconnectedEventData.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionDisconnectedEventData.cs index 2f9fcb7f6158..64de1dbf64a2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientSessionDisconnectedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientSessionDisconnectedEventData.cs @@ -11,19 +11,14 @@ namespace Azure.Messaging.EventGrid.SystemEvents { /// Event data for Microsoft.EventGrid.MQTTClientSessionDisconnected event. - public partial class EventGridMQTTClientSessionDisconnectedEventData : EventGridMQTTClientEventData + public partial class EventGridMqttClientSessionDisconnectedEventData : EventGridMqttClientEventData { - /// Initializes a new instance of . - /// - /// Reason for the disconnection of the MQTT client's session. The value could be - /// one of the values in the disconnection reasons table. - /// - internal EventGridMQTTClientSessionDisconnectedEventData(EventGridMQTTClientDisconnectionReason disconnectionReason) + /// Initializes a new instance of . + internal EventGridMqttClientSessionDisconnectedEventData() { - DisconnectionReason = disconnectionReason; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// /// Unique identifier for the MQTT client that the client presents to the service /// for authentication. This case-sensitive string can be up to 128 characters @@ -45,18 +40,13 @@ internal EventGridMQTTClientSessionDisconnectedEventData(EventGridMQTTClientDisc /// Reason for the disconnection of the MQTT client's session. The value could be /// one of the values in the disconnection reasons table. /// - internal EventGridMQTTClientSessionDisconnectedEventData(string clientAuthenticationName, string clientName, string namespaceName, IDictionary serializedAdditionalRawData, string clientSessionName, long? sequenceNumber, EventGridMQTTClientDisconnectionReason disconnectionReason) : base(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData) + internal EventGridMqttClientSessionDisconnectedEventData(string clientAuthenticationName, string clientName, string namespaceName, IDictionary serializedAdditionalRawData, string clientSessionName, long? sequenceNumber, EventGridMqttClientDisconnectionReason? disconnectionReason) : base(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData) { ClientSessionName = clientSessionName; SequenceNumber = sequenceNumber; DisconnectionReason = disconnectionReason; } - /// Initializes a new instance of for deserialization. - internal EventGridMQTTClientSessionDisconnectedEventData() - { - } - /// /// Unique identifier for the MQTT client's session. This case-sensitive string can /// be up to 128 characters long, and supports UTF-8 characters. @@ -72,6 +62,6 @@ internal EventGridMQTTClientSessionDisconnectedEventData() /// Reason for the disconnection of the MQTT client's session. The value could be /// one of the values in the disconnection reasons table. /// - public EventGridMQTTClientDisconnectionReason DisconnectionReason { get; } + public EventGridMqttClientDisconnectionReason? DisconnectionReason { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientState.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientState.cs similarity index 59% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientState.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientState.cs index bebc9f25a2ab..676053abaa4d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMQTTClientState.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridMqttClientState.cs @@ -11,13 +11,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents { /// EventGrid MQTT Client State. - public readonly partial struct EventGridMQTTClientState : IEquatable + public readonly partial struct EventGridMqttClientState : IEquatable { private readonly string _value; - /// Initializes a new instance of . + /// Initializes a new instance of . /// is null. - public EventGridMQTTClientState(string value) + public EventGridMqttClientState(string value) { _value = value ?? throw new ArgumentNullException(nameof(value)); } @@ -26,21 +26,21 @@ public EventGridMQTTClientState(string value) private const string DisabledValue = "Disabled"; /// Enabled. - public static EventGridMQTTClientState Enabled { get; } = new EventGridMQTTClientState(EnabledValue); + public static EventGridMqttClientState Enabled { get; } = new EventGridMqttClientState(EnabledValue); /// Disabled. - public static EventGridMQTTClientState Disabled { get; } = new EventGridMQTTClientState(DisabledValue); - /// Determines if two values are the same. - public static bool operator ==(EventGridMQTTClientState left, EventGridMQTTClientState right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(EventGridMQTTClientState left, EventGridMQTTClientState right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator EventGridMQTTClientState(string value) => new EventGridMQTTClientState(value); + public static EventGridMqttClientState Disabled { get; } = new EventGridMqttClientState(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(EventGridMqttClientState left, EventGridMqttClientState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(EventGridMqttClientState left, EventGridMqttClientState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator EventGridMqttClientState(string value) => new EventGridMqttClientState(value); /// [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is EventGridMQTTClientState other && Equals(other); + public override bool Equals(object obj) => obj is EventGridMqttClientState other && Equals(other); /// - public bool Equals(EventGridMQTTClientState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + public bool Equals(EventGridMqttClientState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); /// [EditorBrowsable(EditorBrowsableState.Never)] diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridSystemEventsModelFactory.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridSystemEventsModelFactory.cs index 3b3868356788..e8b8fa9728a6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridSystemEventsModelFactory.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridSystemEventsModelFactory.cs @@ -526,7 +526,7 @@ public static AcsIncomingCallEventData AcsIncomingCallEventData(CommunicationIde /// The Microsoft Teams user. /// The Microsoft Teams application. /// A new instance for mocking. - public static CommunicationIdentifierModel CommunicationIdentifierModel(CommunicationIdentifierModelKind kind = default, string rawId = null, CommunicationUserIdentifierModel communicationUser = null, PhoneNumberIdentifierModel phoneNumber = null, MicrosoftTeamsUserIdentifierModel microsoftTeamsUser = null, MicrosoftTeamsAppIdentifierModel microsoftTeamsApp = null) + public static CommunicationIdentifierModel CommunicationIdentifierModel(CommunicationIdentifierModelKind? kind = null, string rawId = null, CommunicationUserIdentifierModel communicationUser = null, PhoneNumberIdentifierModel phoneNumber = null, MicrosoftTeamsUserIdentifierModel microsoftTeamsUser = null, MicrosoftTeamsAppIdentifierModel microsoftTeamsApp = null) { return new CommunicationIdentifierModel( kind, @@ -559,7 +559,7 @@ public static PhoneNumberIdentifierModel PhoneNumberIdentifierModel(string value /// True if the Microsoft Teams user is anonymous. By default false if missing. /// The cloud that the Microsoft Teams user belongs to. By default 'public' if missing. /// A new instance for mocking. - public static MicrosoftTeamsUserIdentifierModel MicrosoftTeamsUserIdentifierModel(string userId = null, bool? isAnonymous = null, CommunicationCloudEnvironmentModel cloud = default) + public static MicrosoftTeamsUserIdentifierModel MicrosoftTeamsUserIdentifierModel(string userId = null, bool? isAnonymous = null, CommunicationCloudEnvironmentModel? cloud = null) { return new MicrosoftTeamsUserIdentifierModel(userId, isAnonymous, cloud, serializedAdditionalRawData: null); } @@ -568,7 +568,7 @@ public static MicrosoftTeamsUserIdentifierModel MicrosoftTeamsUserIdentifierMode /// The Id of the Microsoft Teams application. /// The cloud that the Microsoft Teams application belongs to. By default 'public' if missing. /// A new instance for mocking. - public static MicrosoftTeamsAppIdentifierModel MicrosoftTeamsAppIdentifierModel(string appId = null, CommunicationCloudEnvironmentModel cloud = default) + public static MicrosoftTeamsAppIdentifierModel MicrosoftTeamsAppIdentifierModel(string appId = null, CommunicationCloudEnvironmentModel? cloud = null) { return new MicrosoftTeamsAppIdentifierModel(appId, cloud, serializedAdditionalRawData: null); } @@ -623,7 +623,7 @@ public static AcsChatEventInThreadBaseProperties AcsChatEventInThreadBasePropert /// The type of the message. /// The version of the message. /// A new instance for mocking. - public static AcsChatMessageEventBaseProperties AcsChatMessageEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset composeTime = default, string type = null, long? version = null) + public static AcsChatMessageEventBaseProperties AcsChatMessageEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset? composeTime = null, string type = null, long? version = null) { return new AcsChatMessageEventBaseProperties( recipientCommunicationIdentifier, @@ -651,7 +651,7 @@ public static AcsChatMessageEventBaseProperties AcsChatMessageEventBasePropertie /// The body of the chat message. /// The chat message metadata. /// A new instance for mocking. - public static AcsChatMessageReceivedEventData AcsChatMessageReceivedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset composeTime = default, string type = null, long? version = null, string messageBody = null, IReadOnlyDictionary metadata = null) + public static AcsChatMessageReceivedEventData AcsChatMessageReceivedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset? composeTime = null, string type = null, long? version = null, string messageBody = null, IReadOnlyDictionary metadata = null) { metadata ??= new Dictionary(); @@ -680,7 +680,7 @@ public static AcsChatMessageReceivedEventData AcsChatMessageReceivedEventData(Co /// The type of the message. /// The version of the message. /// A new instance for mocking. - public static AcsChatMessageEventInThreadBaseProperties AcsChatMessageEventInThreadBaseProperties(string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset composeTime = default, string type = null, long? version = null) + public static AcsChatMessageEventInThreadBaseProperties AcsChatMessageEventInThreadBaseProperties(string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset? composeTime = null, string type = null, long? version = null) { return new AcsChatMessageEventInThreadBaseProperties( transactionId, @@ -706,7 +706,7 @@ public static AcsChatMessageEventInThreadBaseProperties AcsChatMessageEventInThr /// The body of the chat message. /// The chat message metadata. /// A new instance for mocking. - public static AcsChatMessageReceivedInThreadEventData AcsChatMessageReceivedInThreadEventData(string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset composeTime = default, string type = null, long? version = null, string messageBody = null, IReadOnlyDictionary metadata = null) + public static AcsChatMessageReceivedInThreadEventData AcsChatMessageReceivedInThreadEventData(string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset? composeTime = null, string type = null, long? version = null, string messageBody = null, IReadOnlyDictionary metadata = null) { metadata ??= new Dictionary(); @@ -738,7 +738,7 @@ public static AcsChatMessageReceivedInThreadEventData AcsChatMessageReceivedInTh /// The chat message metadata. /// The time at which the message was edited. /// A new instance for mocking. - public static AcsChatMessageEditedEventData AcsChatMessageEditedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset composeTime = default, string type = null, long? version = null, string messageBody = null, IReadOnlyDictionary metadata = null, DateTimeOffset editTime = default) + public static AcsChatMessageEditedEventData AcsChatMessageEditedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset? composeTime = null, string type = null, long? version = null, string messageBody = null, IReadOnlyDictionary metadata = null, DateTimeOffset? editTime = null) { metadata ??= new Dictionary(); @@ -771,7 +771,7 @@ public static AcsChatMessageEditedEventData AcsChatMessageEditedEventData(Commun /// The chat message metadata. /// The time at which the message was edited. /// A new instance for mocking. - public static AcsChatMessageEditedInThreadEventData AcsChatMessageEditedInThreadEventData(string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset composeTime = default, string type = null, long? version = null, string messageBody = null, IReadOnlyDictionary metadata = null, DateTimeOffset editTime = default) + public static AcsChatMessageEditedInThreadEventData AcsChatMessageEditedInThreadEventData(string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset? composeTime = null, string type = null, long? version = null, string messageBody = null, IReadOnlyDictionary metadata = null, DateTimeOffset? editTime = null) { metadata ??= new Dictionary(); @@ -802,7 +802,7 @@ public static AcsChatMessageEditedInThreadEventData AcsChatMessageEditedInThread /// The version of the message. /// The time at which the message was deleted. /// A new instance for mocking. - public static AcsChatMessageDeletedEventData AcsChatMessageDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset composeTime = default, string type = null, long? version = null, DateTimeOffset deleteTime = default) + public static AcsChatMessageDeletedEventData AcsChatMessageDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset? composeTime = null, string type = null, long? version = null, DateTimeOffset? deleteTime = null) { return new AcsChatMessageDeletedEventData( recipientCommunicationIdentifier, @@ -829,7 +829,7 @@ public static AcsChatMessageDeletedEventData AcsChatMessageDeletedEventData(Comm /// The version of the message. /// The time at which the message was deleted. /// A new instance for mocking. - public static AcsChatMessageDeletedInThreadEventData AcsChatMessageDeletedInThreadEventData(string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset composeTime = default, string type = null, long? version = null, DateTimeOffset deleteTime = default) + public static AcsChatMessageDeletedInThreadEventData AcsChatMessageDeletedInThreadEventData(string transactionId = null, string threadId = null, string messageId = null, CommunicationIdentifierModel senderCommunicationIdentifier = null, string senderDisplayName = null, DateTimeOffset? composeTime = null, string type = null, long? version = null, DateTimeOffset? deleteTime = null) { return new AcsChatMessageDeletedInThreadEventData( transactionId, @@ -851,7 +851,7 @@ public static AcsChatMessageDeletedInThreadEventData AcsChatMessageDeletedInThre /// The original creation time of the thread. /// The version of the thread. /// A new instance for mocking. - public static AcsChatThreadEventBaseProperties AcsChatThreadEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, DateTimeOffset createTime = default, long? version = null) + public static AcsChatThreadEventBaseProperties AcsChatThreadEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, DateTimeOffset? createTime = null, long? version = null) { return new AcsChatThreadEventBaseProperties( recipientCommunicationIdentifier, @@ -873,7 +873,7 @@ public static AcsChatThreadEventBaseProperties AcsChatThreadEventBaseProperties( /// The thread metadata. /// The list of properties of participants who are part of the thread. /// A new instance for mocking. - public static AcsChatThreadCreatedWithUserEventData AcsChatThreadCreatedWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, DateTimeOffset createTime = default, long? version = null, CommunicationIdentifierModel createdByCommunicationIdentifier = null, IReadOnlyDictionary properties = null, IReadOnlyDictionary metadata = null, IEnumerable participants = null) + public static AcsChatThreadCreatedWithUserEventData AcsChatThreadCreatedWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, DateTimeOffset? createTime = null, long? version = null, CommunicationIdentifierModel createdByCommunicationIdentifier = null, IReadOnlyDictionary properties = null, IReadOnlyDictionary metadata = null, IEnumerable participants = null) { properties ??= new Dictionary(); metadata ??= new Dictionary(); @@ -910,7 +910,7 @@ public static AcsChatThreadParticipantProperties AcsChatThreadParticipantPropert /// The original creation time of the thread. /// The version of the thread. /// A new instance for mocking. - public static AcsChatThreadEventInThreadBaseProperties AcsChatThreadEventInThreadBaseProperties(string transactionId = null, string threadId = null, DateTimeOffset createTime = default, long? version = null) + public static AcsChatThreadEventInThreadBaseProperties AcsChatThreadEventInThreadBaseProperties(string transactionId = null, string threadId = null, DateTimeOffset? createTime = null, long? version = null) { return new AcsChatThreadEventInThreadBaseProperties(transactionId, threadId, serializedAdditionalRawData: null, createTime, version); } @@ -925,7 +925,7 @@ public static AcsChatThreadEventInThreadBaseProperties AcsChatThreadEventInThrea /// The thread metadata. /// The list of properties of participants who are part of the thread. /// A new instance for mocking. - public static AcsChatThreadCreatedEventData AcsChatThreadCreatedEventData(string transactionId = null, string threadId = null, DateTimeOffset createTime = default, long? version = null, CommunicationIdentifierModel createdByCommunicationIdentifier = null, IReadOnlyDictionary properties = null, IReadOnlyDictionary metadata = null, IEnumerable participants = null) + public static AcsChatThreadCreatedEventData AcsChatThreadCreatedEventData(string transactionId = null, string threadId = null, DateTimeOffset? createTime = null, long? version = null, CommunicationIdentifierModel createdByCommunicationIdentifier = null, IReadOnlyDictionary properties = null, IReadOnlyDictionary metadata = null, IEnumerable participants = null) { properties ??= new Dictionary(); metadata ??= new Dictionary(); @@ -952,7 +952,7 @@ public static AcsChatThreadCreatedEventData AcsChatThreadCreatedEventData(string /// The communication identifier of the user who deleted the thread. /// The deletion time of the thread. /// A new instance for mocking. - public static AcsChatThreadWithUserDeletedEventData AcsChatThreadWithUserDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, DateTimeOffset createTime = default, long? version = null, CommunicationIdentifierModel deletedByCommunicationIdentifier = null, DateTimeOffset deleteTime = default) + public static AcsChatThreadWithUserDeletedEventData AcsChatThreadWithUserDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, DateTimeOffset? createTime = null, long? version = null, CommunicationIdentifierModel deletedByCommunicationIdentifier = null, DateTimeOffset? deleteTime = null) { return new AcsChatThreadWithUserDeletedEventData( recipientCommunicationIdentifier, @@ -973,7 +973,7 @@ public static AcsChatThreadWithUserDeletedEventData AcsChatThreadWithUserDeleted /// The communication identifier of the user who deleted the thread. /// The deletion time of the thread. /// A new instance for mocking. - public static AcsChatThreadDeletedEventData AcsChatThreadDeletedEventData(string transactionId = null, string threadId = null, DateTimeOffset createTime = default, long? version = null, CommunicationIdentifierModel deletedByCommunicationIdentifier = null, DateTimeOffset deleteTime = default) + public static AcsChatThreadDeletedEventData AcsChatThreadDeletedEventData(string transactionId = null, string threadId = null, DateTimeOffset? createTime = null, long? version = null, CommunicationIdentifierModel deletedByCommunicationIdentifier = null, DateTimeOffset? deleteTime = null) { return new AcsChatThreadDeletedEventData( transactionId, @@ -996,7 +996,7 @@ public static AcsChatThreadDeletedEventData AcsChatThreadDeletedEventData(string /// The thread metadata. /// The updated thread properties. /// A new instance for mocking. - public static AcsChatThreadPropertiesUpdatedPerUserEventData AcsChatThreadPropertiesUpdatedPerUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, DateTimeOffset createTime = default, long? version = null, CommunicationIdentifierModel editedByCommunicationIdentifier = null, DateTimeOffset editTime = default, IReadOnlyDictionary metadata = null, IReadOnlyDictionary properties = null) + public static AcsChatThreadPropertiesUpdatedPerUserEventData AcsChatThreadPropertiesUpdatedPerUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, DateTimeOffset? createTime = null, long? version = null, CommunicationIdentifierModel editedByCommunicationIdentifier = null, DateTimeOffset? editTime = null, IReadOnlyDictionary metadata = null, IReadOnlyDictionary properties = null) { metadata ??= new Dictionary(); properties ??= new Dictionary(); @@ -1024,7 +1024,7 @@ public static AcsChatThreadPropertiesUpdatedPerUserEventData AcsChatThreadProper /// The updated thread properties. /// The thread metadata. /// A new instance for mocking. - public static AcsChatThreadPropertiesUpdatedEventData AcsChatThreadPropertiesUpdatedEventData(string transactionId = null, string threadId = null, DateTimeOffset createTime = default, long? version = null, CommunicationIdentifierModel editedByCommunicationIdentifier = null, DateTimeOffset editTime = default, IReadOnlyDictionary properties = null, IReadOnlyDictionary metadata = null) + public static AcsChatThreadPropertiesUpdatedEventData AcsChatThreadPropertiesUpdatedEventData(string transactionId = null, string threadId = null, DateTimeOffset? createTime = null, long? version = null, CommunicationIdentifierModel editedByCommunicationIdentifier = null, DateTimeOffset? editTime = null, IReadOnlyDictionary properties = null, IReadOnlyDictionary metadata = null) { properties ??= new Dictionary(); metadata ??= new Dictionary(); @@ -1051,7 +1051,7 @@ public static AcsChatThreadPropertiesUpdatedEventData AcsChatThreadPropertiesUpd /// The communication identifier of the user who added the user. /// The details of the user who was added. /// A new instance for mocking. - public static AcsChatParticipantAddedToThreadWithUserEventData AcsChatParticipantAddedToThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, DateTimeOffset createTime = default, long? version = null, DateTimeOffset time = default, CommunicationIdentifierModel addedByCommunicationIdentifier = null, AcsChatThreadParticipantProperties participantAdded = null) + public static AcsChatParticipantAddedToThreadWithUserEventData AcsChatParticipantAddedToThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, DateTimeOffset? createTime = null, long? version = null, DateTimeOffset? time = null, CommunicationIdentifierModel addedByCommunicationIdentifier = null, AcsChatThreadParticipantProperties participantAdded = null) { return new AcsChatParticipantAddedToThreadWithUserEventData( recipientCommunicationIdentifier, @@ -1075,7 +1075,7 @@ public static AcsChatParticipantAddedToThreadWithUserEventData AcsChatParticipan /// The communication identifier of the user who removed the user. /// The details of the user who was removed. /// A new instance for mocking. - public static AcsChatParticipantRemovedFromThreadWithUserEventData AcsChatParticipantRemovedFromThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, DateTimeOffset createTime = default, long? version = null, DateTimeOffset time = default, CommunicationIdentifierModel removedByCommunicationIdentifier = null, AcsChatThreadParticipantProperties participantRemoved = null) + public static AcsChatParticipantRemovedFromThreadWithUserEventData AcsChatParticipantRemovedFromThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier = null, string transactionId = null, string threadId = null, DateTimeOffset? createTime = null, long? version = null, DateTimeOffset? time = null, CommunicationIdentifierModel removedByCommunicationIdentifier = null, AcsChatThreadParticipantProperties participantRemoved = null) { return new AcsChatParticipantRemovedFromThreadWithUserEventData( recipientCommunicationIdentifier, @@ -1097,7 +1097,7 @@ public static AcsChatParticipantRemovedFromThreadWithUserEventData AcsChatPartic /// The details of the user who was added. /// The version of the thread. /// A new instance for mocking. - public static AcsChatParticipantAddedToThreadEventData AcsChatParticipantAddedToThreadEventData(string transactionId = null, string threadId = null, DateTimeOffset time = default, CommunicationIdentifierModel addedByCommunicationIdentifier = null, AcsChatThreadParticipantProperties participantAdded = null, long? version = null) + public static AcsChatParticipantAddedToThreadEventData AcsChatParticipantAddedToThreadEventData(string transactionId = null, string threadId = null, DateTimeOffset? time = null, CommunicationIdentifierModel addedByCommunicationIdentifier = null, AcsChatThreadParticipantProperties participantAdded = null, long? version = null) { return new AcsChatParticipantAddedToThreadEventData( transactionId, @@ -1117,7 +1117,7 @@ public static AcsChatParticipantAddedToThreadEventData AcsChatParticipantAddedTo /// The details of the user who was removed. /// The version of the thread. /// A new instance for mocking. - public static AcsChatParticipantRemovedFromThreadEventData AcsChatParticipantRemovedFromThreadEventData(string transactionId = null, string threadId = null, DateTimeOffset time = default, CommunicationIdentifierModel removedByCommunicationIdentifier = null, AcsChatThreadParticipantProperties participantRemoved = null, long? version = null) + public static AcsChatParticipantRemovedFromThreadEventData AcsChatParticipantRemovedFromThreadEventData(string transactionId = null, string threadId = null, DateTimeOffset? time = null, CommunicationIdentifierModel removedByCommunicationIdentifier = null, AcsChatThreadParticipantProperties participantRemoved = null, long? version = null) { return new AcsChatParticipantRemovedFromThreadEventData( transactionId, @@ -1149,7 +1149,7 @@ public static AcsSmsEventBaseProperties AcsSmsEventBaseProperties(string message /// The time at which the SMS delivery report was received. /// Customer Content. /// A new instance for mocking. - public static AcsSmsDeliveryReportReceivedEventData AcsSmsDeliveryReportReceivedEventData(string messageId = null, string @from = null, string to = null, string deliveryStatus = null, string deliveryStatusDetails = null, IEnumerable deliveryAttempts = null, DateTimeOffset receivedTimestamp = default, string tag = null) + public static AcsSmsDeliveryReportReceivedEventData AcsSmsDeliveryReportReceivedEventData(string messageId = null, string @from = null, string to = null, string deliveryStatus = null, string deliveryStatusDetails = null, IEnumerable deliveryAttempts = null, DateTimeOffset? receivedTimestamp = null, string tag = null) { deliveryAttempts ??= new List(); @@ -1170,7 +1170,7 @@ public static AcsSmsDeliveryReportReceivedEventData AcsSmsDeliveryReportReceived /// Number of segments that were successfully delivered. /// Number of segments whose delivery failed. /// A new instance for mocking. - public static AcsSmsDeliveryAttemptProperties AcsSmsDeliveryAttemptProperties(DateTimeOffset timestamp = default, int? segmentsSucceeded = null, int? segmentsFailed = null) + public static AcsSmsDeliveryAttemptProperties AcsSmsDeliveryAttemptProperties(DateTimeOffset? timestamp = null, int? segmentsSucceeded = null, int? segmentsFailed = null) { return new AcsSmsDeliveryAttemptProperties(timestamp, segmentsSucceeded, segmentsFailed, serializedAdditionalRawData: null); } @@ -1182,7 +1182,7 @@ public static AcsSmsDeliveryAttemptProperties AcsSmsDeliveryAttemptProperties(Da /// The SMS content. /// The time at which the SMS was received. /// A new instance for mocking. - public static AcsSmsReceivedEventData AcsSmsReceivedEventData(string messageId = null, string @from = null, string to = null, string message = null, DateTimeOffset receivedTimestamp = default) + public static AcsSmsReceivedEventData AcsSmsReceivedEventData(string messageId = null, string @from = null, string to = null, string message = null, DateTimeOffset? receivedTimestamp = null) { return new AcsSmsReceivedEventData( messageId, @@ -1202,7 +1202,7 @@ public static AcsSmsReceivedEventData AcsSmsReceivedEventData(string messageId = /// The recording format type - Mp4, Mp3, Wav. /// The reason for ending recording session. /// A new instance for mocking. - public static AcsRecordingFileStatusUpdatedEventData AcsRecordingFileStatusUpdatedEventData(AcsRecordingStorageInfoProperties recordingStorageInfo = null, DateTimeOffset recordingStartTime = default, long? recordingDurationMs = null, RecordingContentType recordingContentType = default, RecordingChannelType recordingChannelKind = default, RecordingFormatType recordingFormatType = default, string sessionEndReason = null) + public static AcsRecordingFileStatusUpdatedEventData AcsRecordingFileStatusUpdatedEventData(AcsRecordingStorageInfoProperties recordingStorageInfo = null, DateTimeOffset? recordingStartTime = null, long? recordingDurationMs = null, RecordingContentType? recordingContentType = null, RecordingChannelType? recordingChannelKind = null, RecordingFormatType? recordingFormatType = null, string sessionEndReason = null) { return new AcsRecordingFileStatusUpdatedEventData( recordingStorageInfo, @@ -1253,7 +1253,7 @@ public static AcsRecordingChunkInfoProperties AcsRecordingChunkInfoProperties(st /// Detailed information about the status if any. /// The time at which the email delivery report received timestamp. /// A new instance for mocking. - public static AcsEmailDeliveryReportReceivedEventData AcsEmailDeliveryReportReceivedEventData(string sender = null, string recipient = null, string messageId = null, AcsEmailDeliveryReportStatus status = default, AcsEmailDeliveryReportStatusDetails deliveryStatusDetails = null, DateTimeOffset deliveryAttemptTimestamp = default) + public static AcsEmailDeliveryReportReceivedEventData AcsEmailDeliveryReportReceivedEventData(string sender = null, string recipient = null, string messageId = null, AcsEmailDeliveryReportStatus? status = null, AcsEmailDeliveryReportStatusDetails deliveryStatusDetails = null, DateTimeOffset? deliveryAttemptTimestamp = null) { return new AcsEmailDeliveryReportReceivedEventData( sender, @@ -1282,7 +1282,7 @@ public static AcsEmailDeliveryReportStatusDetails AcsEmailDeliveryReportStatusDe /// The user agent interacting with the email. /// The type of engagement user have with email. /// A new instance for mocking. - public static AcsEmailEngagementTrackingReportReceivedEventData AcsEmailEngagementTrackingReportReceivedEventData(string sender = null, string recipient = null, string messageId = null, DateTimeOffset userActionTimestamp = default, string engagementContext = null, string userAgent = null, AcsUserEngagement engagement = default) + public static AcsEmailEngagementTrackingReportReceivedEventData AcsEmailEngagementTrackingReportReceivedEventData(string sender = null, string recipient = null, string messageId = null, DateTimeOffset? userActionTimestamp = null, string engagementContext = null, string userAgent = null, AcsUserEngagement? engagement = null) { return new AcsEmailEngagementTrackingReportReceivedEventData( sender, @@ -1455,7 +1455,7 @@ public static AcsRouterQueueDetails AcsRouterQueueDetails(string id = null, stri /// Router Job Worker Selector State. /// Router Job Worker Selector Expiration Time. /// A new instance for mocking. - public static AcsRouterWorkerSelector AcsRouterWorkerSelector(string key = null, AcsRouterLabelOperator labelOperator = default, BinaryData labelValue = null, double timeToLive = default, AcsRouterWorkerSelectorState selectorState = default, DateTimeOffset expirationTime = default) + public static AcsRouterWorkerSelector AcsRouterWorkerSelector(string key = null, AcsRouterLabelOperator? labelOperator = null, BinaryData labelValue = null, double timeToLive = default, AcsRouterWorkerSelectorState? selectorState = null, DateTimeOffset? expirationTime = null) { return new AcsRouterWorkerSelector( key, @@ -1618,7 +1618,7 @@ public static AcsRouterJobQueuedEventData AcsRouterJobQueuedEventData(string job /// Router Job Received Scheduled Time in UTC. /// Unavailable For Matching for Router Job Received. /// A new instance for mocking. - public static AcsRouterJobReceivedEventData AcsRouterJobReceivedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null, AcsRouterJobStatus jobStatus = default, string classificationPolicyId = null, int? priority = null, IEnumerable requestedWorkerSelectors = null, DateTimeOffset scheduledOn = default, bool unavailableForMatching = default) + public static AcsRouterJobReceivedEventData AcsRouterJobReceivedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null, AcsRouterJobStatus? jobStatus = null, string classificationPolicyId = null, int? priority = null, IEnumerable requestedWorkerSelectors = null, DateTimeOffset? scheduledOn = null, bool unavailableForMatching = default) { labels ??= new Dictionary(); tags ??= new Dictionary(); @@ -1653,7 +1653,7 @@ public static AcsRouterJobReceivedEventData AcsRouterJobReceivedEventData(string /// Router Job Scheduling Failed Scheduled Time in UTC. /// Router Job Scheduling Failed Reason. /// A new instance for mocking. - public static AcsRouterJobSchedulingFailedEventData AcsRouterJobSchedulingFailedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null, int? priority = null, IEnumerable expiredAttachedWorkerSelectors = null, IEnumerable expiredRequestedWorkerSelectors = null, DateTimeOffset scheduledOn = default, string failureReason = null) + public static AcsRouterJobSchedulingFailedEventData AcsRouterJobSchedulingFailedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null, int? priority = null, IEnumerable expiredAttachedWorkerSelectors = null, IEnumerable expiredRequestedWorkerSelectors = null, DateTimeOffset? scheduledOn = null, string failureReason = null) { labels ??= new Dictionary(); tags ??= new Dictionary(); @@ -1715,7 +1715,7 @@ public static AcsRouterJobUnassignedEventData AcsRouterJobUnassignedEventData(st /// Router Job Waiting For Activation Scheduled Time in UTC. /// Router Job Waiting For Activation Unavailable For Matching. /// A new instance for mocking. - public static AcsRouterJobWaitingForActivationEventData AcsRouterJobWaitingForActivationEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null, int? priority = null, IEnumerable expiredAttachedWorkerSelectors = null, IEnumerable expiredRequestedWorkerSelectors = null, DateTimeOffset scheduledOn = default, bool unavailableForMatching = default) + public static AcsRouterJobWaitingForActivationEventData AcsRouterJobWaitingForActivationEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null, int? priority = null, IEnumerable expiredAttachedWorkerSelectors = null, IEnumerable expiredRequestedWorkerSelectors = null, DateTimeOffset? scheduledOn = null, bool unavailableForMatching = default) { labels ??= new Dictionary(); tags ??= new Dictionary(); @@ -1888,7 +1888,7 @@ public static AcsRouterWorkerOfferExpiredEventData AcsRouterWorkerOfferExpiredEv /// Router Worker Offer Issued Job Labels. /// Router Worker Offer Issued Job Tags. /// A new instance for mocking. - public static AcsRouterWorkerOfferIssuedEventData AcsRouterWorkerOfferIssuedEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null, string queueId = null, string offerId = null, int? jobPriority = null, IReadOnlyDictionary workerLabels = null, DateTimeOffset offeredOn = default, DateTimeOffset expiresOn = default, IReadOnlyDictionary workerTags = null, IReadOnlyDictionary jobLabels = null, IReadOnlyDictionary jobTags = null) + public static AcsRouterWorkerOfferIssuedEventData AcsRouterWorkerOfferIssuedEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null, string queueId = null, string offerId = null, int? jobPriority = null, IReadOnlyDictionary workerLabels = null, DateTimeOffset? offeredOn = null, DateTimeOffset? expiresOn = null, IReadOnlyDictionary workerTags = null, IReadOnlyDictionary jobLabels = null, IReadOnlyDictionary jobTags = null) { workerLabels ??= new Dictionary(); workerTags ??= new Dictionary(); @@ -2001,7 +2001,7 @@ public static AcsRouterWorkerUpdatedEventData AcsRouterWorkerUpdatedEventData(st /// The time message was received. /// The channel event error. /// A new instance for mocking. - public static AcsMessageEventData AcsMessageEventData(string @from = null, string to = null, DateTimeOffset receivedTimestamp = default, AcsMessageChannelEventError error = null) + public static AcsMessageEventData AcsMessageEventData(string @from = null, string to = null, DateTimeOffset? receivedTimestamp = null, AcsMessageChannelEventError error = null) { return new AcsMessageEventData(@from, to, receivedTimestamp, error, serializedAdditionalRawData: null); } @@ -2024,7 +2024,7 @@ public static AcsMessageChannelEventError AcsMessageChannelEventError(string cha /// The updated message status. /// The updated message channel type. /// A new instance for mocking. - public static AcsMessageDeliveryStatusUpdatedEventData AcsMessageDeliveryStatusUpdatedEventData(string @from = null, string to = null, DateTimeOffset receivedTimestamp = default, AcsMessageChannelEventError error = null, string messageId = null, AcsMessageDeliveryStatus status = default, AcsMessageChannelKind channelKind = default) + public static AcsMessageDeliveryStatusUpdatedEventData AcsMessageDeliveryStatusUpdatedEventData(string @from = null, string to = null, DateTimeOffset? receivedTimestamp = null, AcsMessageChannelEventError error = null, string messageId = null, AcsMessageDeliveryStatus? status = null, AcsMessageChannelKind? channelKind = null) { return new AcsMessageDeliveryStatusUpdatedEventData( @from, @@ -2049,7 +2049,7 @@ public static AcsMessageDeliveryStatusUpdatedEventData AcsMessageDeliveryStatusU /// The received message button content. /// The received message interactive content. /// A new instance for mocking. - public static AcsMessageReceivedEventData AcsMessageReceivedEventData(string @from = null, string to = null, DateTimeOffset receivedTimestamp = default, AcsMessageChannelEventError error = null, string content = null, AcsMessageChannelKind channelKind = default, AcsMessageMediaContent mediaContent = null, AcsMessageContext context = null, AcsMessageButtonContent button = null, AcsMessageInteractiveContent interactiveContent = null) + public static AcsMessageReceivedEventData AcsMessageReceivedEventData(string @from = null, string to = null, DateTimeOffset? receivedTimestamp = null, AcsMessageChannelEventError error = null, string content = null, AcsMessageChannelKind channelKind = default, AcsMessageMediaContent mediaContent = null, AcsMessageContext context = null, AcsMessageButtonContent button = null, AcsMessageInteractiveContent interactiveContent = null) { return new AcsMessageReceivedEventData( @from, @@ -2099,7 +2099,7 @@ public static AcsMessageButtonContent AcsMessageButtonContent(string text = null /// The Message Sent when a customer clicks a button. /// The Message Sent when a customer selects an item from a list. /// A new instance for mocking. - public static AcsMessageInteractiveContent AcsMessageInteractiveContent(AcsInteractiveReplyKind replyKind = default, AcsMessageInteractiveButtonReplyContent buttonReply = null, AcsMessageInteractiveListReplyContent listReply = null) + public static AcsMessageInteractiveContent AcsMessageInteractiveContent(AcsInteractiveReplyKind? replyKind = null, AcsMessageInteractiveButtonReplyContent buttonReply = null, AcsMessageInteractiveListReplyContent listReply = null) { return new AcsMessageInteractiveContent(replyKind, buttonReply, listReply, serializedAdditionalRawData: null); } @@ -2134,7 +2134,7 @@ public static AcsMessageInteractiveListReplyContent AcsMessageInteractiveListRep /// The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it. /// The connected registry information if the event is generated by a connected registry. /// A new instance for mocking. - public static ContainerRegistryEventData ContainerRegistryEventData(string id = null, DateTimeOffset timestamp = default, string action = null, string location = null, ContainerRegistryEventTarget target = null, ContainerRegistryEventRequest request = null, ContainerRegistryEventActor actor = null, ContainerRegistryEventSource source = null, ContainerRegistryEventConnectedRegistry connectedRegistry = null) + public static ContainerRegistryEventData ContainerRegistryEventData(string id = null, DateTimeOffset? timestamp = null, string action = null, string location = null, ContainerRegistryEventTarget target = null, ContainerRegistryEventRequest request = null, ContainerRegistryEventActor actor = null, ContainerRegistryEventSource source = null, ContainerRegistryEventConnectedRegistry connectedRegistry = null) { return new ContainerRegistryEventData( id, @@ -2225,7 +2225,7 @@ public static ContainerRegistryEventConnectedRegistry ContainerRegistryEventConn /// The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it. /// The connected registry information if the event is generated by a connected registry. /// A new instance for mocking. - public static ContainerRegistryImagePushedEventData ContainerRegistryImagePushedEventData(string id = null, DateTimeOffset timestamp = default, string action = null, string location = null, ContainerRegistryEventTarget target = null, ContainerRegistryEventRequest request = null, ContainerRegistryEventActor actor = null, ContainerRegistryEventSource source = null, ContainerRegistryEventConnectedRegistry connectedRegistry = null) + public static ContainerRegistryImagePushedEventData ContainerRegistryImagePushedEventData(string id = null, DateTimeOffset? timestamp = null, string action = null, string location = null, ContainerRegistryEventTarget target = null, ContainerRegistryEventRequest request = null, ContainerRegistryEventActor actor = null, ContainerRegistryEventSource source = null, ContainerRegistryEventConnectedRegistry connectedRegistry = null) { return new ContainerRegistryImagePushedEventData( id, @@ -2251,7 +2251,7 @@ public static ContainerRegistryImagePushedEventData ContainerRegistryImagePushed /// The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it. /// The connected registry information if the event is generated by a connected registry. /// A new instance for mocking. - public static ContainerRegistryImageDeletedEventData ContainerRegistryImageDeletedEventData(string id = null, DateTimeOffset timestamp = default, string action = null, string location = null, ContainerRegistryEventTarget target = null, ContainerRegistryEventRequest request = null, ContainerRegistryEventActor actor = null, ContainerRegistryEventSource source = null, ContainerRegistryEventConnectedRegistry connectedRegistry = null) + public static ContainerRegistryImageDeletedEventData ContainerRegistryImageDeletedEventData(string id = null, DateTimeOffset? timestamp = null, string action = null, string location = null, ContainerRegistryEventTarget target = null, ContainerRegistryEventRequest request = null, ContainerRegistryEventActor actor = null, ContainerRegistryEventSource source = null, ContainerRegistryEventConnectedRegistry connectedRegistry = null) { return new ContainerRegistryImageDeletedEventData( id, @@ -2274,7 +2274,7 @@ public static ContainerRegistryImageDeletedEventData ContainerRegistryImageDelet /// The target of the event. /// The connected registry information if the event is generated by a connected registry. /// A new instance for mocking. - public static ContainerRegistryArtifactEventData ContainerRegistryArtifactEventData(string id = null, DateTimeOffset timestamp = default, string action = null, string location = null, ContainerRegistryArtifactEventTarget target = null, ContainerRegistryEventConnectedRegistry connectedRegistry = null) + public static ContainerRegistryArtifactEventData ContainerRegistryArtifactEventData(string id = null, DateTimeOffset? timestamp = null, string action = null, string location = null, ContainerRegistryArtifactEventTarget target = null, ContainerRegistryEventConnectedRegistry connectedRegistry = null) { return new ContainerRegistryArtifactEventData( id, @@ -2316,7 +2316,7 @@ public static ContainerRegistryArtifactEventTarget ContainerRegistryArtifactEven /// The target of the event. /// The connected registry information if the event is generated by a connected registry. /// A new instance for mocking. - public static ContainerRegistryChartPushedEventData ContainerRegistryChartPushedEventData(string id = null, DateTimeOffset timestamp = default, string action = null, string location = null, ContainerRegistryArtifactEventTarget target = null, ContainerRegistryEventConnectedRegistry connectedRegistry = null) + public static ContainerRegistryChartPushedEventData ContainerRegistryChartPushedEventData(string id = null, DateTimeOffset? timestamp = null, string action = null, string location = null, ContainerRegistryArtifactEventTarget target = null, ContainerRegistryEventConnectedRegistry connectedRegistry = null) { return new ContainerRegistryChartPushedEventData( id, @@ -2336,7 +2336,7 @@ public static ContainerRegistryChartPushedEventData ContainerRegistryChartPushed /// The target of the event. /// The connected registry information if the event is generated by a connected registry. /// A new instance for mocking. - public static ContainerRegistryChartDeletedEventData ContainerRegistryChartDeletedEventData(string id = null, DateTimeOffset timestamp = default, string action = null, string location = null, ContainerRegistryArtifactEventTarget target = null, ContainerRegistryEventConnectedRegistry connectedRegistry = null) + public static ContainerRegistryChartDeletedEventData ContainerRegistryChartDeletedEventData(string id = null, DateTimeOffset? timestamp = null, string action = null, string location = null, ContainerRegistryArtifactEventTarget target = null, ContainerRegistryEventConnectedRegistry connectedRegistry = null) { return new ContainerRegistryChartDeletedEventData( id, @@ -2420,7 +2420,7 @@ public static ContainerServiceNodePoolRollingFailedEventData ContainerServiceNod /// Name of the current Stage. /// The time at which the stage happened. /// A new instance for mocking. - public static DataBoxCopyStartedEventData DataBoxCopyStartedEventData(string serialNumber = null, DataBoxStageName stageName = default, DateTimeOffset stageTime = default) + public static DataBoxCopyStartedEventData DataBoxCopyStartedEventData(string serialNumber = null, DataBoxStageName? stageName = null, DateTimeOffset? stageTime = null) { return new DataBoxCopyStartedEventData(serialNumber, stageName, stageTime, serializedAdditionalRawData: null); } @@ -2430,7 +2430,7 @@ public static DataBoxCopyStartedEventData DataBoxCopyStartedEventData(string ser /// Name of the current Stage. /// The time at which the stage happened. /// A new instance for mocking. - public static DataBoxCopyCompletedEventData DataBoxCopyCompletedEventData(string serialNumber = null, DataBoxStageName stageName = default, DateTimeOffset stageTime = default) + public static DataBoxCopyCompletedEventData DataBoxCopyCompletedEventData(string serialNumber = null, DataBoxStageName? stageName = null, DateTimeOffset? stageTime = null) { return new DataBoxCopyCompletedEventData(serialNumber, stageName, stageTime, serializedAdditionalRawData: null); } @@ -2440,7 +2440,7 @@ public static DataBoxCopyCompletedEventData DataBoxCopyCompletedEventData(string /// Name of the current Stage. /// The time at which the stage happened. /// A new instance for mocking. - public static DataBoxOrderCompletedEventData DataBoxOrderCompletedEventData(string serialNumber = null, DataBoxStageName stageName = default, DateTimeOffset stageTime = default) + public static DataBoxOrderCompletedEventData DataBoxOrderCompletedEventData(string serialNumber = null, DataBoxStageName? stageName = null, DateTimeOffset? stageTime = null) { return new DataBoxOrderCompletedEventData(serialNumber, stageName, stageTime, serializedAdditionalRawData: null); } @@ -2456,7 +2456,7 @@ public static DataBoxOrderCompletedEventData DataBoxOrderCompletedEventData(stri /// The first time from the queue. /// The last time from the queue. /// A new instance for mocking. - public static EventHubCaptureFileCreatedEventData EventHubCaptureFileCreatedEventData(string fileurl = null, string fileType = null, string partitionId = null, int? sizeInBytes = null, int? eventCount = null, int? firstSequenceNumber = null, int? lastSequenceNumber = null, DateTimeOffset firstEnqueueTime = default, DateTimeOffset lastEnqueueTime = default) + public static EventHubCaptureFileCreatedEventData EventHubCaptureFileCreatedEventData(string fileurl = null, string fileType = null, string partitionId = null, int? sizeInBytes = null, int? eventCount = null, int? firstSequenceNumber = null, int? lastSequenceNumber = null, DateTimeOffset? firstEnqueueTime = null, DateTimeOffset? lastEnqueueTime = null) { return new EventHubCaptureFileCreatedEventData( fileurl, @@ -2721,7 +2721,7 @@ public static IotHubDeviceTelemetryEventData IotHubDeviceTelemetryEventData(IRea /// Id of HL7 FHIR resource. /// VersionId of HL7 FHIR resource. It changes when the resource is created, updated, or deleted(soft-deletion). /// A new instance for mocking. - public static HealthcareFhirResourceCreatedEventData HealthcareFhirResourceCreatedEventData(HealthcareFhirResourceType fhirResourceType = default, string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = null) + public static HealthcareFhirResourceCreatedEventData HealthcareFhirResourceCreatedEventData(HealthcareFhirResourceType? fhirResourceType = null, string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = null) { return new HealthcareFhirResourceCreatedEventData(fhirResourceType, fhirServiceHostName, fhirResourceId, fhirResourceVersionId, serializedAdditionalRawData: null); } @@ -2732,7 +2732,7 @@ public static HealthcareFhirResourceCreatedEventData HealthcareFhirResourceCreat /// Id of HL7 FHIR resource. /// VersionId of HL7 FHIR resource. It changes when the resource is created, updated, or deleted(soft-deletion). /// A new instance for mocking. - public static HealthcareFhirResourceUpdatedEventData HealthcareFhirResourceUpdatedEventData(HealthcareFhirResourceType fhirResourceType = default, string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = null) + public static HealthcareFhirResourceUpdatedEventData HealthcareFhirResourceUpdatedEventData(HealthcareFhirResourceType? fhirResourceType = null, string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = null) { return new HealthcareFhirResourceUpdatedEventData(fhirResourceType, fhirServiceHostName, fhirResourceId, fhirResourceVersionId, serializedAdditionalRawData: null); } @@ -2743,7 +2743,7 @@ public static HealthcareFhirResourceUpdatedEventData HealthcareFhirResourceUpdat /// Id of HL7 FHIR resource. /// VersionId of HL7 FHIR resource. It changes when the resource is created, updated, or deleted(soft-deletion). /// A new instance for mocking. - public static HealthcareFhirResourceDeletedEventData HealthcareFhirResourceDeletedEventData(HealthcareFhirResourceType fhirResourceType = default, string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = null) + public static HealthcareFhirResourceDeletedEventData HealthcareFhirResourceDeletedEventData(HealthcareFhirResourceType? fhirResourceType = null, string fhirServiceHostName = null, string fhirResourceId = null, long? fhirResourceVersionId = null) { return new HealthcareFhirResourceDeletedEventData(fhirResourceType, fhirServiceHostName, fhirResourceId, fhirResourceVersionId, serializedAdditionalRawData: null); } @@ -3096,7 +3096,7 @@ public static MachineLearningServicesRunCompletedEventData MachineLearningServic /// The start time of the target dataset time series that resulted in drift detection. /// The end time of the target dataset time series that resulted in drift detection. /// A new instance for mocking. - public static MachineLearningServicesDatasetDriftDetectedEventData MachineLearningServicesDatasetDriftDetectedEventData(string dataDriftId = null, string dataDriftName = null, string runId = null, string baseDatasetId = null, string targetDatasetId = null, double? driftCoefficient = null, DateTimeOffset startTime = default, DateTimeOffset endTime = default) + public static MachineLearningServicesDatasetDriftDetectedEventData MachineLearningServicesDatasetDriftDetectedEventData(string dataDriftId = null, string dataDriftName = null, string runId = null, string baseDatasetId = null, string targetDatasetId = null, double? driftCoefficient = null, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null) { return new MachineLearningServicesDatasetDriftDetectedEventData( dataDriftId, @@ -3140,7 +3140,7 @@ public static MachineLearningServicesRunStatusChangedEventData MachineLearningSe /// The new state of the Job. /// Gets the Job correlation data. /// A new instance for mocking. - public static MediaJobStateChangeEventData MediaJobStateChangeEventData(MediaJobState previousState = default, MediaJobState state = default, IReadOnlyDictionary correlationData = null) + public static MediaJobStateChangeEventData MediaJobStateChangeEventData(MediaJobState? previousState = null, MediaJobState? state = null, IReadOnlyDictionary correlationData = null) { correlationData ??= new Dictionary(); @@ -3154,7 +3154,7 @@ public static MediaJobStateChangeEventData MediaJobStateChangeEventData(MediaJob /// Indicates that it may be possible to retry the Job. If retry is unsuccessful, please contact Azure support via Azure Portal. /// An array of details about specific errors that led to this reported error. /// A new instance for mocking. - public static MediaJobError MediaJobError(MediaJobErrorCode code = default, string message = null, MediaJobErrorCategory category = default, MediaJobRetry retry = default, IEnumerable details = null) + public static MediaJobError MediaJobError(MediaJobErrorCode? code = null, string message = null, MediaJobErrorCategory? category = null, MediaJobRetry? retry = null, IEnumerable details = null) { details ??= new List(); @@ -3183,7 +3183,7 @@ public static MediaJobErrorDetail MediaJobErrorDetail(string code = null, string /// Gets the Job output progress. /// Gets the Job output state. /// A new instance for mocking. - public static MediaJobOutput MediaJobOutput(string odataType = null, MediaJobError error = null, string label = null, long progress = default, MediaJobState state = default) + public static MediaJobOutput MediaJobOutput(string odataType = null, MediaJobError error = null, string label = null, long progress = default, MediaJobState? state = null) { return new UnknownMediaJobOutput( odataType, @@ -3201,7 +3201,7 @@ public static MediaJobOutput MediaJobOutput(string odataType = null, MediaJobErr /// Gets the Job output state. /// Gets the Job output asset name. /// A new instance for mocking. - public static MediaJobOutputAsset MediaJobOutputAsset(MediaJobError error = null, string label = null, long progress = default, MediaJobState state = default, string assetName = null) + public static MediaJobOutputAsset MediaJobOutputAsset(MediaJobError error = null, string label = null, long progress = default, MediaJobState? state = null, string assetName = null) { return new MediaJobOutputAsset( "#Microsoft.Media.JobOutputAsset", @@ -3234,7 +3234,7 @@ public static MediaJobOutputProgressEventData MediaJobOutputProgressEventData(st /// /// Gets the Job correlation data. /// A new instance for mocking. - public static MediaJobOutputStateChangeEventData MediaJobOutputStateChangeEventData(MediaJobState previousState = default, MediaJobOutput output = null, IReadOnlyDictionary jobCorrelationData = null) + public static MediaJobOutputStateChangeEventData MediaJobOutputStateChangeEventData(MediaJobState? previousState = null, MediaJobOutput output = null, IReadOnlyDictionary jobCorrelationData = null) { jobCorrelationData ??= new Dictionary(); @@ -3246,7 +3246,7 @@ public static MediaJobOutputStateChangeEventData MediaJobOutputStateChangeEventD /// The new state of the Job. /// Gets the Job correlation data. /// A new instance for mocking. - public static MediaJobScheduledEventData MediaJobScheduledEventData(MediaJobState previousState = default, MediaJobState state = default, IReadOnlyDictionary correlationData = null) + public static MediaJobScheduledEventData MediaJobScheduledEventData(MediaJobState? previousState = null, MediaJobState? state = null, IReadOnlyDictionary correlationData = null) { correlationData ??= new Dictionary(); @@ -3258,7 +3258,7 @@ public static MediaJobScheduledEventData MediaJobScheduledEventData(MediaJobStat /// The new state of the Job. /// Gets the Job correlation data. /// A new instance for mocking. - public static MediaJobProcessingEventData MediaJobProcessingEventData(MediaJobState previousState = default, MediaJobState state = default, IReadOnlyDictionary correlationData = null) + public static MediaJobProcessingEventData MediaJobProcessingEventData(MediaJobState? previousState = null, MediaJobState? state = null, IReadOnlyDictionary correlationData = null) { correlationData ??= new Dictionary(); @@ -3270,7 +3270,7 @@ public static MediaJobProcessingEventData MediaJobProcessingEventData(MediaJobSt /// The new state of the Job. /// Gets the Job correlation data. /// A new instance for mocking. - public static MediaJobCancelingEventData MediaJobCancelingEventData(MediaJobState previousState = default, MediaJobState state = default, IReadOnlyDictionary correlationData = null) + public static MediaJobCancelingEventData MediaJobCancelingEventData(MediaJobState? previousState = null, MediaJobState? state = null, IReadOnlyDictionary correlationData = null) { correlationData ??= new Dictionary(); @@ -3287,7 +3287,7 @@ public static MediaJobCancelingEventData MediaJobCancelingEventData(MediaJobStat /// The available derived classes include . /// /// A new instance for mocking. - public static MediaJobFinishedEventData MediaJobFinishedEventData(MediaJobState previousState = default, MediaJobState state = default, IReadOnlyDictionary correlationData = null, IEnumerable outputs = null) + public static MediaJobFinishedEventData MediaJobFinishedEventData(MediaJobState? previousState = null, MediaJobState? state = null, IReadOnlyDictionary correlationData = null, IEnumerable outputs = null) { correlationData ??= new Dictionary(); outputs ??= new List(); @@ -3305,7 +3305,7 @@ public static MediaJobFinishedEventData MediaJobFinishedEventData(MediaJobState /// The available derived classes include . /// /// A new instance for mocking. - public static MediaJobCanceledEventData MediaJobCanceledEventData(MediaJobState previousState = default, MediaJobState state = default, IReadOnlyDictionary correlationData = null, IEnumerable outputs = null) + public static MediaJobCanceledEventData MediaJobCanceledEventData(MediaJobState? previousState = null, MediaJobState? state = null, IReadOnlyDictionary correlationData = null, IEnumerable outputs = null) { correlationData ??= new Dictionary(); outputs ??= new List(); @@ -3323,7 +3323,7 @@ public static MediaJobCanceledEventData MediaJobCanceledEventData(MediaJobState /// The available derived classes include . /// /// A new instance for mocking. - public static MediaJobErroredEventData MediaJobErroredEventData(MediaJobState previousState = default, MediaJobState state = default, IReadOnlyDictionary correlationData = null, IEnumerable outputs = null) + public static MediaJobErroredEventData MediaJobErroredEventData(MediaJobState? previousState = null, MediaJobState? state = null, IReadOnlyDictionary correlationData = null, IEnumerable outputs = null) { correlationData ??= new Dictionary(); outputs ??= new List(); @@ -3340,7 +3340,7 @@ public static MediaJobErroredEventData MediaJobErroredEventData(MediaJobState pr /// /// Gets the Job correlation data. /// A new instance for mocking. - public static MediaJobOutputCanceledEventData MediaJobOutputCanceledEventData(MediaJobState previousState = default, MediaJobOutput output = null, IReadOnlyDictionary jobCorrelationData = null) + public static MediaJobOutputCanceledEventData MediaJobOutputCanceledEventData(MediaJobState? previousState = null, MediaJobOutput output = null, IReadOnlyDictionary jobCorrelationData = null) { jobCorrelationData ??= new Dictionary(); @@ -3356,7 +3356,7 @@ public static MediaJobOutputCanceledEventData MediaJobOutputCanceledEventData(Me /// /// Gets the Job correlation data. /// A new instance for mocking. - public static MediaJobOutputCancelingEventData MediaJobOutputCancelingEventData(MediaJobState previousState = default, MediaJobOutput output = null, IReadOnlyDictionary jobCorrelationData = null) + public static MediaJobOutputCancelingEventData MediaJobOutputCancelingEventData(MediaJobState? previousState = null, MediaJobOutput output = null, IReadOnlyDictionary jobCorrelationData = null) { jobCorrelationData ??= new Dictionary(); @@ -3372,7 +3372,7 @@ public static MediaJobOutputCancelingEventData MediaJobOutputCancelingEventData( /// /// Gets the Job correlation data. /// A new instance for mocking. - public static MediaJobOutputErroredEventData MediaJobOutputErroredEventData(MediaJobState previousState = default, MediaJobOutput output = null, IReadOnlyDictionary jobCorrelationData = null) + public static MediaJobOutputErroredEventData MediaJobOutputErroredEventData(MediaJobState? previousState = null, MediaJobOutput output = null, IReadOnlyDictionary jobCorrelationData = null) { jobCorrelationData ??= new Dictionary(); @@ -3388,7 +3388,7 @@ public static MediaJobOutputErroredEventData MediaJobOutputErroredEventData(Medi /// /// Gets the Job correlation data. /// A new instance for mocking. - public static MediaJobOutputFinishedEventData MediaJobOutputFinishedEventData(MediaJobState previousState = default, MediaJobOutput output = null, IReadOnlyDictionary jobCorrelationData = null) + public static MediaJobOutputFinishedEventData MediaJobOutputFinishedEventData(MediaJobState? previousState = null, MediaJobOutput output = null, IReadOnlyDictionary jobCorrelationData = null) { jobCorrelationData ??= new Dictionary(); @@ -3404,7 +3404,7 @@ public static MediaJobOutputFinishedEventData MediaJobOutputFinishedEventData(Me /// /// Gets the Job correlation data. /// A new instance for mocking. - public static MediaJobOutputProcessingEventData MediaJobOutputProcessingEventData(MediaJobState previousState = default, MediaJobOutput output = null, IReadOnlyDictionary jobCorrelationData = null) + public static MediaJobOutputProcessingEventData MediaJobOutputProcessingEventData(MediaJobState? previousState = null, MediaJobOutput output = null, IReadOnlyDictionary jobCorrelationData = null) { jobCorrelationData ??= new Dictionary(); @@ -3420,7 +3420,7 @@ public static MediaJobOutputProcessingEventData MediaJobOutputProcessingEventDat /// /// Gets the Job correlation data. /// A new instance for mocking. - public static MediaJobOutputScheduledEventData MediaJobOutputScheduledEventData(MediaJobState previousState = default, MediaJobOutput output = null, IReadOnlyDictionary jobCorrelationData = null) + public static MediaJobOutputScheduledEventData MediaJobOutputScheduledEventData(MediaJobState? previousState = null, MediaJobOutput output = null, IReadOnlyDictionary jobCorrelationData = null) { jobCorrelationData ??= new Dictionary(); @@ -3638,7 +3638,7 @@ public static MediaLiveEventChannelArchiveHeartbeatEventData MediaLiveEventChann /// The subscription ID of the resource. /// The compliance reason code. May be empty. /// A new instance for mocking. - public static PolicyInsightsPolicyStateCreatedEventData PolicyInsightsPolicyStateCreatedEventData(DateTimeOffset timestamp = default, string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) + public static PolicyInsightsPolicyStateCreatedEventData PolicyInsightsPolicyStateCreatedEventData(DateTimeOffset? timestamp = null, string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) { return new PolicyInsightsPolicyStateCreatedEventData( timestamp, @@ -3660,7 +3660,7 @@ public static PolicyInsightsPolicyStateCreatedEventData PolicyInsightsPolicyStat /// The subscription ID of the resource. /// The compliance reason code. May be empty. /// A new instance for mocking. - public static PolicyInsightsPolicyStateChangedEventData PolicyInsightsPolicyStateChangedEventData(DateTimeOffset timestamp = default, string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) + public static PolicyInsightsPolicyStateChangedEventData PolicyInsightsPolicyStateChangedEventData(DateTimeOffset? timestamp = null, string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) { return new PolicyInsightsPolicyStateChangedEventData( timestamp, @@ -3682,7 +3682,7 @@ public static PolicyInsightsPolicyStateChangedEventData PolicyInsightsPolicyStat /// The subscription ID of the resource. /// The compliance reason code. May be empty. /// A new instance for mocking. - public static PolicyInsightsPolicyStateDeletedEventData PolicyInsightsPolicyStateDeletedEventData(DateTimeOffset timestamp = default, string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) + public static PolicyInsightsPolicyStateDeletedEventData PolicyInsightsPolicyStateDeletedEventData(DateTimeOffset? timestamp = null, string policyAssignmentId = null, string policyDefinitionId = null, string policyDefinitionReferenceId = null, string complianceState = null, string subscriptionId = null, string complianceReasonCode = null) { return new PolicyInsightsPolicyStateDeletedEventData( timestamp, @@ -3700,7 +3700,7 @@ public static PolicyInsightsPolicyStateDeletedEventData PolicyInsightsPolicyStat /// The name of this event. /// The status of this event. Failed or succeeded. /// A new instance for mocking. - public static RedisPatchingCompletedEventData RedisPatchingCompletedEventData(DateTimeOffset timestamp = default, string name = null, string status = null) + public static RedisPatchingCompletedEventData RedisPatchingCompletedEventData(DateTimeOffset? timestamp = null, string name = null, string status = null) { return new RedisPatchingCompletedEventData(timestamp, name, status, serializedAdditionalRawData: null); } @@ -3710,29 +3710,29 @@ public static RedisPatchingCompletedEventData RedisPatchingCompletedEventData(Da /// The name of this event. /// The status of this event. Failed or succeeded. /// A new instance for mocking. - public static RedisScalingCompletedEventData RedisScalingCompletedEventData(DateTimeOffset timestamp = default, string name = null, string status = null) + public static RedisScalingCompletedEventData RedisScalingCompletedEventData(DateTimeOffset? timestamp = null, string name = null, string status = null) { return new RedisScalingCompletedEventData(timestamp, name, status, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The time at which the event occurred. /// The name of this event. /// The status of this event. Failed or succeeded. - /// A new instance for mocking. - public static RedisExportRDBCompletedEventData RedisExportRDBCompletedEventData(DateTimeOffset timestamp = default, string name = null, string status = null) + /// A new instance for mocking. + public static RedisExportRdbCompletedEventData RedisExportRdbCompletedEventData(DateTimeOffset? timestamp = null, string name = null, string status = null) { - return new RedisExportRDBCompletedEventData(timestamp, name, status, serializedAdditionalRawData: null); + return new RedisExportRdbCompletedEventData(timestamp, name, status, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The time at which the event occurred. /// The name of this event. /// The status of this event. Failed or succeeded. - /// A new instance for mocking. - public static RedisImportRDBCompletedEventData RedisImportRDBCompletedEventData(DateTimeOffset timestamp = default, string name = null, string status = null) + /// A new instance for mocking. + public static RedisImportRdbCompletedEventData RedisImportRdbCompletedEventData(DateTimeOffset? timestamp = null, string name = null, string status = null) { - return new RedisImportRDBCompletedEventData(timestamp, name, status, serializedAdditionalRawData: null); + return new RedisImportRdbCompletedEventData(timestamp, name, status, serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -4132,7 +4132,7 @@ public static ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventDat /// The connection Id of connected client connection. /// The user Id of connected client connection. /// A new instance for mocking. - public static SignalRServiceClientConnectionConnectedEventData SignalRServiceClientConnectionConnectedEventData(DateTimeOffset timestamp = default, string hubName = null, string connectionId = null, string userId = null) + public static SignalRServiceClientConnectionConnectedEventData SignalRServiceClientConnectionConnectedEventData(DateTimeOffset? timestamp = null, string hubName = null, string connectionId = null, string userId = null) { return new SignalRServiceClientConnectionConnectedEventData(timestamp, hubName, connectionId, userId, serializedAdditionalRawData: null); } @@ -4144,7 +4144,7 @@ public static SignalRServiceClientConnectionConnectedEventData SignalRServiceCli /// The user Id of connected client connection. /// The message of error that cause the client connection disconnected. /// A new instance for mocking. - public static SignalRServiceClientConnectionDisconnectedEventData SignalRServiceClientConnectionDisconnectedEventData(DateTimeOffset timestamp = default, string hubName = null, string connectionId = null, string userId = null, string errorMessage = null) + public static SignalRServiceClientConnectionDisconnectedEventData SignalRServiceClientConnectionDisconnectedEventData(DateTimeOffset? timestamp = null, string hubName = null, string connectionId = null, string userId = null, string errorMessage = null) { return new SignalRServiceClientConnectionDisconnectedEventData( timestamp, @@ -4164,12 +4164,13 @@ public static SignalRServiceClientConnectionDisconnectedEventData SignalRService /// The size of the blob in bytes. This is the same as what would be returned in the Content-Length header from the blob. /// The offset of the blob in bytes. /// The type of blob. + /// The current tier of the blob. /// The path to the blob. /// An opaque string value representing the logical sequence of events for any particular blob name. Users can use standard string comparison to understand the relative sequence of two events on the same blob name. /// The identity of the requester that triggered this event. /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. /// A new instance for mocking. - public static StorageBlobCreatedEventData StorageBlobCreatedEventData(string api = null, string clientRequestId = null, string requestId = null, string eTag = null, string contentType = null, long? contentLength = null, long? contentOffset = null, string blobType = null, string url = null, string sequencer = null, string identity = null, IReadOnlyDictionary storageDiagnostics = null) + public static StorageBlobCreatedEventData StorageBlobCreatedEventData(string api = null, string clientRequestId = null, string requestId = null, string eTag = null, string contentType = null, long? contentLength = null, long? contentOffset = null, string blobType = null, StorageBlobAccessTier accessTier = default, string url = null, string sequencer = null, string identity = null, IReadOnlyDictionary storageDiagnostics = null) { storageDiagnostics ??= new Dictionary(); @@ -4182,6 +4183,7 @@ public static StorageBlobCreatedEventData StorageBlobCreatedEventData(string api contentLength, contentOffset, blobType, + accessTier, url, sequencer, identity, @@ -4349,12 +4351,14 @@ public static StorageLifecyclePolicyActionSummaryDetail StorageLifecyclePolicyAc /// The content type of the blob. This is the same as what would be returned in the Content-Type header from the blob. /// The size of the blob in bytes. This is the same as what would be returned in the Content-Length header from the blob. /// The type of blob. + /// The current tier of the blob. + /// The previous tier of the blob. /// The path to the blob. /// An opaque string value representing the logical sequence of events for any particular blob name. Users can use standard string comparison to understand the relative sequence of two events on the same blob name. /// The identity of the requester that triggered this event. /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. /// A new instance for mocking. - public static StorageBlobTierChangedEventData StorageBlobTierChangedEventData(string api = null, string clientRequestId = null, string requestId = null, string contentType = null, long? contentLength = null, string blobType = null, string url = null, string sequencer = null, string identity = null, IReadOnlyDictionary storageDiagnostics = null) + public static StorageBlobTierChangedEventData StorageBlobTierChangedEventData(string api = null, string clientRequestId = null, string requestId = null, string contentType = null, long? contentLength = null, string blobType = null, StorageBlobAccessTier accessTier = default, StorageBlobAccessTier previousTier = default, string url = null, string sequencer = null, string identity = null, IReadOnlyDictionary storageDiagnostics = null) { storageDiagnostics ??= new Dictionary(); @@ -4365,6 +4369,8 @@ public static StorageBlobTierChangedEventData StorageBlobTierChangedEventData(st contentType, contentLength, blobType, + accessTier, + previousTier, url, sequencer, identity, @@ -4411,7 +4417,7 @@ public static StorageAsyncOperationInitiatedEventData StorageAsyncOperationIniti /// The policy run id for inventory run. /// The blob URL for manifest file for inventory run. /// A new instance for mocking. - public static StorageBlobInventoryPolicyCompletedEventData StorageBlobInventoryPolicyCompletedEventData(DateTimeOffset scheduleDateTime = default, string accountName = null, string ruleName = null, string policyRunStatus = null, string policyRunStatusMessage = null, string policyRunId = null, string manifestBlobUrl = null) + public static StorageBlobInventoryPolicyCompletedEventData StorageBlobInventoryPolicyCompletedEventData(DateTimeOffset? scheduleDateTime = null, string accountName = null, string ruleName = null, string policyRunStatus = null, string policyRunStatusMessage = null, string policyRunId = null, string manifestBlobUrl = null) { return new StorageBlobInventoryPolicyCompletedEventData( scheduleDateTime, @@ -4431,7 +4437,7 @@ public static StorageBlobInventoryPolicyCompletedEventData StorageBlobInventoryP /// The task name for a storage task. /// The summary report blob url for a storage task. /// A new instance for mocking. - public static StorageTaskCompletedEventData StorageTaskCompletedEventData(StorageTaskCompletedStatus status = default, DateTimeOffset completedDateTime = default, string taskExecutionId = null, string taskName = null, Uri summaryReportBlobUrl = null) + public static StorageTaskCompletedEventData StorageTaskCompletedEventData(StorageTaskCompletedStatus? status = null, DateTimeOffset? completedDateTime = null, string taskExecutionId = null, string taskName = null, Uri summaryReportBlobUrl = null) { return new StorageTaskCompletedEventData( status, @@ -4446,7 +4452,7 @@ public static StorageTaskCompletedEventData StorageTaskCompletedEventData(Storag /// The time at which a storage task was queued. /// The execution id for a storage task. /// A new instance for mocking. - public static StorageTaskQueuedEventData StorageTaskQueuedEventData(DateTimeOffset queuedDateTime = default, string taskExecutionId = null) + public static StorageTaskQueuedEventData StorageTaskQueuedEventData(DateTimeOffset? queuedDateTime = null, string taskExecutionId = null) { return new StorageTaskQueuedEventData(queuedDateTime, taskExecutionId, serializedAdditionalRawData: null); } @@ -4455,7 +4461,7 @@ public static StorageTaskQueuedEventData StorageTaskQueuedEventData(DateTimeOffs /// The time at which a storage task was queued. /// The execution id for a storage task. /// A new instance for mocking. - public static StorageTaskAssignmentQueuedEventData StorageTaskAssignmentQueuedEventData(DateTimeOffset queuedOn = default, string taskExecutionId = null) + public static StorageTaskAssignmentQueuedEventData StorageTaskAssignmentQueuedEventData(DateTimeOffset? queuedOn = null, string taskExecutionId = null) { return new StorageTaskAssignmentQueuedEventData(queuedOn, taskExecutionId, serializedAdditionalRawData: null); } @@ -4467,7 +4473,7 @@ public static StorageTaskAssignmentQueuedEventData StorageTaskAssignmentQueuedEv /// The task name for a storage task. /// The summary report blob url for a storage task. /// A new instance for mocking. - public static StorageTaskAssignmentCompletedEventData StorageTaskAssignmentCompletedEventData(StorageTaskAssignmentCompletedStatus status = default, DateTimeOffset completedOn = default, string taskExecutionId = null, string taskName = null, Uri summaryReportBlobUri = null) + public static StorageTaskAssignmentCompletedEventData StorageTaskAssignmentCompletedEventData(StorageTaskAssignmentCompletedStatus? status = null, DateTimeOffset? completedOn = null, string taskExecutionId = null, string taskName = null, Uri summaryReportBlobUri = null) { return new StorageTaskAssignmentCompletedEventData( status, @@ -4481,7 +4487,7 @@ public static StorageTaskAssignmentCompletedEventData StorageTaskAssignmentCompl /// Initializes a new instance of . /// Type of action of the operation. /// A new instance for mocking. - public static AppEventTypeDetail AppEventTypeDetail(AppAction action = default) + public static AppEventTypeDetail AppEventTypeDetail(AppAction? action = null) { return new AppEventTypeDetail(action, serializedAdditionalRawData: null); } @@ -4779,7 +4785,7 @@ public static WebAppServicePlanUpdatedEventData WebAppServicePlanUpdatedEventDat /// Type of action on the app service plan. /// Asynchronous operation status of the operation on the app service plan. /// A new instance for mocking. - public static AppServicePlanEventTypeDetail AppServicePlanEventTypeDetail(StampKind stampKind = default, AppServicePlanAction action = default, AsyncStatus status = default) + public static AppServicePlanEventTypeDetail AppServicePlanEventTypeDetail(StampKind? stampKind = null, AppServicePlanAction? action = null, AsyncStatus? status = null) { return new AppServicePlanEventTypeDetail(stampKind, action, status, serializedAdditionalRawData: null); } @@ -4835,7 +4841,7 @@ public static SubscriptionDeletedEventData SubscriptionDeletedEventData(string e return new SubscriptionDeletedEventData(eventSubscriptionId, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// /// Unique identifier for the MQTT client that the client presents to the service /// for authentication. This case-sensitive string can be up to 128 characters @@ -4843,13 +4849,13 @@ public static SubscriptionDeletedEventData SubscriptionDeletedEventData(string e /// /// Name of the client resource in the Event Grid namespace. /// Name of the Event Grid namespace where the MQTT client was created or updated. - /// A new instance for mocking. - public static EventGridMQTTClientEventData EventGridMQTTClientEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null) + /// A new instance for mocking. + public static EventGridMqttClientEventData EventGridMqttClientEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null) { - return new EventGridMQTTClientEventData(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData: null); + return new EventGridMqttClientEventData(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// /// Unique identifier for the MQTT client that the client presents to the service /// for authentication. This case-sensitive string can be up to 128 characters @@ -4865,12 +4871,12 @@ public static EventGridMQTTClientEventData EventGridMQTTClientEventData(string c /// the 'createdOn' property. /// /// The key-value attributes that are assigned to the client resource. - /// A new instance for mocking. - public static EventGridMQTTClientCreatedOrUpdatedEventData EventGridMQTTClientCreatedOrUpdatedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, EventGridMQTTClientState state = default, DateTimeOffset createdOn = default, DateTimeOffset updatedOn = default, IReadOnlyDictionary attributes = null) + /// A new instance for mocking. + public static EventGridMqttClientCreatedOrUpdatedEventData EventGridMqttClientCreatedOrUpdatedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, EventGridMqttClientState? state = null, DateTimeOffset? createdOn = null, DateTimeOffset? updatedOn = null, IReadOnlyDictionary attributes = null) { attributes ??= new Dictionary(); - return new EventGridMQTTClientCreatedOrUpdatedEventData( + return new EventGridMqttClientCreatedOrUpdatedEventData( clientAuthenticationName, clientName, namespaceName, @@ -4881,7 +4887,7 @@ public static EventGridMQTTClientCreatedOrUpdatedEventData EventGridMQTTClientCr attributes); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// /// Unique identifier for the MQTT client that the client presents to the service /// for authentication. This case-sensitive string can be up to 128 characters @@ -4889,13 +4895,13 @@ public static EventGridMQTTClientCreatedOrUpdatedEventData EventGridMQTTClientCr /// /// Name of the client resource in the Event Grid namespace. /// Name of the Event Grid namespace where the MQTT client was created or updated. - /// A new instance for mocking. - public static EventGridMQTTClientDeletedEventData EventGridMQTTClientDeletedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null) + /// A new instance for mocking. + public static EventGridMqttClientDeletedEventData EventGridMqttClientDeletedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null) { - return new EventGridMQTTClientDeletedEventData(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData: null); + return new EventGridMqttClientDeletedEventData(clientAuthenticationName, clientName, namespaceName, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// /// Unique identifier for the MQTT client that the client presents to the service /// for authentication. This case-sensitive string can be up to 128 characters @@ -4912,10 +4918,10 @@ public static EventGridMQTTClientDeletedEventData EventGridMQTTClientDeletedEven /// disconnected events. Latest event will have a sequence number that is higher /// than the previous event. /// - /// A new instance for mocking. - public static EventGridMQTTClientSessionConnectedEventData EventGridMQTTClientSessionConnectedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, string clientSessionName = null, long? sequenceNumber = null) + /// A new instance for mocking. + public static EventGridMqttClientSessionConnectedEventData EventGridMqttClientSessionConnectedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, string clientSessionName = null, long? sequenceNumber = null) { - return new EventGridMQTTClientSessionConnectedEventData( + return new EventGridMqttClientSessionConnectedEventData( clientAuthenticationName, clientName, namespaceName, @@ -4924,7 +4930,7 @@ public static EventGridMQTTClientSessionConnectedEventData EventGridMQTTClientSe sequenceNumber); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// /// Unique identifier for the MQTT client that the client presents to the service /// for authentication. This case-sensitive string can be up to 128 characters @@ -4945,10 +4951,10 @@ public static EventGridMQTTClientSessionConnectedEventData EventGridMQTTClientSe /// Reason for the disconnection of the MQTT client's session. The value could be /// one of the values in the disconnection reasons table. /// - /// A new instance for mocking. - public static EventGridMQTTClientSessionDisconnectedEventData EventGridMQTTClientSessionDisconnectedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, string clientSessionName = null, long? sequenceNumber = null, EventGridMQTTClientDisconnectionReason disconnectionReason = default) + /// A new instance for mocking. + public static EventGridMqttClientSessionDisconnectedEventData EventGridMqttClientSessionDisconnectedEventData(string clientAuthenticationName = null, string clientName = null, string namespaceName = null, string clientSessionName = null, long? sequenceNumber = null, EventGridMqttClientDisconnectionReason? disconnectionReason = null) { - return new EventGridMQTTClientSessionDisconnectedEventData( + return new EventGridMqttClientSessionDisconnectedEventData( clientAuthenticationName, clientName, namespaceName, @@ -4994,7 +5000,7 @@ public static ResourceNotificationsResourceUpdatedDetails ResourceNotificationsR /// Initializes a new instance of . /// Date and Time when resource was updated. /// A new instance for mocking. - public static ResourceNotificationsOperationalDetails ResourceNotificationsOperationalDetails(DateTimeOffset resourceEventTime = default) + public static ResourceNotificationsOperationalDetails ResourceNotificationsOperationalDetails(DateTimeOffset? resourceEventTime = null) { return new ResourceNotificationsOperationalDetails(resourceEventTime, serializedAdditionalRawData: null); } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventHubCaptureFileCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventHubCaptureFileCreatedEventData.Serialization.cs index 5138f5db152d..badf70077248 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventHubCaptureFileCreatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventHubCaptureFileCreatedEventData.Serialization.cs @@ -61,10 +61,16 @@ void IJsonModel.Write(Utf8JsonWriter writer writer.WritePropertyName("lastSequenceNumber"u8); writer.WriteNumberValue(LastSequenceNumber.Value); } - writer.WritePropertyName("firstEnqueueTime"u8); - writer.WriteStringValue(FirstEnqueueTime, "O"); - writer.WritePropertyName("lastEnqueueTime"u8); - writer.WriteStringValue(LastEnqueueTime, "O"); + if (Optional.IsDefined(FirstEnqueueTime)) + { + writer.WritePropertyName("firstEnqueueTime"u8); + writer.WriteStringValue(FirstEnqueueTime.Value, "O"); + } + if (Optional.IsDefined(LastEnqueueTime)) + { + writer.WritePropertyName("lastEnqueueTime"u8); + writer.WriteStringValue(LastEnqueueTime.Value, "O"); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -110,8 +116,8 @@ internal static EventHubCaptureFileCreatedEventData DeserializeEventHubCaptureFi int? eventCount = default; int? firstSequenceNumber = default; int? lastSequenceNumber = default; - DateTimeOffset firstEnqueueTime = default; - DateTimeOffset lastEnqueueTime = default; + DateTimeOffset? firstEnqueueTime = default; + DateTimeOffset? lastEnqueueTime = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -169,11 +175,19 @@ internal static EventHubCaptureFileCreatedEventData DeserializeEventHubCaptureFi } if (property.NameEquals("firstEnqueueTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } firstEnqueueTime = property.Value.GetDateTimeOffset("O"); continue; } if (property.NameEquals("lastEnqueueTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } lastEnqueueTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventHubCaptureFileCreatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventHubCaptureFileCreatedEventData.cs index 0c670ab7b195..ff8f7f2a0e35 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventHubCaptureFileCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventHubCaptureFileCreatedEventData.cs @@ -46,12 +46,8 @@ public partial class EventHubCaptureFileCreatedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The first time from the queue. - /// The last time from the queue. - internal EventHubCaptureFileCreatedEventData(DateTimeOffset firstEnqueueTime, DateTimeOffset lastEnqueueTime) + internal EventHubCaptureFileCreatedEventData() { - FirstEnqueueTime = firstEnqueueTime; - LastEnqueueTime = lastEnqueueTime; } /// Initializes a new instance of . @@ -65,7 +61,7 @@ internal EventHubCaptureFileCreatedEventData(DateTimeOffset firstEnqueueTime, Da /// The first time from the queue. /// The last time from the queue. /// Keeps track of any properties unknown to the library. - internal EventHubCaptureFileCreatedEventData(string fileurl, string fileType, string partitionId, int? sizeInBytes, int? eventCount, int? firstSequenceNumber, int? lastSequenceNumber, DateTimeOffset firstEnqueueTime, DateTimeOffset lastEnqueueTime, IDictionary serializedAdditionalRawData) + internal EventHubCaptureFileCreatedEventData(string fileurl, string fileType, string partitionId, int? sizeInBytes, int? eventCount, int? firstSequenceNumber, int? lastSequenceNumber, DateTimeOffset? firstEnqueueTime, DateTimeOffset? lastEnqueueTime, IDictionary serializedAdditionalRawData) { Fileurl = fileurl; FileType = fileType; @@ -79,11 +75,6 @@ internal EventHubCaptureFileCreatedEventData(string fileurl, string fileType, st _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal EventHubCaptureFileCreatedEventData() - { - } - /// The path to the capture file. public string Fileurl { get; } /// The file type of the capture file. @@ -99,8 +90,8 @@ internal EventHubCaptureFileCreatedEventData() /// The last sequence number from the queue. public int? LastSequenceNumber { get; } /// The first time from the queue. - public DateTimeOffset FirstEnqueueTime { get; } + public DateTimeOffset? FirstEnqueueTime { get; } /// The last time from the queue. - public DateTimeOffset LastEnqueueTime { get; } + public DateTimeOffset? LastEnqueueTime { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceCreatedEventData.Serialization.cs index a259170c9a1b..933ef2a240b5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceCreatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceCreatedEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter wri } writer.WriteStartObject(); - writer.WritePropertyName("resourceType"u8); - writer.WriteStringValue(FhirResourceType.ToString()); + if (Optional.IsDefined(FhirResourceType)) + { + writer.WritePropertyName("resourceType"u8); + writer.WriteStringValue(FhirResourceType.Value.ToString()); + } if (Optional.IsDefined(FhirServiceHostName)) { writer.WritePropertyName("resourceFhirAccount"u8); @@ -81,7 +84,7 @@ internal static HealthcareFhirResourceCreatedEventData DeserializeHealthcareFhir { return null; } - HealthcareFhirResourceType resourceType = default; + HealthcareFhirResourceType? resourceType = default; string resourceFhirAccount = default; string resourceFhirId = default; long? resourceVersionId = default; @@ -91,6 +94,10 @@ internal static HealthcareFhirResourceCreatedEventData DeserializeHealthcareFhir { if (property.NameEquals("resourceType"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } resourceType = new HealthcareFhirResourceType(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceCreatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceCreatedEventData.cs index ed48894c3e41..33b1ec472af0 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceCreatedEventData.cs @@ -46,10 +46,8 @@ public partial class HealthcareFhirResourceCreatedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Type of HL7 FHIR resource. - internal HealthcareFhirResourceCreatedEventData(HealthcareFhirResourceType fhirResourceType) + internal HealthcareFhirResourceCreatedEventData() { - FhirResourceType = fhirResourceType; } /// Initializes a new instance of . @@ -58,7 +56,7 @@ internal HealthcareFhirResourceCreatedEventData(HealthcareFhirResourceType fhirR /// Id of HL7 FHIR resource. /// VersionId of HL7 FHIR resource. It changes when the resource is created, updated, or deleted(soft-deletion). /// Keeps track of any properties unknown to the library. - internal HealthcareFhirResourceCreatedEventData(HealthcareFhirResourceType fhirResourceType, string fhirServiceHostName, string fhirResourceId, long? fhirResourceVersionId, IDictionary serializedAdditionalRawData) + internal HealthcareFhirResourceCreatedEventData(HealthcareFhirResourceType? fhirResourceType, string fhirServiceHostName, string fhirResourceId, long? fhirResourceVersionId, IDictionary serializedAdditionalRawData) { FhirResourceType = fhirResourceType; FhirServiceHostName = fhirServiceHostName; @@ -67,13 +65,8 @@ internal HealthcareFhirResourceCreatedEventData(HealthcareFhirResourceType fhirR _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal HealthcareFhirResourceCreatedEventData() - { - } - /// Type of HL7 FHIR resource. - public HealthcareFhirResourceType FhirResourceType { get; } + public HealthcareFhirResourceType? FhirResourceType { get; } /// Domain name of FHIR account for this resource. public string FhirServiceHostName { get; } /// Id of HL7 FHIR resource. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceDeletedEventData.Serialization.cs index 66997fa36cde..17160ec565f1 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceDeletedEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter wri } writer.WriteStartObject(); - writer.WritePropertyName("resourceType"u8); - writer.WriteStringValue(FhirResourceType.ToString()); + if (Optional.IsDefined(FhirResourceType)) + { + writer.WritePropertyName("resourceType"u8); + writer.WriteStringValue(FhirResourceType.Value.ToString()); + } if (Optional.IsDefined(FhirServiceHostName)) { writer.WritePropertyName("resourceFhirAccount"u8); @@ -81,7 +84,7 @@ internal static HealthcareFhirResourceDeletedEventData DeserializeHealthcareFhir { return null; } - HealthcareFhirResourceType resourceType = default; + HealthcareFhirResourceType? resourceType = default; string resourceFhirAccount = default; string resourceFhirId = default; long? resourceVersionId = default; @@ -91,6 +94,10 @@ internal static HealthcareFhirResourceDeletedEventData DeserializeHealthcareFhir { if (property.NameEquals("resourceType"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } resourceType = new HealthcareFhirResourceType(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceDeletedEventData.cs index 6e883f6f61e4..587830f92c2e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceDeletedEventData.cs @@ -46,10 +46,8 @@ public partial class HealthcareFhirResourceDeletedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Type of HL7 FHIR resource. - internal HealthcareFhirResourceDeletedEventData(HealthcareFhirResourceType fhirResourceType) + internal HealthcareFhirResourceDeletedEventData() { - FhirResourceType = fhirResourceType; } /// Initializes a new instance of . @@ -58,7 +56,7 @@ internal HealthcareFhirResourceDeletedEventData(HealthcareFhirResourceType fhirR /// Id of HL7 FHIR resource. /// VersionId of HL7 FHIR resource. It changes when the resource is created, updated, or deleted(soft-deletion). /// Keeps track of any properties unknown to the library. - internal HealthcareFhirResourceDeletedEventData(HealthcareFhirResourceType fhirResourceType, string fhirServiceHostName, string fhirResourceId, long? fhirResourceVersionId, IDictionary serializedAdditionalRawData) + internal HealthcareFhirResourceDeletedEventData(HealthcareFhirResourceType? fhirResourceType, string fhirServiceHostName, string fhirResourceId, long? fhirResourceVersionId, IDictionary serializedAdditionalRawData) { FhirResourceType = fhirResourceType; FhirServiceHostName = fhirServiceHostName; @@ -67,13 +65,8 @@ internal HealthcareFhirResourceDeletedEventData(HealthcareFhirResourceType fhirR _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal HealthcareFhirResourceDeletedEventData() - { - } - /// Type of HL7 FHIR resource. - public HealthcareFhirResourceType FhirResourceType { get; } + public HealthcareFhirResourceType? FhirResourceType { get; } /// Domain name of FHIR account for this resource. public string FhirServiceHostName { get; } /// Id of HL7 FHIR resource. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceUpdatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceUpdatedEventData.Serialization.cs index b50fc3cf3653..52c18d67cdca 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceUpdatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceUpdatedEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter wri } writer.WriteStartObject(); - writer.WritePropertyName("resourceType"u8); - writer.WriteStringValue(FhirResourceType.ToString()); + if (Optional.IsDefined(FhirResourceType)) + { + writer.WritePropertyName("resourceType"u8); + writer.WriteStringValue(FhirResourceType.Value.ToString()); + } if (Optional.IsDefined(FhirServiceHostName)) { writer.WritePropertyName("resourceFhirAccount"u8); @@ -81,7 +84,7 @@ internal static HealthcareFhirResourceUpdatedEventData DeserializeHealthcareFhir { return null; } - HealthcareFhirResourceType resourceType = default; + HealthcareFhirResourceType? resourceType = default; string resourceFhirAccount = default; string resourceFhirId = default; long? resourceVersionId = default; @@ -91,6 +94,10 @@ internal static HealthcareFhirResourceUpdatedEventData DeserializeHealthcareFhir { if (property.NameEquals("resourceType"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } resourceType = new HealthcareFhirResourceType(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceUpdatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceUpdatedEventData.cs index 7133f01a47d2..d4d5a4ce3262 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceUpdatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/HealthcareFhirResourceUpdatedEventData.cs @@ -46,10 +46,8 @@ public partial class HealthcareFhirResourceUpdatedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Type of HL7 FHIR resource. - internal HealthcareFhirResourceUpdatedEventData(HealthcareFhirResourceType fhirResourceType) + internal HealthcareFhirResourceUpdatedEventData() { - FhirResourceType = fhirResourceType; } /// Initializes a new instance of . @@ -58,7 +56,7 @@ internal HealthcareFhirResourceUpdatedEventData(HealthcareFhirResourceType fhirR /// Id of HL7 FHIR resource. /// VersionId of HL7 FHIR resource. It changes when the resource is created, updated, or deleted(soft-deletion). /// Keeps track of any properties unknown to the library. - internal HealthcareFhirResourceUpdatedEventData(HealthcareFhirResourceType fhirResourceType, string fhirServiceHostName, string fhirResourceId, long? fhirResourceVersionId, IDictionary serializedAdditionalRawData) + internal HealthcareFhirResourceUpdatedEventData(HealthcareFhirResourceType? fhirResourceType, string fhirServiceHostName, string fhirResourceId, long? fhirResourceVersionId, IDictionary serializedAdditionalRawData) { FhirResourceType = fhirResourceType; FhirServiceHostName = fhirServiceHostName; @@ -67,13 +65,8 @@ internal HealthcareFhirResourceUpdatedEventData(HealthcareFhirResourceType fhirR _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal HealthcareFhirResourceUpdatedEventData() - { - } - /// Type of HL7 FHIR resource. - public HealthcareFhirResourceType FhirResourceType { get; } + public HealthcareFhirResourceType? FhirResourceType { get; } /// Domain name of FHIR account for this resource. public string FhirServiceHostName { get; } /// Id of HL7 FHIR resource. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesDatasetDriftDetectedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesDatasetDriftDetectedEventData.Serialization.cs index dd461b059144..f8fefe54abe6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesDatasetDriftDetectedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesDatasetDriftDetectedEventData.Serialization.cs @@ -56,10 +56,16 @@ void IJsonModel.Write(Utf8 writer.WritePropertyName("driftCoefficient"u8); writer.WriteNumberValue(DriftCoefficient.Value); } - writer.WritePropertyName("startTime"u8); - writer.WriteStringValue(StartTime, "O"); - writer.WritePropertyName("endTime"u8); - writer.WriteStringValue(EndTime, "O"); + if (Optional.IsDefined(StartTime)) + { + writer.WritePropertyName("startTime"u8); + writer.WriteStringValue(StartTime.Value, "O"); + } + if (Optional.IsDefined(EndTime)) + { + writer.WritePropertyName("endTime"u8); + writer.WriteStringValue(EndTime.Value, "O"); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -104,8 +110,8 @@ internal static MachineLearningServicesDatasetDriftDetectedEventData Deserialize string baseDatasetId = default; string targetDatasetId = default; double? driftCoefficient = default; - DateTimeOffset startTime = default; - DateTimeOffset endTime = default; + DateTimeOffset? startTime = default; + DateTimeOffset? endTime = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -146,11 +152,19 @@ internal static MachineLearningServicesDatasetDriftDetectedEventData Deserialize } if (property.NameEquals("startTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } startTime = property.Value.GetDateTimeOffset("O"); continue; } if (property.NameEquals("endTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } endTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesDatasetDriftDetectedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesDatasetDriftDetectedEventData.cs index 9027d0c37322..f86f30e006be 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesDatasetDriftDetectedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MachineLearningServicesDatasetDriftDetectedEventData.cs @@ -46,12 +46,8 @@ public partial class MachineLearningServicesDatasetDriftDetectedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The start time of the target dataset time series that resulted in drift detection. - /// The end time of the target dataset time series that resulted in drift detection. - internal MachineLearningServicesDatasetDriftDetectedEventData(DateTimeOffset startTime, DateTimeOffset endTime) + internal MachineLearningServicesDatasetDriftDetectedEventData() { - StartTime = startTime; - EndTime = endTime; } /// Initializes a new instance of . @@ -64,7 +60,7 @@ internal MachineLearningServicesDatasetDriftDetectedEventData(DateTimeOffset sta /// The start time of the target dataset time series that resulted in drift detection. /// The end time of the target dataset time series that resulted in drift detection. /// Keeps track of any properties unknown to the library. - internal MachineLearningServicesDatasetDriftDetectedEventData(string dataDriftId, string dataDriftName, string runId, string baseDatasetId, string targetDatasetId, double? driftCoefficient, DateTimeOffset startTime, DateTimeOffset endTime, IDictionary serializedAdditionalRawData) + internal MachineLearningServicesDatasetDriftDetectedEventData(string dataDriftId, string dataDriftName, string runId, string baseDatasetId, string targetDatasetId, double? driftCoefficient, DateTimeOffset? startTime, DateTimeOffset? endTime, IDictionary serializedAdditionalRawData) { DataDriftId = dataDriftId; DataDriftName = dataDriftName; @@ -77,11 +73,6 @@ internal MachineLearningServicesDatasetDriftDetectedEventData(string dataDriftId _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal MachineLearningServicesDatasetDriftDetectedEventData() - { - } - /// The ID of the data drift monitor that triggered the event. public string DataDriftId { get; } /// The name of the data drift monitor that triggered the event. @@ -95,8 +86,8 @@ internal MachineLearningServicesDatasetDriftDetectedEventData() /// The coefficient result that triggered the event. public double? DriftCoefficient { get; } /// The start time of the target dataset time series that resulted in drift detection. - public DateTimeOffset StartTime { get; } + public DateTimeOffset? StartTime { get; } /// The end time of the target dataset time series that resulted in drift detection. - public DateTimeOffset EndTime { get; } + public DateTimeOffset? EndTime { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCanceledEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCanceledEventData.Serialization.cs index 9bd58376a5bb..9831c25118ed 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCanceledEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCanceledEventData.Serialization.cs @@ -33,10 +33,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea writer.WriteObjectValue(item, options); } writer.WriteEndArray(); - writer.WritePropertyName("previousState"u8); - writer.WriteStringValue(PreviousState.ToString()); - writer.WritePropertyName("state"u8); - writer.WriteStringValue(State.ToString()); + if (Optional.IsDefined(PreviousState)) + { + writer.WritePropertyName("previousState"u8); + writer.WriteStringValue(PreviousState.Value.ToString()); + } + if (Optional.IsDefined(State)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.Value.ToString()); + } writer.WritePropertyName("correlationData"u8); writer.WriteStartObject(); foreach (var item in CorrelationData) @@ -84,8 +90,8 @@ internal static MediaJobCanceledEventData DeserializeMediaJobCanceledEventData(J return null; } IReadOnlyList outputs = default; - MediaJobState previousState = default; - MediaJobState state = default; + MediaJobState? previousState = default; + MediaJobState? state = default; IReadOnlyDictionary correlationData = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -103,11 +109,19 @@ internal static MediaJobCanceledEventData DeserializeMediaJobCanceledEventData(J } if (property.NameEquals("previousState"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } previousState = new MediaJobState(property.Value.GetString()); continue; } if (property.NameEquals("state"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } state = new MediaJobState(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCanceledEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCanceledEventData.cs index 953505804d20..bc8a9b88cb4f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCanceledEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCanceledEventData.cs @@ -18,8 +18,6 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class MediaJobCanceledEventData : MediaJobStateChangeEventData { /// Initializes a new instance of . - /// The previous state of the Job. - /// The new state of the Job. /// Gets the Job correlation data. /// /// Gets the Job outputs. @@ -27,7 +25,7 @@ public partial class MediaJobCanceledEventData : MediaJobStateChangeEventData /// The available derived classes include . /// /// or is null. - internal MediaJobCanceledEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData, IEnumerable outputs) : base(previousState, state, correlationData) + internal MediaJobCanceledEventData(IReadOnlyDictionary correlationData, IEnumerable outputs) : base(correlationData) { Argument.AssertNotNull(correlationData, nameof(correlationData)); Argument.AssertNotNull(outputs, nameof(outputs)); @@ -45,7 +43,7 @@ internal MediaJobCanceledEventData(MediaJobState previousState, MediaJobState st /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include . /// - internal MediaJobCanceledEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData, IDictionary serializedAdditionalRawData, IReadOnlyList outputs) : base(previousState, state, correlationData, serializedAdditionalRawData) + internal MediaJobCanceledEventData(MediaJobState? previousState, MediaJobState? state, IReadOnlyDictionary correlationData, IDictionary serializedAdditionalRawData, IReadOnlyList outputs) : base(previousState, state, correlationData, serializedAdditionalRawData) { Outputs = outputs; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCancelingEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCancelingEventData.Serialization.cs index aa8a7fc6c7f8..ce8ee035df9b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCancelingEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCancelingEventData.Serialization.cs @@ -26,10 +26,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe } writer.WriteStartObject(); - writer.WritePropertyName("previousState"u8); - writer.WriteStringValue(PreviousState.ToString()); - writer.WritePropertyName("state"u8); - writer.WriteStringValue(State.ToString()); + if (Optional.IsDefined(PreviousState)) + { + writer.WritePropertyName("previousState"u8); + writer.WriteStringValue(PreviousState.Value.ToString()); + } + if (Optional.IsDefined(State)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.Value.ToString()); + } writer.WritePropertyName("correlationData"u8); writer.WriteStartObject(); foreach (var item in CorrelationData) @@ -76,8 +82,8 @@ internal static MediaJobCancelingEventData DeserializeMediaJobCancelingEventData { return null; } - MediaJobState previousState = default; - MediaJobState state = default; + MediaJobState? previousState = default; + MediaJobState? state = default; IReadOnlyDictionary correlationData = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -85,11 +91,19 @@ internal static MediaJobCancelingEventData DeserializeMediaJobCancelingEventData { if (property.NameEquals("previousState"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } previousState = new MediaJobState(property.Value.GetString()); continue; } if (property.NameEquals("state"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } state = new MediaJobState(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCancelingEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCancelingEventData.cs index c1493f0f200e..252afc4da760 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCancelingEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobCancelingEventData.cs @@ -17,11 +17,9 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class MediaJobCancelingEventData : MediaJobStateChangeEventData { /// Initializes a new instance of . - /// The previous state of the Job. - /// The new state of the Job. /// Gets the Job correlation data. /// is null. - internal MediaJobCancelingEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData) : base(previousState, state, correlationData) + internal MediaJobCancelingEventData(IReadOnlyDictionary correlationData) : base(correlationData) { Argument.AssertNotNull(correlationData, nameof(correlationData)); } @@ -31,7 +29,7 @@ internal MediaJobCancelingEventData(MediaJobState previousState, MediaJobState s /// The new state of the Job. /// Gets the Job correlation data. /// Keeps track of any properties unknown to the library. - internal MediaJobCancelingEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData, IDictionary serializedAdditionalRawData) : base(previousState, state, correlationData, serializedAdditionalRawData) + internal MediaJobCancelingEventData(MediaJobState? previousState, MediaJobState? state, IReadOnlyDictionary correlationData, IDictionary serializedAdditionalRawData) : base(previousState, state, correlationData, serializedAdditionalRawData) { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobError.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobError.Serialization.cs index 862507f4a435..bf8f0bec583a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobError.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobError.Serialization.cs @@ -26,17 +26,26 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpt } writer.WriteStartObject(); - writer.WritePropertyName("code"u8); - writer.WriteStringValue(Code.ToString()); + if (Optional.IsDefined(Code)) + { + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code.Value.ToString()); + } if (Optional.IsDefined(Message)) { writer.WritePropertyName("message"u8); writer.WriteStringValue(Message); } - writer.WritePropertyName("category"u8); - writer.WriteStringValue(Category.ToString()); - writer.WritePropertyName("retry"u8); - writer.WriteStringValue(Retry.ToString()); + if (Optional.IsDefined(Category)) + { + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category.Value.ToString()); + } + if (Optional.IsDefined(Retry)) + { + writer.WritePropertyName("retry"u8); + writer.WriteStringValue(Retry.Value.ToString()); + } writer.WritePropertyName("details"u8); writer.WriteStartArray(); foreach (var item in Details) @@ -82,10 +91,10 @@ internal static MediaJobError DeserializeMediaJobError(JsonElement element, Mode { return null; } - MediaJobErrorCode code = default; + MediaJobErrorCode? code = default; string message = default; - MediaJobErrorCategory category = default; - MediaJobRetry retry = default; + MediaJobErrorCategory? category = default; + MediaJobRetry? retry = default; IReadOnlyList details = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -93,6 +102,10 @@ internal static MediaJobError DeserializeMediaJobError(JsonElement element, Mode { if (property.NameEquals("code"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } code = new MediaJobErrorCode(property.Value.GetString()); continue; } @@ -103,11 +116,19 @@ internal static MediaJobError DeserializeMediaJobError(JsonElement element, Mode } if (property.NameEquals("category"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } category = new MediaJobErrorCategory(property.Value.GetString()); continue; } if (property.NameEquals("retry"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } retry = new MediaJobRetry(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobError.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobError.cs index 751ed7d395fe..a3d57837407f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobError.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobError.cs @@ -47,18 +47,12 @@ public partial class MediaJobError private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Error code describing the error. - /// Helps with categorization of errors. - /// Indicates that it may be possible to retry the Job. If retry is unsuccessful, please contact Azure support via Azure Portal. /// An array of details about specific errors that led to this reported error. /// is null. - internal MediaJobError(MediaJobErrorCode code, MediaJobErrorCategory category, MediaJobRetry retry, IEnumerable details) + internal MediaJobError(IEnumerable details) { Argument.AssertNotNull(details, nameof(details)); - Code = code; - Category = category; - Retry = retry; Details = details.ToList(); } @@ -69,7 +63,7 @@ internal MediaJobError(MediaJobErrorCode code, MediaJobErrorCategory category, M /// Indicates that it may be possible to retry the Job. If retry is unsuccessful, please contact Azure support via Azure Portal. /// An array of details about specific errors that led to this reported error. /// Keeps track of any properties unknown to the library. - internal MediaJobError(MediaJobErrorCode code, string message, MediaJobErrorCategory category, MediaJobRetry retry, IReadOnlyList details, IDictionary serializedAdditionalRawData) + internal MediaJobError(MediaJobErrorCode? code, string message, MediaJobErrorCategory? category, MediaJobRetry? retry, IReadOnlyList details, IDictionary serializedAdditionalRawData) { Code = code; Message = message; @@ -85,13 +79,13 @@ internal MediaJobError() } /// Error code describing the error. - public MediaJobErrorCode Code { get; } + public MediaJobErrorCode? Code { get; } /// A human-readable language-dependent representation of the error. public string Message { get; } /// Helps with categorization of errors. - public MediaJobErrorCategory Category { get; } + public MediaJobErrorCategory? Category { get; } /// Indicates that it may be possible to retry the Job. If retry is unsuccessful, please contact Azure support via Azure Portal. - public MediaJobRetry Retry { get; } + public MediaJobRetry? Retry { get; } /// An array of details about specific errors that led to this reported error. public IReadOnlyList Details { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobErroredEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobErroredEventData.Serialization.cs index 09a9e6d8144e..f42f7d1768f5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobErroredEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobErroredEventData.Serialization.cs @@ -33,10 +33,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead writer.WriteObjectValue(item, options); } writer.WriteEndArray(); - writer.WritePropertyName("previousState"u8); - writer.WriteStringValue(PreviousState.ToString()); - writer.WritePropertyName("state"u8); - writer.WriteStringValue(State.ToString()); + if (Optional.IsDefined(PreviousState)) + { + writer.WritePropertyName("previousState"u8); + writer.WriteStringValue(PreviousState.Value.ToString()); + } + if (Optional.IsDefined(State)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.Value.ToString()); + } writer.WritePropertyName("correlationData"u8); writer.WriteStartObject(); foreach (var item in CorrelationData) @@ -84,8 +90,8 @@ internal static MediaJobErroredEventData DeserializeMediaJobErroredEventData(Jso return null; } IReadOnlyList outputs = default; - MediaJobState previousState = default; - MediaJobState state = default; + MediaJobState? previousState = default; + MediaJobState? state = default; IReadOnlyDictionary correlationData = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -103,11 +109,19 @@ internal static MediaJobErroredEventData DeserializeMediaJobErroredEventData(Jso } if (property.NameEquals("previousState"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } previousState = new MediaJobState(property.Value.GetString()); continue; } if (property.NameEquals("state"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } state = new MediaJobState(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobErroredEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobErroredEventData.cs index 0c76f70e4bc5..339ba9bdc11c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobErroredEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobErroredEventData.cs @@ -18,8 +18,6 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class MediaJobErroredEventData : MediaJobStateChangeEventData { /// Initializes a new instance of . - /// The previous state of the Job. - /// The new state of the Job. /// Gets the Job correlation data. /// /// Gets the Job outputs. @@ -27,7 +25,7 @@ public partial class MediaJobErroredEventData : MediaJobStateChangeEventData /// The available derived classes include . /// /// or is null. - internal MediaJobErroredEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData, IEnumerable outputs) : base(previousState, state, correlationData) + internal MediaJobErroredEventData(IReadOnlyDictionary correlationData, IEnumerable outputs) : base(correlationData) { Argument.AssertNotNull(correlationData, nameof(correlationData)); Argument.AssertNotNull(outputs, nameof(outputs)); @@ -45,7 +43,7 @@ internal MediaJobErroredEventData(MediaJobState previousState, MediaJobState sta /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include . /// - internal MediaJobErroredEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData, IDictionary serializedAdditionalRawData, IReadOnlyList outputs) : base(previousState, state, correlationData, serializedAdditionalRawData) + internal MediaJobErroredEventData(MediaJobState? previousState, MediaJobState? state, IReadOnlyDictionary correlationData, IDictionary serializedAdditionalRawData, IReadOnlyList outputs) : base(previousState, state, correlationData, serializedAdditionalRawData) { Outputs = outputs; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobFinishedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobFinishedEventData.Serialization.cs index e7088261a09f..fb0b8bb594e3 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobFinishedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobFinishedEventData.Serialization.cs @@ -33,10 +33,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea writer.WriteObjectValue(item, options); } writer.WriteEndArray(); - writer.WritePropertyName("previousState"u8); - writer.WriteStringValue(PreviousState.ToString()); - writer.WritePropertyName("state"u8); - writer.WriteStringValue(State.ToString()); + if (Optional.IsDefined(PreviousState)) + { + writer.WritePropertyName("previousState"u8); + writer.WriteStringValue(PreviousState.Value.ToString()); + } + if (Optional.IsDefined(State)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.Value.ToString()); + } writer.WritePropertyName("correlationData"u8); writer.WriteStartObject(); foreach (var item in CorrelationData) @@ -84,8 +90,8 @@ internal static MediaJobFinishedEventData DeserializeMediaJobFinishedEventData(J return null; } IReadOnlyList outputs = default; - MediaJobState previousState = default; - MediaJobState state = default; + MediaJobState? previousState = default; + MediaJobState? state = default; IReadOnlyDictionary correlationData = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -103,11 +109,19 @@ internal static MediaJobFinishedEventData DeserializeMediaJobFinishedEventData(J } if (property.NameEquals("previousState"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } previousState = new MediaJobState(property.Value.GetString()); continue; } if (property.NameEquals("state"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } state = new MediaJobState(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobFinishedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobFinishedEventData.cs index 64a495eac9b8..595827f33d08 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobFinishedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobFinishedEventData.cs @@ -18,8 +18,6 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class MediaJobFinishedEventData : MediaJobStateChangeEventData { /// Initializes a new instance of . - /// The previous state of the Job. - /// The new state of the Job. /// Gets the Job correlation data. /// /// Gets the Job outputs. @@ -27,7 +25,7 @@ public partial class MediaJobFinishedEventData : MediaJobStateChangeEventData /// The available derived classes include . /// /// or is null. - internal MediaJobFinishedEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData, IEnumerable outputs) : base(previousState, state, correlationData) + internal MediaJobFinishedEventData(IReadOnlyDictionary correlationData, IEnumerable outputs) : base(correlationData) { Argument.AssertNotNull(correlationData, nameof(correlationData)); Argument.AssertNotNull(outputs, nameof(outputs)); @@ -45,7 +43,7 @@ internal MediaJobFinishedEventData(MediaJobState previousState, MediaJobState st /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include . /// - internal MediaJobFinishedEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData, IDictionary serializedAdditionalRawData, IReadOnlyList outputs) : base(previousState, state, correlationData, serializedAdditionalRawData) + internal MediaJobFinishedEventData(MediaJobState? previousState, MediaJobState? state, IReadOnlyDictionary correlationData, IDictionary serializedAdditionalRawData, IReadOnlyList outputs) : base(previousState, state, correlationData, serializedAdditionalRawData) { Outputs = outputs; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutput.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutput.Serialization.cs index 86926e7dae11..2d3d4b7a0f23 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutput.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutput.Serialization.cs @@ -37,8 +37,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp } writer.WritePropertyName("progress"u8); writer.WriteNumberValue(Progress); - writer.WritePropertyName("state"u8); - writer.WriteStringValue(State.ToString()); + if (Optional.IsDefined(State)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutput.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutput.cs index 2a5881ab7ec5..4a124d196d51 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutput.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutput.cs @@ -52,15 +52,13 @@ public abstract partial class MediaJobOutput /// Initializes a new instance of . /// Gets the Job output error. /// Gets the Job output progress. - /// Gets the Job output state. /// is null. - protected MediaJobOutput(MediaJobError error, long progress, MediaJobState state) + protected MediaJobOutput(MediaJobError error, long progress) { Argument.AssertNotNull(error, nameof(error)); Error = error; Progress = progress; - State = state; } /// Initializes a new instance of . @@ -70,7 +68,7 @@ protected MediaJobOutput(MediaJobError error, long progress, MediaJobState state /// Gets the Job output progress. /// Gets the Job output state. /// Keeps track of any properties unknown to the library. - internal MediaJobOutput(string odataType, MediaJobError error, string label, long progress, MediaJobState state, IDictionary serializedAdditionalRawData) + internal MediaJobOutput(string odataType, MediaJobError error, string label, long progress, MediaJobState? state, IDictionary serializedAdditionalRawData) { OdataType = odataType; Error = error; @@ -94,6 +92,6 @@ internal MediaJobOutput() /// Gets the Job output progress. public long Progress { get; } /// Gets the Job output state. - public MediaJobState State { get; } + public MediaJobState? State { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputAsset.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputAsset.Serialization.cs index 206565a09a99..56e3df8b8e16 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputAsset.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputAsset.Serialization.cs @@ -42,8 +42,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri } writer.WritePropertyName("progress"u8); writer.WriteNumberValue(Progress); - writer.WritePropertyName("state"u8); - writer.WriteStringValue(State.ToString()); + if (Optional.IsDefined(State)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -87,7 +90,7 @@ internal static MediaJobOutputAsset DeserializeMediaJobOutputAsset(JsonElement e MediaJobError error = default; string label = default; long progress = default; - MediaJobState state = default; + MediaJobState? state = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -119,6 +122,10 @@ internal static MediaJobOutputAsset DeserializeMediaJobOutputAsset(JsonElement e } if (property.NameEquals("state"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } state = new MediaJobState(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputAsset.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputAsset.cs index b43e0081261b..52ebea802ff5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputAsset.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputAsset.cs @@ -16,9 +16,8 @@ public partial class MediaJobOutputAsset : MediaJobOutput /// Initializes a new instance of . /// Gets the Job output error. /// Gets the Job output progress. - /// Gets the Job output state. /// is null. - internal MediaJobOutputAsset(MediaJobError error, long progress, MediaJobState state) : base(error, progress, state) + internal MediaJobOutputAsset(MediaJobError error, long progress) : base(error, progress) { Argument.AssertNotNull(error, nameof(error)); @@ -33,7 +32,7 @@ internal MediaJobOutputAsset(MediaJobError error, long progress, MediaJobState s /// Gets the Job output state. /// Keeps track of any properties unknown to the library. /// Gets the Job output asset name. - internal MediaJobOutputAsset(string odataType, MediaJobError error, string label, long progress, MediaJobState state, IDictionary serializedAdditionalRawData, string assetName) : base(odataType, error, label, progress, state, serializedAdditionalRawData) + internal MediaJobOutputAsset(string odataType, MediaJobError error, string label, long progress, MediaJobState? state, IDictionary serializedAdditionalRawData, string assetName) : base(odataType, error, label, progress, state, serializedAdditionalRawData) { AssetName = assetName; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCanceledEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCanceledEventData.Serialization.cs index 64fa1df43688..9e852ee5bd3f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCanceledEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCanceledEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo } writer.WriteStartObject(); - writer.WritePropertyName("previousState"u8); - writer.WriteStringValue(PreviousState.ToString()); + if (Optional.IsDefined(PreviousState)) + { + writer.WritePropertyName("previousState"u8); + writer.WriteStringValue(PreviousState.Value.ToString()); + } writer.WritePropertyName("output"u8); writer.WriteObjectValue(Output, options); writer.WritePropertyName("jobCorrelationData"u8); @@ -76,7 +79,7 @@ internal static MediaJobOutputCanceledEventData DeserializeMediaJobOutputCancele { return null; } - MediaJobState previousState = default; + MediaJobState? previousState = default; MediaJobOutput output = default; IReadOnlyDictionary jobCorrelationData = default; IDictionary serializedAdditionalRawData = default; @@ -85,6 +88,10 @@ internal static MediaJobOutputCanceledEventData DeserializeMediaJobOutputCancele { if (property.NameEquals("previousState"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } previousState = new MediaJobState(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCanceledEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCanceledEventData.cs index 55ec62b58492..9557aebd3544 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCanceledEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCanceledEventData.cs @@ -17,7 +17,6 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class MediaJobOutputCanceledEventData : MediaJobOutputStateChangeEventData { /// Initializes a new instance of . - /// The previous state of the Job. /// /// Gets the output. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. @@ -25,7 +24,7 @@ public partial class MediaJobOutputCanceledEventData : MediaJobOutputStateChange /// /// Gets the Job correlation data. /// or is null. - internal MediaJobOutputCanceledEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData) : base(previousState, output, jobCorrelationData) + internal MediaJobOutputCanceledEventData(MediaJobOutput output, IReadOnlyDictionary jobCorrelationData) : base(output, jobCorrelationData) { Argument.AssertNotNull(output, nameof(output)); Argument.AssertNotNull(jobCorrelationData, nameof(jobCorrelationData)); @@ -40,7 +39,7 @@ internal MediaJobOutputCanceledEventData(MediaJobState previousState, MediaJobOu /// /// Gets the Job correlation data. /// Keeps track of any properties unknown to the library. - internal MediaJobOutputCanceledEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData, IDictionary serializedAdditionalRawData) : base(previousState, output, jobCorrelationData, serializedAdditionalRawData) + internal MediaJobOutputCanceledEventData(MediaJobState? previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData, IDictionary serializedAdditionalRawData) : base(previousState, output, jobCorrelationData, serializedAdditionalRawData) { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCancelingEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCancelingEventData.Serialization.cs index 1ea15a57398c..9fbe333d3000 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCancelingEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCancelingEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, M } writer.WriteStartObject(); - writer.WritePropertyName("previousState"u8); - writer.WriteStringValue(PreviousState.ToString()); + if (Optional.IsDefined(PreviousState)) + { + writer.WritePropertyName("previousState"u8); + writer.WriteStringValue(PreviousState.Value.ToString()); + } writer.WritePropertyName("output"u8); writer.WriteObjectValue(Output, options); writer.WritePropertyName("jobCorrelationData"u8); @@ -76,7 +79,7 @@ internal static MediaJobOutputCancelingEventData DeserializeMediaJobOutputCancel { return null; } - MediaJobState previousState = default; + MediaJobState? previousState = default; MediaJobOutput output = default; IReadOnlyDictionary jobCorrelationData = default; IDictionary serializedAdditionalRawData = default; @@ -85,6 +88,10 @@ internal static MediaJobOutputCancelingEventData DeserializeMediaJobOutputCancel { if (property.NameEquals("previousState"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } previousState = new MediaJobState(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCancelingEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCancelingEventData.cs index 30e7d163aaa6..b8d656cd4e98 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCancelingEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputCancelingEventData.cs @@ -17,7 +17,6 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class MediaJobOutputCancelingEventData : MediaJobOutputStateChangeEventData { /// Initializes a new instance of . - /// The previous state of the Job. /// /// Gets the output. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. @@ -25,7 +24,7 @@ public partial class MediaJobOutputCancelingEventData : MediaJobOutputStateChang /// /// Gets the Job correlation data. /// or is null. - internal MediaJobOutputCancelingEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData) : base(previousState, output, jobCorrelationData) + internal MediaJobOutputCancelingEventData(MediaJobOutput output, IReadOnlyDictionary jobCorrelationData) : base(output, jobCorrelationData) { Argument.AssertNotNull(output, nameof(output)); Argument.AssertNotNull(jobCorrelationData, nameof(jobCorrelationData)); @@ -40,7 +39,7 @@ internal MediaJobOutputCancelingEventData(MediaJobState previousState, MediaJobO /// /// Gets the Job correlation data. /// Keeps track of any properties unknown to the library. - internal MediaJobOutputCancelingEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData, IDictionary serializedAdditionalRawData) : base(previousState, output, jobCorrelationData, serializedAdditionalRawData) + internal MediaJobOutputCancelingEventData(MediaJobState? previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData, IDictionary serializedAdditionalRawData) : base(previousState, output, jobCorrelationData, serializedAdditionalRawData) { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputErroredEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputErroredEventData.Serialization.cs index 68d9e444422a..f29c1646a4b7 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputErroredEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputErroredEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod } writer.WriteStartObject(); - writer.WritePropertyName("previousState"u8); - writer.WriteStringValue(PreviousState.ToString()); + if (Optional.IsDefined(PreviousState)) + { + writer.WritePropertyName("previousState"u8); + writer.WriteStringValue(PreviousState.Value.ToString()); + } writer.WritePropertyName("output"u8); writer.WriteObjectValue(Output, options); writer.WritePropertyName("jobCorrelationData"u8); @@ -76,7 +79,7 @@ internal static MediaJobOutputErroredEventData DeserializeMediaJobOutputErroredE { return null; } - MediaJobState previousState = default; + MediaJobState? previousState = default; MediaJobOutput output = default; IReadOnlyDictionary jobCorrelationData = default; IDictionary serializedAdditionalRawData = default; @@ -85,6 +88,10 @@ internal static MediaJobOutputErroredEventData DeserializeMediaJobOutputErroredE { if (property.NameEquals("previousState"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } previousState = new MediaJobState(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputErroredEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputErroredEventData.cs index 22535aa75e81..9bd7bb2d0602 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputErroredEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputErroredEventData.cs @@ -17,7 +17,6 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class MediaJobOutputErroredEventData : MediaJobOutputStateChangeEventData { /// Initializes a new instance of . - /// The previous state of the Job. /// /// Gets the output. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. @@ -25,7 +24,7 @@ public partial class MediaJobOutputErroredEventData : MediaJobOutputStateChangeE /// /// Gets the Job correlation data. /// or is null. - internal MediaJobOutputErroredEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData) : base(previousState, output, jobCorrelationData) + internal MediaJobOutputErroredEventData(MediaJobOutput output, IReadOnlyDictionary jobCorrelationData) : base(output, jobCorrelationData) { Argument.AssertNotNull(output, nameof(output)); Argument.AssertNotNull(jobCorrelationData, nameof(jobCorrelationData)); @@ -40,7 +39,7 @@ internal MediaJobOutputErroredEventData(MediaJobState previousState, MediaJobOut /// /// Gets the Job correlation data. /// Keeps track of any properties unknown to the library. - internal MediaJobOutputErroredEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData, IDictionary serializedAdditionalRawData) : base(previousState, output, jobCorrelationData, serializedAdditionalRawData) + internal MediaJobOutputErroredEventData(MediaJobState? previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData, IDictionary serializedAdditionalRawData) : base(previousState, output, jobCorrelationData, serializedAdditionalRawData) { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputFinishedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputFinishedEventData.Serialization.cs index 3c41ec294d61..716c50d82ef1 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputFinishedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputFinishedEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo } writer.WriteStartObject(); - writer.WritePropertyName("previousState"u8); - writer.WriteStringValue(PreviousState.ToString()); + if (Optional.IsDefined(PreviousState)) + { + writer.WritePropertyName("previousState"u8); + writer.WriteStringValue(PreviousState.Value.ToString()); + } writer.WritePropertyName("output"u8); writer.WriteObjectValue(Output, options); writer.WritePropertyName("jobCorrelationData"u8); @@ -76,7 +79,7 @@ internal static MediaJobOutputFinishedEventData DeserializeMediaJobOutputFinishe { return null; } - MediaJobState previousState = default; + MediaJobState? previousState = default; MediaJobOutput output = default; IReadOnlyDictionary jobCorrelationData = default; IDictionary serializedAdditionalRawData = default; @@ -85,6 +88,10 @@ internal static MediaJobOutputFinishedEventData DeserializeMediaJobOutputFinishe { if (property.NameEquals("previousState"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } previousState = new MediaJobState(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputFinishedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputFinishedEventData.cs index 701290e6f1cf..7d33358fcf91 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputFinishedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputFinishedEventData.cs @@ -17,7 +17,6 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class MediaJobOutputFinishedEventData : MediaJobOutputStateChangeEventData { /// Initializes a new instance of . - /// The previous state of the Job. /// /// Gets the output. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. @@ -25,7 +24,7 @@ public partial class MediaJobOutputFinishedEventData : MediaJobOutputStateChange /// /// Gets the Job correlation data. /// or is null. - internal MediaJobOutputFinishedEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData) : base(previousState, output, jobCorrelationData) + internal MediaJobOutputFinishedEventData(MediaJobOutput output, IReadOnlyDictionary jobCorrelationData) : base(output, jobCorrelationData) { Argument.AssertNotNull(output, nameof(output)); Argument.AssertNotNull(jobCorrelationData, nameof(jobCorrelationData)); @@ -40,7 +39,7 @@ internal MediaJobOutputFinishedEventData(MediaJobState previousState, MediaJobOu /// /// Gets the Job correlation data. /// Keeps track of any properties unknown to the library. - internal MediaJobOutputFinishedEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData, IDictionary serializedAdditionalRawData) : base(previousState, output, jobCorrelationData, serializedAdditionalRawData) + internal MediaJobOutputFinishedEventData(MediaJobState? previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData, IDictionary serializedAdditionalRawData) : base(previousState, output, jobCorrelationData, serializedAdditionalRawData) { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputProcessingEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputProcessingEventData.Serialization.cs index c6b058be3140..faf6cd2745db 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputProcessingEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputProcessingEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, } writer.WriteStartObject(); - writer.WritePropertyName("previousState"u8); - writer.WriteStringValue(PreviousState.ToString()); + if (Optional.IsDefined(PreviousState)) + { + writer.WritePropertyName("previousState"u8); + writer.WriteStringValue(PreviousState.Value.ToString()); + } writer.WritePropertyName("output"u8); writer.WriteObjectValue(Output, options); writer.WritePropertyName("jobCorrelationData"u8); @@ -76,7 +79,7 @@ internal static MediaJobOutputProcessingEventData DeserializeMediaJobOutputProce { return null; } - MediaJobState previousState = default; + MediaJobState? previousState = default; MediaJobOutput output = default; IReadOnlyDictionary jobCorrelationData = default; IDictionary serializedAdditionalRawData = default; @@ -85,6 +88,10 @@ internal static MediaJobOutputProcessingEventData DeserializeMediaJobOutputProce { if (property.NameEquals("previousState"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } previousState = new MediaJobState(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputProcessingEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputProcessingEventData.cs index 1d4c4de32283..2c0589312b25 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputProcessingEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputProcessingEventData.cs @@ -17,7 +17,6 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class MediaJobOutputProcessingEventData : MediaJobOutputStateChangeEventData { /// Initializes a new instance of . - /// The previous state of the Job. /// /// Gets the output. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. @@ -25,7 +24,7 @@ public partial class MediaJobOutputProcessingEventData : MediaJobOutputStateChan /// /// Gets the Job correlation data. /// or is null. - internal MediaJobOutputProcessingEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData) : base(previousState, output, jobCorrelationData) + internal MediaJobOutputProcessingEventData(MediaJobOutput output, IReadOnlyDictionary jobCorrelationData) : base(output, jobCorrelationData) { Argument.AssertNotNull(output, nameof(output)); Argument.AssertNotNull(jobCorrelationData, nameof(jobCorrelationData)); @@ -40,7 +39,7 @@ internal MediaJobOutputProcessingEventData(MediaJobState previousState, MediaJob /// /// Gets the Job correlation data. /// Keeps track of any properties unknown to the library. - internal MediaJobOutputProcessingEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData, IDictionary serializedAdditionalRawData) : base(previousState, output, jobCorrelationData, serializedAdditionalRawData) + internal MediaJobOutputProcessingEventData(MediaJobState? previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData, IDictionary serializedAdditionalRawData) : base(previousState, output, jobCorrelationData, serializedAdditionalRawData) { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputScheduledEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputScheduledEventData.Serialization.cs index c0b0e6dbe44d..53ff7003c3dd 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputScheduledEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputScheduledEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, M } writer.WriteStartObject(); - writer.WritePropertyName("previousState"u8); - writer.WriteStringValue(PreviousState.ToString()); + if (Optional.IsDefined(PreviousState)) + { + writer.WritePropertyName("previousState"u8); + writer.WriteStringValue(PreviousState.Value.ToString()); + } writer.WritePropertyName("output"u8); writer.WriteObjectValue(Output, options); writer.WritePropertyName("jobCorrelationData"u8); @@ -76,7 +79,7 @@ internal static MediaJobOutputScheduledEventData DeserializeMediaJobOutputSchedu { return null; } - MediaJobState previousState = default; + MediaJobState? previousState = default; MediaJobOutput output = default; IReadOnlyDictionary jobCorrelationData = default; IDictionary serializedAdditionalRawData = default; @@ -85,6 +88,10 @@ internal static MediaJobOutputScheduledEventData DeserializeMediaJobOutputSchedu { if (property.NameEquals("previousState"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } previousState = new MediaJobState(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputScheduledEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputScheduledEventData.cs index a11011667492..ec55af9cc5bc 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputScheduledEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputScheduledEventData.cs @@ -17,7 +17,6 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class MediaJobOutputScheduledEventData : MediaJobOutputStateChangeEventData { /// Initializes a new instance of . - /// The previous state of the Job. /// /// Gets the output. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. @@ -25,7 +24,7 @@ public partial class MediaJobOutputScheduledEventData : MediaJobOutputStateChang /// /// Gets the Job correlation data. /// or is null. - internal MediaJobOutputScheduledEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData) : base(previousState, output, jobCorrelationData) + internal MediaJobOutputScheduledEventData(MediaJobOutput output, IReadOnlyDictionary jobCorrelationData) : base(output, jobCorrelationData) { Argument.AssertNotNull(output, nameof(output)); Argument.AssertNotNull(jobCorrelationData, nameof(jobCorrelationData)); @@ -40,7 +39,7 @@ internal MediaJobOutputScheduledEventData(MediaJobState previousState, MediaJobO /// /// Gets the Job correlation data. /// Keeps track of any properties unknown to the library. - internal MediaJobOutputScheduledEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData, IDictionary serializedAdditionalRawData) : base(previousState, output, jobCorrelationData, serializedAdditionalRawData) + internal MediaJobOutputScheduledEventData(MediaJobState? previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData, IDictionary serializedAdditionalRawData) : base(previousState, output, jobCorrelationData, serializedAdditionalRawData) { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputStateChangeEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputStateChangeEventData.Serialization.cs index 856367ac3289..c9fdcf43a067 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputStateChangeEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputStateChangeEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, } writer.WriteStartObject(); - writer.WritePropertyName("previousState"u8); - writer.WriteStringValue(PreviousState.ToString()); + if (Optional.IsDefined(PreviousState)) + { + writer.WritePropertyName("previousState"u8); + writer.WriteStringValue(PreviousState.Value.ToString()); + } writer.WritePropertyName("output"u8); writer.WriteObjectValue(Output, options); writer.WritePropertyName("jobCorrelationData"u8); @@ -76,7 +79,7 @@ internal static MediaJobOutputStateChangeEventData DeserializeMediaJobOutputStat { return null; } - MediaJobState previousState = default; + MediaJobState? previousState = default; MediaJobOutput output = default; IReadOnlyDictionary jobCorrelationData = default; IDictionary serializedAdditionalRawData = default; @@ -85,6 +88,10 @@ internal static MediaJobOutputStateChangeEventData DeserializeMediaJobOutputStat { if (property.NameEquals("previousState"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } previousState = new MediaJobState(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputStateChangeEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputStateChangeEventData.cs index d647fa5feff2..76c801b2ce24 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputStateChangeEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobOutputStateChangeEventData.cs @@ -49,7 +49,6 @@ public partial class MediaJobOutputStateChangeEventData private protected IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The previous state of the Job. /// /// Gets the output. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. @@ -57,12 +56,11 @@ public partial class MediaJobOutputStateChangeEventData /// /// Gets the Job correlation data. /// or is null. - internal MediaJobOutputStateChangeEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData) + internal MediaJobOutputStateChangeEventData(MediaJobOutput output, IReadOnlyDictionary jobCorrelationData) { Argument.AssertNotNull(output, nameof(output)); Argument.AssertNotNull(jobCorrelationData, nameof(jobCorrelationData)); - PreviousState = previousState; Output = output; JobCorrelationData = jobCorrelationData; } @@ -76,7 +74,7 @@ internal MediaJobOutputStateChangeEventData(MediaJobState previousState, MediaJo /// /// Gets the Job correlation data. /// Keeps track of any properties unknown to the library. - internal MediaJobOutputStateChangeEventData(MediaJobState previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData, IDictionary serializedAdditionalRawData) + internal MediaJobOutputStateChangeEventData(MediaJobState? previousState, MediaJobOutput output, IReadOnlyDictionary jobCorrelationData, IDictionary serializedAdditionalRawData) { PreviousState = previousState; Output = output; @@ -90,7 +88,7 @@ internal MediaJobOutputStateChangeEventData() } /// The previous state of the Job. - public MediaJobState PreviousState { get; } + public MediaJobState? PreviousState { get; } /// /// Gets the output. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobProcessingEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobProcessingEventData.Serialization.cs index c3f5eb88e049..8761f70ddbe0 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobProcessingEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobProcessingEventData.Serialization.cs @@ -26,10 +26,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR } writer.WriteStartObject(); - writer.WritePropertyName("previousState"u8); - writer.WriteStringValue(PreviousState.ToString()); - writer.WritePropertyName("state"u8); - writer.WriteStringValue(State.ToString()); + if (Optional.IsDefined(PreviousState)) + { + writer.WritePropertyName("previousState"u8); + writer.WriteStringValue(PreviousState.Value.ToString()); + } + if (Optional.IsDefined(State)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.Value.ToString()); + } writer.WritePropertyName("correlationData"u8); writer.WriteStartObject(); foreach (var item in CorrelationData) @@ -76,8 +82,8 @@ internal static MediaJobProcessingEventData DeserializeMediaJobProcessingEventDa { return null; } - MediaJobState previousState = default; - MediaJobState state = default; + MediaJobState? previousState = default; + MediaJobState? state = default; IReadOnlyDictionary correlationData = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -85,11 +91,19 @@ internal static MediaJobProcessingEventData DeserializeMediaJobProcessingEventDa { if (property.NameEquals("previousState"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } previousState = new MediaJobState(property.Value.GetString()); continue; } if (property.NameEquals("state"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } state = new MediaJobState(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobProcessingEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobProcessingEventData.cs index 1298b135d442..b2dc61de7f29 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobProcessingEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobProcessingEventData.cs @@ -17,11 +17,9 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class MediaJobProcessingEventData : MediaJobStateChangeEventData { /// Initializes a new instance of . - /// The previous state of the Job. - /// The new state of the Job. /// Gets the Job correlation data. /// is null. - internal MediaJobProcessingEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData) : base(previousState, state, correlationData) + internal MediaJobProcessingEventData(IReadOnlyDictionary correlationData) : base(correlationData) { Argument.AssertNotNull(correlationData, nameof(correlationData)); } @@ -31,7 +29,7 @@ internal MediaJobProcessingEventData(MediaJobState previousState, MediaJobState /// The new state of the Job. /// Gets the Job correlation data. /// Keeps track of any properties unknown to the library. - internal MediaJobProcessingEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData, IDictionary serializedAdditionalRawData) : base(previousState, state, correlationData, serializedAdditionalRawData) + internal MediaJobProcessingEventData(MediaJobState? previousState, MediaJobState? state, IReadOnlyDictionary correlationData, IDictionary serializedAdditionalRawData) : base(previousState, state, correlationData, serializedAdditionalRawData) { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobScheduledEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobScheduledEventData.Serialization.cs index 0c3a84cefb6d..cb77a5dda9f7 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobScheduledEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobScheduledEventData.Serialization.cs @@ -26,10 +26,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe } writer.WriteStartObject(); - writer.WritePropertyName("previousState"u8); - writer.WriteStringValue(PreviousState.ToString()); - writer.WritePropertyName("state"u8); - writer.WriteStringValue(State.ToString()); + if (Optional.IsDefined(PreviousState)) + { + writer.WritePropertyName("previousState"u8); + writer.WriteStringValue(PreviousState.Value.ToString()); + } + if (Optional.IsDefined(State)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.Value.ToString()); + } writer.WritePropertyName("correlationData"u8); writer.WriteStartObject(); foreach (var item in CorrelationData) @@ -76,8 +82,8 @@ internal static MediaJobScheduledEventData DeserializeMediaJobScheduledEventData { return null; } - MediaJobState previousState = default; - MediaJobState state = default; + MediaJobState? previousState = default; + MediaJobState? state = default; IReadOnlyDictionary correlationData = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -85,11 +91,19 @@ internal static MediaJobScheduledEventData DeserializeMediaJobScheduledEventData { if (property.NameEquals("previousState"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } previousState = new MediaJobState(property.Value.GetString()); continue; } if (property.NameEquals("state"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } state = new MediaJobState(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobScheduledEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobScheduledEventData.cs index f7f96abda48f..2df6fd8637c0 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobScheduledEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobScheduledEventData.cs @@ -17,11 +17,9 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class MediaJobScheduledEventData : MediaJobStateChangeEventData { /// Initializes a new instance of . - /// The previous state of the Job. - /// The new state of the Job. /// Gets the Job correlation data. /// is null. - internal MediaJobScheduledEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData) : base(previousState, state, correlationData) + internal MediaJobScheduledEventData(IReadOnlyDictionary correlationData) : base(correlationData) { Argument.AssertNotNull(correlationData, nameof(correlationData)); } @@ -31,7 +29,7 @@ internal MediaJobScheduledEventData(MediaJobState previousState, MediaJobState s /// The new state of the Job. /// Gets the Job correlation data. /// Keeps track of any properties unknown to the library. - internal MediaJobScheduledEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData, IDictionary serializedAdditionalRawData) : base(previousState, state, correlationData, serializedAdditionalRawData) + internal MediaJobScheduledEventData(MediaJobState? previousState, MediaJobState? state, IReadOnlyDictionary correlationData, IDictionary serializedAdditionalRawData) : base(previousState, state, correlationData, serializedAdditionalRawData) { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobStateChangeEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobStateChangeEventData.Serialization.cs index e13aa874ba83..469d93d70d6e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobStateChangeEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobStateChangeEventData.Serialization.cs @@ -26,10 +26,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model } writer.WriteStartObject(); - writer.WritePropertyName("previousState"u8); - writer.WriteStringValue(PreviousState.ToString()); - writer.WritePropertyName("state"u8); - writer.WriteStringValue(State.ToString()); + if (Optional.IsDefined(PreviousState)) + { + writer.WritePropertyName("previousState"u8); + writer.WriteStringValue(PreviousState.Value.ToString()); + } + if (Optional.IsDefined(State)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.Value.ToString()); + } writer.WritePropertyName("correlationData"u8); writer.WriteStartObject(); foreach (var item in CorrelationData) @@ -76,8 +82,8 @@ internal static MediaJobStateChangeEventData DeserializeMediaJobStateChangeEvent { return null; } - MediaJobState previousState = default; - MediaJobState state = default; + MediaJobState? previousState = default; + MediaJobState? state = default; IReadOnlyDictionary correlationData = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -85,11 +91,19 @@ internal static MediaJobStateChangeEventData DeserializeMediaJobStateChangeEvent { if (property.NameEquals("previousState"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } previousState = new MediaJobState(property.Value.GetString()); continue; } if (property.NameEquals("state"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } state = new MediaJobState(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobStateChangeEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobStateChangeEventData.cs index ce4898df35b8..33b7707cfa81 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobStateChangeEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaJobStateChangeEventData.cs @@ -49,16 +49,12 @@ public partial class MediaJobStateChangeEventData private protected IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The previous state of the Job. - /// The new state of the Job. /// Gets the Job correlation data. /// is null. - internal MediaJobStateChangeEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData) + internal MediaJobStateChangeEventData(IReadOnlyDictionary correlationData) { Argument.AssertNotNull(correlationData, nameof(correlationData)); - PreviousState = previousState; - State = state; CorrelationData = correlationData; } @@ -67,7 +63,7 @@ internal MediaJobStateChangeEventData(MediaJobState previousState, MediaJobState /// The new state of the Job. /// Gets the Job correlation data. /// Keeps track of any properties unknown to the library. - internal MediaJobStateChangeEventData(MediaJobState previousState, MediaJobState state, IReadOnlyDictionary correlationData, IDictionary serializedAdditionalRawData) + internal MediaJobStateChangeEventData(MediaJobState? previousState, MediaJobState? state, IReadOnlyDictionary correlationData, IDictionary serializedAdditionalRawData) { PreviousState = previousState; State = state; @@ -81,9 +77,9 @@ internal MediaJobStateChangeEventData() } /// The previous state of the Job. - public MediaJobState PreviousState { get; } + public MediaJobState? PreviousState { get; } /// The new state of the Job. - public MediaJobState State { get; } + public MediaJobState? State { get; } /// Gets the Job correlation data. public IReadOnlyDictionary CorrelationData { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsAppIdentifierModel.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsAppIdentifierModel.Serialization.cs index fc2dd3001525..38758c2ee828 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsAppIdentifierModel.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsAppIdentifierModel.Serialization.cs @@ -28,8 +28,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, M writer.WriteStartObject(); writer.WritePropertyName("appId"u8); writer.WriteStringValue(AppId); - writer.WritePropertyName("cloud"u8); - writer.WriteStringValue(Cloud.ToString()); + if (Optional.IsDefined(Cloud)) + { + writer.WritePropertyName("cloud"u8); + writer.WriteStringValue(Cloud.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -69,7 +72,7 @@ internal static MicrosoftTeamsAppIdentifierModel DeserializeMicrosoftTeamsAppIde return null; } string appId = default; - CommunicationCloudEnvironmentModel cloud = default; + CommunicationCloudEnvironmentModel? cloud = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -81,6 +84,10 @@ internal static MicrosoftTeamsAppIdentifierModel DeserializeMicrosoftTeamsAppIde } if (property.NameEquals("cloud"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } cloud = new CommunicationCloudEnvironmentModel(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsAppIdentifierModel.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsAppIdentifierModel.cs index 41e1a566a23f..d53a1651e7ce 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsAppIdentifierModel.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsAppIdentifierModel.cs @@ -47,21 +47,19 @@ public partial class MicrosoftTeamsAppIdentifierModel /// Initializes a new instance of . /// The Id of the Microsoft Teams application. - /// The cloud that the Microsoft Teams application belongs to. By default 'public' if missing. /// is null. - internal MicrosoftTeamsAppIdentifierModel(string appId, CommunicationCloudEnvironmentModel cloud) + internal MicrosoftTeamsAppIdentifierModel(string appId) { Argument.AssertNotNull(appId, nameof(appId)); AppId = appId; - Cloud = cloud; } /// Initializes a new instance of . /// The Id of the Microsoft Teams application. /// The cloud that the Microsoft Teams application belongs to. By default 'public' if missing. /// Keeps track of any properties unknown to the library. - internal MicrosoftTeamsAppIdentifierModel(string appId, CommunicationCloudEnvironmentModel cloud, IDictionary serializedAdditionalRawData) + internal MicrosoftTeamsAppIdentifierModel(string appId, CommunicationCloudEnvironmentModel? cloud, IDictionary serializedAdditionalRawData) { AppId = appId; Cloud = cloud; @@ -76,6 +74,6 @@ internal MicrosoftTeamsAppIdentifierModel() /// The Id of the Microsoft Teams application. public string AppId { get; } /// The cloud that the Microsoft Teams application belongs to. By default 'public' if missing. - public CommunicationCloudEnvironmentModel Cloud { get; } + public CommunicationCloudEnvironmentModel? Cloud { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsUserIdentifierModel.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsUserIdentifierModel.Serialization.cs index 8b21b231c15d..9b3efa1f5ae6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsUserIdentifierModel.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsUserIdentifierModel.Serialization.cs @@ -33,8 +33,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WritePropertyName("isAnonymous"u8); writer.WriteBooleanValue(IsAnonymous.Value); } - writer.WritePropertyName("cloud"u8); - writer.WriteStringValue(Cloud.ToString()); + if (Optional.IsDefined(Cloud)) + { + writer.WritePropertyName("cloud"u8); + writer.WriteStringValue(Cloud.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -75,7 +78,7 @@ internal static MicrosoftTeamsUserIdentifierModel DeserializeMicrosoftTeamsUserI } string userId = default; bool? isAnonymous = default; - CommunicationCloudEnvironmentModel cloud = default; + CommunicationCloudEnvironmentModel? cloud = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -96,6 +99,10 @@ internal static MicrosoftTeamsUserIdentifierModel DeserializeMicrosoftTeamsUserI } if (property.NameEquals("cloud"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } cloud = new CommunicationCloudEnvironmentModel(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsUserIdentifierModel.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsUserIdentifierModel.cs index d8958e4d8035..1678ab0098cf 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsUserIdentifierModel.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MicrosoftTeamsUserIdentifierModel.cs @@ -47,14 +47,12 @@ public partial class MicrosoftTeamsUserIdentifierModel /// Initializes a new instance of . /// The Id of the Microsoft Teams user. If not anonymous, this is the AAD object Id of the user. - /// The cloud that the Microsoft Teams user belongs to. By default 'public' if missing. /// is null. - internal MicrosoftTeamsUserIdentifierModel(string userId, CommunicationCloudEnvironmentModel cloud) + internal MicrosoftTeamsUserIdentifierModel(string userId) { Argument.AssertNotNull(userId, nameof(userId)); UserId = userId; - Cloud = cloud; } /// Initializes a new instance of . @@ -62,7 +60,7 @@ internal MicrosoftTeamsUserIdentifierModel(string userId, CommunicationCloudEnvi /// True if the Microsoft Teams user is anonymous. By default false if missing. /// The cloud that the Microsoft Teams user belongs to. By default 'public' if missing. /// Keeps track of any properties unknown to the library. - internal MicrosoftTeamsUserIdentifierModel(string userId, bool? isAnonymous, CommunicationCloudEnvironmentModel cloud, IDictionary serializedAdditionalRawData) + internal MicrosoftTeamsUserIdentifierModel(string userId, bool? isAnonymous, CommunicationCloudEnvironmentModel? cloud, IDictionary serializedAdditionalRawData) { UserId = userId; IsAnonymous = isAnonymous; @@ -80,6 +78,6 @@ internal MicrosoftTeamsUserIdentifierModel() /// True if the Microsoft Teams user is anonymous. By default false if missing. public bool? IsAnonymous { get; } /// The cloud that the Microsoft Teams user belongs to. By default 'public' if missing. - public CommunicationCloudEnvironmentModel Cloud { get; } + public CommunicationCloudEnvironmentModel? Cloud { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateChangedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateChangedEventData.Serialization.cs index 3539e8cedfe1..613f1feeb145 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateChangedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateChangedEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter } writer.WriteStartObject(); - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } if (Optional.IsDefined(PolicyAssignmentId)) { writer.WritePropertyName("policyAssignmentId"u8); @@ -96,7 +99,7 @@ internal static PolicyInsightsPolicyStateChangedEventData DeserializePolicyInsig { return null; } - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string policyAssignmentId = default; string policyDefinitionId = default; string policyDefinitionReferenceId = default; @@ -109,6 +112,10 @@ internal static PolicyInsightsPolicyStateChangedEventData DeserializePolicyInsig { if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateChangedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateChangedEventData.cs index 3c38df1b64d7..a8f8d505974e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateChangedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateChangedEventData.cs @@ -46,10 +46,8 @@ public partial class PolicyInsightsPolicyStateChangedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time that the resource was scanned by Azure Policy in the Universal ISO 8601 DateTime format yyyy-MM-ddTHH:mm:ss.fffffffZ. - internal PolicyInsightsPolicyStateChangedEventData(DateTimeOffset timestamp) + internal PolicyInsightsPolicyStateChangedEventData() { - Timestamp = timestamp; } /// Initializes a new instance of . @@ -61,7 +59,7 @@ internal PolicyInsightsPolicyStateChangedEventData(DateTimeOffset timestamp) /// The subscription ID of the resource. /// The compliance reason code. May be empty. /// Keeps track of any properties unknown to the library. - internal PolicyInsightsPolicyStateChangedEventData(DateTimeOffset timestamp, string policyAssignmentId, string policyDefinitionId, string policyDefinitionReferenceId, string complianceState, string subscriptionId, string complianceReasonCode, IDictionary serializedAdditionalRawData) + internal PolicyInsightsPolicyStateChangedEventData(DateTimeOffset? timestamp, string policyAssignmentId, string policyDefinitionId, string policyDefinitionReferenceId, string complianceState, string subscriptionId, string complianceReasonCode, IDictionary serializedAdditionalRawData) { Timestamp = timestamp; PolicyAssignmentId = policyAssignmentId; @@ -73,13 +71,8 @@ internal PolicyInsightsPolicyStateChangedEventData(DateTimeOffset timestamp, str _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal PolicyInsightsPolicyStateChangedEventData() - { - } - /// The time that the resource was scanned by Azure Policy in the Universal ISO 8601 DateTime format yyyy-MM-ddTHH:mm:ss.fffffffZ. - public DateTimeOffset Timestamp { get; } + public DateTimeOffset? Timestamp { get; } /// The resource ID of the policy assignment. public string PolicyAssignmentId { get; } /// The resource ID of the policy definition. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateCreatedEventData.Serialization.cs index 48370340ade1..c51e319aa8d9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateCreatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateCreatedEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter } writer.WriteStartObject(); - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } if (Optional.IsDefined(PolicyAssignmentId)) { writer.WritePropertyName("policyAssignmentId"u8); @@ -96,7 +99,7 @@ internal static PolicyInsightsPolicyStateCreatedEventData DeserializePolicyInsig { return null; } - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string policyAssignmentId = default; string policyDefinitionId = default; string policyDefinitionReferenceId = default; @@ -109,6 +112,10 @@ internal static PolicyInsightsPolicyStateCreatedEventData DeserializePolicyInsig { if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateCreatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateCreatedEventData.cs index deb18f455881..44791f5f3ca6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateCreatedEventData.cs @@ -46,10 +46,8 @@ public partial class PolicyInsightsPolicyStateCreatedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time that the resource was scanned by Azure Policy in the Universal ISO 8601 DateTime format yyyy-MM-ddTHH:mm:ss.fffffffZ. - internal PolicyInsightsPolicyStateCreatedEventData(DateTimeOffset timestamp) + internal PolicyInsightsPolicyStateCreatedEventData() { - Timestamp = timestamp; } /// Initializes a new instance of . @@ -61,7 +59,7 @@ internal PolicyInsightsPolicyStateCreatedEventData(DateTimeOffset timestamp) /// The subscription ID of the resource. /// The compliance reason code. May be empty. /// Keeps track of any properties unknown to the library. - internal PolicyInsightsPolicyStateCreatedEventData(DateTimeOffset timestamp, string policyAssignmentId, string policyDefinitionId, string policyDefinitionReferenceId, string complianceState, string subscriptionId, string complianceReasonCode, IDictionary serializedAdditionalRawData) + internal PolicyInsightsPolicyStateCreatedEventData(DateTimeOffset? timestamp, string policyAssignmentId, string policyDefinitionId, string policyDefinitionReferenceId, string complianceState, string subscriptionId, string complianceReasonCode, IDictionary serializedAdditionalRawData) { Timestamp = timestamp; PolicyAssignmentId = policyAssignmentId; @@ -73,13 +71,8 @@ internal PolicyInsightsPolicyStateCreatedEventData(DateTimeOffset timestamp, str _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal PolicyInsightsPolicyStateCreatedEventData() - { - } - /// The time that the resource was scanned by Azure Policy in the Universal ISO 8601 DateTime format yyyy-MM-ddTHH:mm:ss.fffffffZ. - public DateTimeOffset Timestamp { get; } + public DateTimeOffset? Timestamp { get; } /// The resource ID of the policy assignment. public string PolicyAssignmentId { get; } /// The resource ID of the policy definition. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateDeletedEventData.Serialization.cs index 58921be05ccf..eecbf20cbeb5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateDeletedEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter } writer.WriteStartObject(); - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } if (Optional.IsDefined(PolicyAssignmentId)) { writer.WritePropertyName("policyAssignmentId"u8); @@ -96,7 +99,7 @@ internal static PolicyInsightsPolicyStateDeletedEventData DeserializePolicyInsig { return null; } - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string policyAssignmentId = default; string policyDefinitionId = default; string policyDefinitionReferenceId = default; @@ -109,6 +112,10 @@ internal static PolicyInsightsPolicyStateDeletedEventData DeserializePolicyInsig { if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateDeletedEventData.cs index 412c1ba32b64..3a92458d4c13 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/PolicyInsightsPolicyStateDeletedEventData.cs @@ -46,10 +46,8 @@ public partial class PolicyInsightsPolicyStateDeletedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time that the resource was scanned by Azure Policy in the Universal ISO 8601 DateTime format yyyy-MM-ddTHH:mm:ss.fffffffZ. - internal PolicyInsightsPolicyStateDeletedEventData(DateTimeOffset timestamp) + internal PolicyInsightsPolicyStateDeletedEventData() { - Timestamp = timestamp; } /// Initializes a new instance of . @@ -61,7 +59,7 @@ internal PolicyInsightsPolicyStateDeletedEventData(DateTimeOffset timestamp) /// The subscription ID of the resource. /// The compliance reason code. May be empty. /// Keeps track of any properties unknown to the library. - internal PolicyInsightsPolicyStateDeletedEventData(DateTimeOffset timestamp, string policyAssignmentId, string policyDefinitionId, string policyDefinitionReferenceId, string complianceState, string subscriptionId, string complianceReasonCode, IDictionary serializedAdditionalRawData) + internal PolicyInsightsPolicyStateDeletedEventData(DateTimeOffset? timestamp, string policyAssignmentId, string policyDefinitionId, string policyDefinitionReferenceId, string complianceState, string subscriptionId, string complianceReasonCode, IDictionary serializedAdditionalRawData) { Timestamp = timestamp; PolicyAssignmentId = policyAssignmentId; @@ -73,13 +71,8 @@ internal PolicyInsightsPolicyStateDeletedEventData(DateTimeOffset timestamp, str _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal PolicyInsightsPolicyStateDeletedEventData() - { - } - /// The time that the resource was scanned by Azure Policy in the Universal ISO 8601 DateTime format yyyy-MM-ddTHH:mm:ss.fffffffZ. - public DateTimeOffset Timestamp { get; } + public DateTimeOffset? Timestamp { get; } /// The resource ID of the policy assignment. public string PolicyAssignmentId { get; } /// The resource ID of the policy definition. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisExportRDBCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisExportRdbCompletedEventData.Serialization.cs similarity index 72% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisExportRDBCompletedEventData.Serialization.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisExportRdbCompletedEventData.Serialization.cs index b2243abe55f5..fd70df1bee84 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisExportRDBCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisExportRdbCompletedEventData.Serialization.cs @@ -13,21 +13,24 @@ namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class RedisExportRDBCompletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class RedisExportRdbCompletedEventData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(RedisExportRDBCompletedEventData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(RedisExportRdbCompletedEventData)} does not support writing '{format}' format."); } writer.WriteStartObject(); - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -56,19 +59,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, M writer.WriteEndObject(); } - RedisExportRDBCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + RedisExportRdbCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(RedisExportRDBCompletedEventData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(RedisExportRdbCompletedEventData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRedisExportRDBCompletedEventData(document.RootElement, options); + return DeserializeRedisExportRdbCompletedEventData(document.RootElement, options); } - internal static RedisExportRDBCompletedEventData DeserializeRedisExportRDBCompletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + internal static RedisExportRdbCompletedEventData DeserializeRedisExportRdbCompletedEventData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -76,7 +79,7 @@ internal static RedisExportRDBCompletedEventData DeserializeRedisExportRDBComple { return null; } - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string name = default; string status = default; IDictionary serializedAdditionalRawData = default; @@ -85,6 +88,10 @@ internal static RedisExportRDBCompletedEventData DeserializeRedisExportRDBComple { if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } @@ -104,46 +111,46 @@ internal static RedisExportRDBCompletedEventData DeserializeRedisExportRDBComple } } serializedAdditionalRawData = rawDataDictionary; - return new RedisExportRDBCompletedEventData(timestamp, name, status, serializedAdditionalRawData); + return new RedisExportRdbCompletedEventData(timestamp, name, status, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(RedisExportRDBCompletedEventData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(RedisExportRdbCompletedEventData)} does not support writing '{options.Format}' format."); } } - RedisExportRDBCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + RedisExportRdbCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeRedisExportRDBCompletedEventData(document.RootElement, options); + return DeserializeRedisExportRdbCompletedEventData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(RedisExportRDBCompletedEventData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(RedisExportRdbCompletedEventData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static RedisExportRDBCompletedEventData FromResponse(Response response) + internal static RedisExportRdbCompletedEventData FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeRedisExportRDBCompletedEventData(document.RootElement); + return DeserializeRedisExportRdbCompletedEventData(document.RootElement); } /// Convert into a . diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisExportRDBCompletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisExportRdbCompletedEventData.cs similarity index 78% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisExportRDBCompletedEventData.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisExportRdbCompletedEventData.cs index 4d02e07eeb4c..f689ff3f1242 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisExportRDBCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisExportRdbCompletedEventData.cs @@ -11,7 +11,7 @@ namespace Azure.Messaging.EventGrid.SystemEvents { /// Schema of the Data property of an EventGridEvent for a Microsoft.Cache.ExportRDBCompleted event. - public partial class RedisExportRDBCompletedEventData + public partial class RedisExportRdbCompletedEventData { /// /// Keeps track of any properties unknown to the library. @@ -45,19 +45,17 @@ public partial class RedisExportRDBCompletedEventData /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The time at which the event occurred. - internal RedisExportRDBCompletedEventData(DateTimeOffset timestamp) + /// Initializes a new instance of . + internal RedisExportRdbCompletedEventData() { - Timestamp = timestamp; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The time at which the event occurred. /// The name of this event. /// The status of this event. Failed or succeeded. /// Keeps track of any properties unknown to the library. - internal RedisExportRDBCompletedEventData(DateTimeOffset timestamp, string name, string status, IDictionary serializedAdditionalRawData) + internal RedisExportRdbCompletedEventData(DateTimeOffset? timestamp, string name, string status, IDictionary serializedAdditionalRawData) { Timestamp = timestamp; Name = name; @@ -65,13 +63,8 @@ internal RedisExportRDBCompletedEventData(DateTimeOffset timestamp, string name, _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal RedisExportRDBCompletedEventData() - { - } - /// The time at which the event occurred. - public DateTimeOffset Timestamp { get; } + public DateTimeOffset? Timestamp { get; } /// The name of this event. public string Name { get; } /// The status of this event. Failed or succeeded. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisImportRDBCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisImportRdbCompletedEventData.Serialization.cs similarity index 72% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisImportRDBCompletedEventData.Serialization.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisImportRdbCompletedEventData.Serialization.cs index f3c4f99cb3da..00554d2343fc 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisImportRDBCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisImportRdbCompletedEventData.Serialization.cs @@ -13,21 +13,24 @@ namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class RedisImportRDBCompletedEventData : IUtf8JsonSerializable, IJsonModel + public partial class RedisImportRdbCompletedEventData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(RedisImportRDBCompletedEventData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(RedisImportRdbCompletedEventData)} does not support writing '{format}' format."); } writer.WriteStartObject(); - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -56,19 +59,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, M writer.WriteEndObject(); } - RedisImportRDBCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + RedisImportRdbCompletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(RedisImportRDBCompletedEventData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(RedisImportRdbCompletedEventData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRedisImportRDBCompletedEventData(document.RootElement, options); + return DeserializeRedisImportRdbCompletedEventData(document.RootElement, options); } - internal static RedisImportRDBCompletedEventData DeserializeRedisImportRDBCompletedEventData(JsonElement element, ModelReaderWriterOptions options = null) + internal static RedisImportRdbCompletedEventData DeserializeRedisImportRdbCompletedEventData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -76,7 +79,7 @@ internal static RedisImportRDBCompletedEventData DeserializeRedisImportRDBComple { return null; } - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string name = default; string status = default; IDictionary serializedAdditionalRawData = default; @@ -85,6 +88,10 @@ internal static RedisImportRDBCompletedEventData DeserializeRedisImportRDBComple { if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } @@ -104,46 +111,46 @@ internal static RedisImportRDBCompletedEventData DeserializeRedisImportRDBComple } } serializedAdditionalRawData = rawDataDictionary; - return new RedisImportRDBCompletedEventData(timestamp, name, status, serializedAdditionalRawData); + return new RedisImportRdbCompletedEventData(timestamp, name, status, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(RedisImportRDBCompletedEventData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(RedisImportRdbCompletedEventData)} does not support writing '{options.Format}' format."); } } - RedisImportRDBCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + RedisImportRdbCompletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeRedisImportRDBCompletedEventData(document.RootElement, options); + return DeserializeRedisImportRdbCompletedEventData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(RedisImportRDBCompletedEventData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(RedisImportRdbCompletedEventData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static RedisImportRDBCompletedEventData FromResponse(Response response) + internal static RedisImportRdbCompletedEventData FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content); - return DeserializeRedisImportRDBCompletedEventData(document.RootElement); + return DeserializeRedisImportRdbCompletedEventData(document.RootElement); } /// Convert into a . diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisImportRDBCompletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisImportRdbCompletedEventData.cs similarity index 78% rename from sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisImportRDBCompletedEventData.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisImportRdbCompletedEventData.cs index 58ca83a77ce3..7381f6f760ab 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisImportRDBCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisImportRdbCompletedEventData.cs @@ -11,7 +11,7 @@ namespace Azure.Messaging.EventGrid.SystemEvents { /// Schema of the Data property of an EventGridEvent for a Microsoft.Cache.ImportRDBCompleted event. - public partial class RedisImportRDBCompletedEventData + public partial class RedisImportRdbCompletedEventData { /// /// Keeps track of any properties unknown to the library. @@ -45,19 +45,17 @@ public partial class RedisImportRDBCompletedEventData /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The time at which the event occurred. - internal RedisImportRDBCompletedEventData(DateTimeOffset timestamp) + /// Initializes a new instance of . + internal RedisImportRdbCompletedEventData() { - Timestamp = timestamp; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The time at which the event occurred. /// The name of this event. /// The status of this event. Failed or succeeded. /// Keeps track of any properties unknown to the library. - internal RedisImportRDBCompletedEventData(DateTimeOffset timestamp, string name, string status, IDictionary serializedAdditionalRawData) + internal RedisImportRdbCompletedEventData(DateTimeOffset? timestamp, string name, string status, IDictionary serializedAdditionalRawData) { Timestamp = timestamp; Name = name; @@ -65,13 +63,8 @@ internal RedisImportRDBCompletedEventData(DateTimeOffset timestamp, string name, _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal RedisImportRDBCompletedEventData() - { - } - /// The time at which the event occurred. - public DateTimeOffset Timestamp { get; } + public DateTimeOffset? Timestamp { get; } /// The name of this event. public string Name { get; } /// The status of this event. Failed or succeeded. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisPatchingCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisPatchingCompletedEventData.Serialization.cs index e7bba1d4def5..039cdd1ab010 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisPatchingCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisPatchingCompletedEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo } writer.WriteStartObject(); - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -76,7 +79,7 @@ internal static RedisPatchingCompletedEventData DeserializeRedisPatchingComplete { return null; } - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string name = default; string status = default; IDictionary serializedAdditionalRawData = default; @@ -85,6 +88,10 @@ internal static RedisPatchingCompletedEventData DeserializeRedisPatchingComplete { if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisPatchingCompletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisPatchingCompletedEventData.cs index 0497287ee8e2..3cc0aee40d81 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisPatchingCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisPatchingCompletedEventData.cs @@ -46,10 +46,8 @@ public partial class RedisPatchingCompletedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time at which the event occurred. - internal RedisPatchingCompletedEventData(DateTimeOffset timestamp) + internal RedisPatchingCompletedEventData() { - Timestamp = timestamp; } /// Initializes a new instance of . @@ -57,7 +55,7 @@ internal RedisPatchingCompletedEventData(DateTimeOffset timestamp) /// The name of this event. /// The status of this event. Failed or succeeded. /// Keeps track of any properties unknown to the library. - internal RedisPatchingCompletedEventData(DateTimeOffset timestamp, string name, string status, IDictionary serializedAdditionalRawData) + internal RedisPatchingCompletedEventData(DateTimeOffset? timestamp, string name, string status, IDictionary serializedAdditionalRawData) { Timestamp = timestamp; Name = name; @@ -65,13 +63,8 @@ internal RedisPatchingCompletedEventData(DateTimeOffset timestamp, string name, _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal RedisPatchingCompletedEventData() - { - } - /// The time at which the event occurred. - public DateTimeOffset Timestamp { get; } + public DateTimeOffset? Timestamp { get; } /// The name of this event. public string Name { get; } /// The status of this event. Failed or succeeded. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisScalingCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisScalingCompletedEventData.Serialization.cs index 6513d5f6b531..73501bd4e56f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisScalingCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisScalingCompletedEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod } writer.WriteStartObject(); - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -76,7 +79,7 @@ internal static RedisScalingCompletedEventData DeserializeRedisScalingCompletedE { return null; } - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string name = default; string status = default; IDictionary serializedAdditionalRawData = default; @@ -85,6 +88,10 @@ internal static RedisScalingCompletedEventData DeserializeRedisScalingCompletedE { if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisScalingCompletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisScalingCompletedEventData.cs index 0d7b4896c816..ac341ec49072 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisScalingCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/RedisScalingCompletedEventData.cs @@ -46,10 +46,8 @@ public partial class RedisScalingCompletedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time at which the event occurred. - internal RedisScalingCompletedEventData(DateTimeOffset timestamp) + internal RedisScalingCompletedEventData() { - Timestamp = timestamp; } /// Initializes a new instance of . @@ -57,7 +55,7 @@ internal RedisScalingCompletedEventData(DateTimeOffset timestamp) /// The name of this event. /// The status of this event. Failed or succeeded. /// Keeps track of any properties unknown to the library. - internal RedisScalingCompletedEventData(DateTimeOffset timestamp, string name, string status, IDictionary serializedAdditionalRawData) + internal RedisScalingCompletedEventData(DateTimeOffset? timestamp, string name, string status, IDictionary serializedAdditionalRawData) { Timestamp = timestamp; Name = name; @@ -65,13 +63,8 @@ internal RedisScalingCompletedEventData(DateTimeOffset timestamp, string name, s _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal RedisScalingCompletedEventData() - { - } - /// The time at which the event occurred. - public DateTimeOffset Timestamp { get; } + public DateTimeOffset? Timestamp { get; } /// The name of this event. public string Name { get; } /// The status of this event. Failed or succeeded. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsOperationalDetails.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsOperationalDetails.Serialization.cs index c5a191210bcc..33f0c3f896f8 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsOperationalDetails.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsOperationalDetails.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter wr } writer.WriteStartObject(); - writer.WritePropertyName("resourceEventTime"u8); - writer.WriteStringValue(ResourceEventTime, "O"); + if (Optional.IsDefined(ResourceEventTime)) + { + writer.WritePropertyName("resourceEventTime"u8); + writer.WriteStringValue(ResourceEventTime.Value, "O"); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -66,13 +69,17 @@ internal static ResourceNotificationsOperationalDetails DeserializeResourceNotif { return null; } - DateTimeOffset resourceEventTime = default; + DateTimeOffset? resourceEventTime = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("resourceEventTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } resourceEventTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsOperationalDetails.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsOperationalDetails.cs index a55f436fa035..d9354209fe26 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsOperationalDetails.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/ResourceNotificationsOperationalDetails.cs @@ -46,27 +46,20 @@ public partial class ResourceNotificationsOperationalDetails private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// Date and Time when resource was updated. - internal ResourceNotificationsOperationalDetails(DateTimeOffset resourceEventTime) + internal ResourceNotificationsOperationalDetails() { - ResourceEventTime = resourceEventTime; } /// Initializes a new instance of . /// Date and Time when resource was updated. /// Keeps track of any properties unknown to the library. - internal ResourceNotificationsOperationalDetails(DateTimeOffset resourceEventTime, IDictionary serializedAdditionalRawData) + internal ResourceNotificationsOperationalDetails(DateTimeOffset? resourceEventTime, IDictionary serializedAdditionalRawData) { ResourceEventTime = resourceEventTime; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ResourceNotificationsOperationalDetails() - { - } - /// Date and Time when resource was updated. - public DateTimeOffset ResourceEventTime { get; } + public DateTimeOffset? ResourceEventTime { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionConnectedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionConnectedEventData.Serialization.cs index ea1c86e92527..d069576b3f1d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionConnectedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionConnectedEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8Json } writer.WriteStartObject(); - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } if (Optional.IsDefined(HubName)) { writer.WritePropertyName("hubName"u8); @@ -81,7 +84,7 @@ internal static SignalRServiceClientConnectionConnectedEventData DeserializeSign { return null; } - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string hubName = default; string connectionId = default; string userId = default; @@ -91,6 +94,10 @@ internal static SignalRServiceClientConnectionConnectedEventData DeserializeSign { if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionConnectedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionConnectedEventData.cs index dcb093dd889d..69adb05a2aa6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionConnectedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionConnectedEventData.cs @@ -46,10 +46,8 @@ public partial class SignalRServiceClientConnectionConnectedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time at which the event occurred. - internal SignalRServiceClientConnectionConnectedEventData(DateTimeOffset timestamp) + internal SignalRServiceClientConnectionConnectedEventData() { - Timestamp = timestamp; } /// Initializes a new instance of . @@ -58,7 +56,7 @@ internal SignalRServiceClientConnectionConnectedEventData(DateTimeOffset timesta /// The connection Id of connected client connection. /// The user Id of connected client connection. /// Keeps track of any properties unknown to the library. - internal SignalRServiceClientConnectionConnectedEventData(DateTimeOffset timestamp, string hubName, string connectionId, string userId, IDictionary serializedAdditionalRawData) + internal SignalRServiceClientConnectionConnectedEventData(DateTimeOffset? timestamp, string hubName, string connectionId, string userId, IDictionary serializedAdditionalRawData) { Timestamp = timestamp; HubName = hubName; @@ -67,13 +65,8 @@ internal SignalRServiceClientConnectionConnectedEventData(DateTimeOffset timesta _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal SignalRServiceClientConnectionConnectedEventData() - { - } - /// The time at which the event occurred. - public DateTimeOffset Timestamp { get; } + public DateTimeOffset? Timestamp { get; } /// The hub of connected client connection. public string HubName { get; } /// The connection Id of connected client connection. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionDisconnectedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionDisconnectedEventData.Serialization.cs index 711be138fa62..2de3b5e4744f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionDisconnectedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionDisconnectedEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8J } writer.WriteStartObject(); - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp, "O"); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } if (Optional.IsDefined(HubName)) { writer.WritePropertyName("hubName"u8); @@ -86,7 +89,7 @@ internal static SignalRServiceClientConnectionDisconnectedEventData DeserializeS { return null; } - DateTimeOffset timestamp = default; + DateTimeOffset? timestamp = default; string hubName = default; string connectionId = default; string userId = default; @@ -97,6 +100,10 @@ internal static SignalRServiceClientConnectionDisconnectedEventData DeserializeS { if (property.NameEquals("timestamp"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionDisconnectedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionDisconnectedEventData.cs index 6a0f3883fc81..89f6d8099f73 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionDisconnectedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SignalRServiceClientConnectionDisconnectedEventData.cs @@ -46,10 +46,8 @@ public partial class SignalRServiceClientConnectionDisconnectedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time at which the event occurred. - internal SignalRServiceClientConnectionDisconnectedEventData(DateTimeOffset timestamp) + internal SignalRServiceClientConnectionDisconnectedEventData() { - Timestamp = timestamp; } /// Initializes a new instance of . @@ -59,7 +57,7 @@ internal SignalRServiceClientConnectionDisconnectedEventData(DateTimeOffset time /// The user Id of connected client connection. /// The message of error that cause the client connection disconnected. /// Keeps track of any properties unknown to the library. - internal SignalRServiceClientConnectionDisconnectedEventData(DateTimeOffset timestamp, string hubName, string connectionId, string userId, string errorMessage, IDictionary serializedAdditionalRawData) + internal SignalRServiceClientConnectionDisconnectedEventData(DateTimeOffset? timestamp, string hubName, string connectionId, string userId, string errorMessage, IDictionary serializedAdditionalRawData) { Timestamp = timestamp; HubName = hubName; @@ -69,13 +67,8 @@ internal SignalRServiceClientConnectionDisconnectedEventData(DateTimeOffset time _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal SignalRServiceClientConnectionDisconnectedEventData() - { - } - /// The time at which the event occurred. - public DateTimeOffset Timestamp { get; } + public DateTimeOffset? Timestamp { get; } /// The hub of connected client connection. public string HubName { get; } /// The connection Id of connected client connection. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobAccessTier.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobAccessTier.cs new file mode 100644 index 000000000000..b5072eac433a --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobAccessTier.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// The access tier of the blob. + public readonly partial struct StorageBlobAccessTier : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public StorageBlobAccessTier(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string HotValue = "Hot"; + private const string CoolValue = "Cool"; + private const string ColdValue = "Cold"; + private const string ArchiveValue = "Archive"; + private const string DefaultValue = "Default"; + + /// The blob is in access tier Hot. + public static StorageBlobAccessTier Hot { get; } = new StorageBlobAccessTier(HotValue); + /// The blob is in access tier Cool. + public static StorageBlobAccessTier Cool { get; } = new StorageBlobAccessTier(CoolValue); + /// The blob is in access tier Cold. + public static StorageBlobAccessTier Cold { get; } = new StorageBlobAccessTier(ColdValue); + /// The blob is in access tier Archive. + public static StorageBlobAccessTier Archive { get; } = new StorageBlobAccessTier(ArchiveValue); + /// The blob is in access tier Default(Inferred). + public static StorageBlobAccessTier Default { get; } = new StorageBlobAccessTier(DefaultValue); + /// Determines if two values are the same. + public static bool operator ==(StorageBlobAccessTier left, StorageBlobAccessTier right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(StorageBlobAccessTier left, StorageBlobAccessTier right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator StorageBlobAccessTier(string value) => new StorageBlobAccessTier(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is StorageBlobAccessTier other && Equals(other); + /// + public bool Equals(StorageBlobAccessTier other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobCreatedEventData.Serialization.cs index f1f9c1763628..d828cafd1d34 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobCreatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobCreatedEventData.Serialization.cs @@ -66,6 +66,8 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WritePropertyName("blobType"u8); writer.WriteStringValue(BlobType); } + writer.WritePropertyName("accessTier"u8); + writer.WriteStringValue(AccessTier.ToString()); if (Optional.IsDefined(Url)) { writer.WritePropertyName("url"u8); @@ -147,6 +149,7 @@ internal static StorageBlobCreatedEventData DeserializeStorageBlobCreatedEventDa long? contentLength = default; long? contentOffset = default; string blobType = default; + StorageBlobAccessTier accessTier = default; string url = default; string sequencer = default; string identity = default; @@ -203,6 +206,11 @@ internal static StorageBlobCreatedEventData DeserializeStorageBlobCreatedEventDa blobType = property.Value.GetString(); continue; } + if (property.NameEquals("accessTier"u8)) + { + accessTier = new StorageBlobAccessTier(property.Value.GetString()); + continue; + } if (property.NameEquals("url"u8)) { url = property.Value.GetString(); @@ -250,6 +258,7 @@ internal static StorageBlobCreatedEventData DeserializeStorageBlobCreatedEventDa contentLength, contentOffset, blobType, + accessTier, url, sequencer, identity, diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobCreatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobCreatedEventData.cs index a1799eea345a..5b97c6b1bddc 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobCreatedEventData.cs @@ -46,12 +46,14 @@ public partial class StorageBlobCreatedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . + /// The current tier of the blob. /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. /// is null. - internal StorageBlobCreatedEventData(IReadOnlyDictionary storageDiagnostics) + internal StorageBlobCreatedEventData(StorageBlobAccessTier accessTier, IReadOnlyDictionary storageDiagnostics) { Argument.AssertNotNull(storageDiagnostics, nameof(storageDiagnostics)); + AccessTier = accessTier; StorageDiagnostics = storageDiagnostics; } @@ -64,12 +66,13 @@ internal StorageBlobCreatedEventData(IReadOnlyDictionary sto /// The size of the blob in bytes. This is the same as what would be returned in the Content-Length header from the blob. /// The offset of the blob in bytes. /// The type of blob. + /// The current tier of the blob. /// The path to the blob. /// An opaque string value representing the logical sequence of events for any particular blob name. Users can use standard string comparison to understand the relative sequence of two events on the same blob name. /// The identity of the requester that triggered this event. /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. /// Keeps track of any properties unknown to the library. - internal StorageBlobCreatedEventData(string api, string clientRequestId, string requestId, string eTag, string contentType, long? contentLength, long? contentOffset, string blobType, string url, string sequencer, string identity, IReadOnlyDictionary storageDiagnostics, IDictionary serializedAdditionalRawData) + internal StorageBlobCreatedEventData(string api, string clientRequestId, string requestId, string eTag, string contentType, long? contentLength, long? contentOffset, string blobType, StorageBlobAccessTier accessTier, string url, string sequencer, string identity, IReadOnlyDictionary storageDiagnostics, IDictionary serializedAdditionalRawData) { Api = api; ClientRequestId = clientRequestId; @@ -79,6 +82,7 @@ internal StorageBlobCreatedEventData(string api, string clientRequestId, string ContentLength = contentLength; ContentOffset = contentOffset; BlobType = blobType; + AccessTier = accessTier; Url = url; Sequencer = sequencer; Identity = identity; @@ -107,6 +111,8 @@ internal StorageBlobCreatedEventData() public long? ContentOffset { get; } /// The type of blob. public string BlobType { get; } + /// The current tier of the blob. + public StorageBlobAccessTier AccessTier { get; } /// The path to the blob. public string Url { get; } /// An opaque string value representing the logical sequence of events for any particular blob name. Users can use standard string comparison to understand the relative sequence of two events on the same blob name. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobInventoryPolicyCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobInventoryPolicyCompletedEventData.Serialization.cs index a9115170710f..03c678a53fb9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobInventoryPolicyCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobInventoryPolicyCompletedEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWrit } writer.WriteStartObject(); - writer.WritePropertyName("scheduleDateTime"u8); - writer.WriteStringValue(ScheduleDateTime, "O"); + if (Optional.IsDefined(ScheduleDateTime)) + { + writer.WritePropertyName("scheduleDateTime"u8); + writer.WriteStringValue(ScheduleDateTime.Value, "O"); + } if (Optional.IsDefined(AccountName)) { writer.WritePropertyName("accountName"u8); @@ -96,7 +99,7 @@ internal static StorageBlobInventoryPolicyCompletedEventData DeserializeStorageB { return null; } - DateTimeOffset scheduleDateTime = default; + DateTimeOffset? scheduleDateTime = default; string accountName = default; string ruleName = default; string policyRunStatus = default; @@ -109,6 +112,10 @@ internal static StorageBlobInventoryPolicyCompletedEventData DeserializeStorageB { if (property.NameEquals("scheduleDateTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } scheduleDateTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobInventoryPolicyCompletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobInventoryPolicyCompletedEventData.cs index 97097e7a9b6f..a4eabe105daf 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobInventoryPolicyCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobInventoryPolicyCompletedEventData.cs @@ -46,10 +46,8 @@ public partial class StorageBlobInventoryPolicyCompletedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time at which inventory policy was scheduled. - internal StorageBlobInventoryPolicyCompletedEventData(DateTimeOffset scheduleDateTime) + internal StorageBlobInventoryPolicyCompletedEventData() { - ScheduleDateTime = scheduleDateTime; } /// Initializes a new instance of . @@ -61,7 +59,7 @@ internal StorageBlobInventoryPolicyCompletedEventData(DateTimeOffset scheduleDat /// The policy run id for inventory run. /// The blob URL for manifest file for inventory run. /// Keeps track of any properties unknown to the library. - internal StorageBlobInventoryPolicyCompletedEventData(DateTimeOffset scheduleDateTime, string accountName, string ruleName, string policyRunStatus, string policyRunStatusMessage, string policyRunId, string manifestBlobUrl, IDictionary serializedAdditionalRawData) + internal StorageBlobInventoryPolicyCompletedEventData(DateTimeOffset? scheduleDateTime, string accountName, string ruleName, string policyRunStatus, string policyRunStatusMessage, string policyRunId, string manifestBlobUrl, IDictionary serializedAdditionalRawData) { ScheduleDateTime = scheduleDateTime; AccountName = accountName; @@ -73,13 +71,8 @@ internal StorageBlobInventoryPolicyCompletedEventData(DateTimeOffset scheduleDat _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal StorageBlobInventoryPolicyCompletedEventData() - { - } - /// The time at which inventory policy was scheduled. - public DateTimeOffset ScheduleDateTime { get; } + public DateTimeOffset? ScheduleDateTime { get; } /// The account name for which inventory policy is registered. public string AccountName { get; } /// The rule name for inventory policy. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobTierChangedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobTierChangedEventData.Serialization.cs index 596e8462a99b..8e0b0cba9a2f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobTierChangedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobTierChangedEventData.Serialization.cs @@ -56,6 +56,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo writer.WritePropertyName("blobType"u8); writer.WriteStringValue(BlobType); } + writer.WritePropertyName("accessTier"u8); + writer.WriteStringValue(AccessTier.ToString()); + writer.WritePropertyName("previousTier"u8); + writer.WriteStringValue(PreviousTier.ToString()); if (Optional.IsDefined(Url)) { writer.WritePropertyName("url"u8); @@ -135,6 +139,8 @@ internal static StorageBlobTierChangedEventData DeserializeStorageBlobTierChange string contentType = default; long? contentLength = default; string blobType = default; + StorageBlobAccessTier accessTier = default; + StorageBlobAccessTier previousTier = default; string url = default; string sequencer = default; string identity = default; @@ -177,6 +183,16 @@ internal static StorageBlobTierChangedEventData DeserializeStorageBlobTierChange blobType = property.Value.GetString(); continue; } + if (property.NameEquals("accessTier"u8)) + { + accessTier = new StorageBlobAccessTier(property.Value.GetString()); + continue; + } + if (property.NameEquals("previousTier"u8)) + { + previousTier = new StorageBlobAccessTier(property.Value.GetString()); + continue; + } if (property.NameEquals("url"u8)) { url = property.Value.GetString(); @@ -222,6 +238,8 @@ internal static StorageBlobTierChangedEventData DeserializeStorageBlobTierChange contentType, contentLength, blobType, + accessTier, + previousTier, url, sequencer, identity, diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobTierChangedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobTierChangedEventData.cs index e1f0f18db416..ae0660ee74c4 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobTierChangedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageBlobTierChangedEventData.cs @@ -46,12 +46,16 @@ public partial class StorageBlobTierChangedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . + /// The current tier of the blob. + /// The previous tier of the blob. /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. /// is null. - internal StorageBlobTierChangedEventData(IReadOnlyDictionary storageDiagnostics) + internal StorageBlobTierChangedEventData(StorageBlobAccessTier accessTier, StorageBlobAccessTier previousTier, IReadOnlyDictionary storageDiagnostics) { Argument.AssertNotNull(storageDiagnostics, nameof(storageDiagnostics)); + AccessTier = accessTier; + PreviousTier = previousTier; StorageDiagnostics = storageDiagnostics; } @@ -62,12 +66,14 @@ internal StorageBlobTierChangedEventData(IReadOnlyDictionary /// The content type of the blob. This is the same as what would be returned in the Content-Type header from the blob. /// The size of the blob in bytes. This is the same as what would be returned in the Content-Length header from the blob. /// The type of blob. + /// The current tier of the blob. + /// The previous tier of the blob. /// The path to the blob. /// An opaque string value representing the logical sequence of events for any particular blob name. Users can use standard string comparison to understand the relative sequence of two events on the same blob name. /// The identity of the requester that triggered this event. /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. /// Keeps track of any properties unknown to the library. - internal StorageBlobTierChangedEventData(string api, string clientRequestId, string requestId, string contentType, long? contentLength, string blobType, string url, string sequencer, string identity, IReadOnlyDictionary storageDiagnostics, IDictionary serializedAdditionalRawData) + internal StorageBlobTierChangedEventData(string api, string clientRequestId, string requestId, string contentType, long? contentLength, string blobType, StorageBlobAccessTier accessTier, StorageBlobAccessTier previousTier, string url, string sequencer, string identity, IReadOnlyDictionary storageDiagnostics, IDictionary serializedAdditionalRawData) { Api = api; ClientRequestId = clientRequestId; @@ -75,6 +81,8 @@ internal StorageBlobTierChangedEventData(string api, string clientRequestId, str ContentType = contentType; ContentLength = contentLength; BlobType = blobType; + AccessTier = accessTier; + PreviousTier = previousTier; Url = url; Sequencer = sequencer; Identity = identity; @@ -99,6 +107,10 @@ internal StorageBlobTierChangedEventData() public long? ContentLength { get; } /// The type of blob. public string BlobType { get; } + /// The current tier of the blob. + public StorageBlobAccessTier AccessTier { get; } + /// The previous tier of the blob. + public StorageBlobAccessTier PreviousTier { get; } /// The path to the blob. public string Url { get; } /// An opaque string value representing the logical sequence of events for any particular blob name. Users can use standard string comparison to understand the relative sequence of two events on the same blob name. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentCompletedEventData.Serialization.cs index 0a0edd35a325..d4cc7951c00c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentCompletedEventData.Serialization.cs @@ -26,10 +26,16 @@ void IJsonModel.Write(Utf8JsonWriter wr } writer.WriteStartObject(); - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.ToString()); - writer.WritePropertyName("completedDateTime"u8); - writer.WriteStringValue(CompletedOn, "O"); + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (Optional.IsDefined(CompletedOn)) + { + writer.WritePropertyName("completedDateTime"u8); + writer.WriteStringValue(CompletedOn.Value, "O"); + } if (Optional.IsDefined(TaskExecutionId)) { writer.WritePropertyName("taskExecutionId"u8); @@ -80,8 +86,8 @@ internal static StorageTaskAssignmentCompletedEventData DeserializeStorageTaskAs { return null; } - StorageTaskAssignmentCompletedStatus status = default; - DateTimeOffset completedDateTime = default; + StorageTaskAssignmentCompletedStatus? status = default; + DateTimeOffset? completedDateTime = default; string taskExecutionId = default; string taskName = default; Uri summaryReportBlobUrl = default; @@ -91,11 +97,19 @@ internal static StorageTaskAssignmentCompletedEventData DeserializeStorageTaskAs { if (property.NameEquals("status"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } status = new StorageTaskAssignmentCompletedStatus(property.Value.GetString()); continue; } if (property.NameEquals("completedDateTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } completedDateTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentCompletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentCompletedEventData.cs index acf2da3e348f..91f49d744b3d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentCompletedEventData.cs @@ -46,16 +46,12 @@ public partial class StorageTaskAssignmentCompletedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The status for a storage task. - /// The time at which a storage task was completed. /// The summary report blob url for a storage task. /// is null. - internal StorageTaskAssignmentCompletedEventData(StorageTaskAssignmentCompletedStatus status, DateTimeOffset completedOn, Uri summaryReportBlobUri) + internal StorageTaskAssignmentCompletedEventData(Uri summaryReportBlobUri) { Argument.AssertNotNull(summaryReportBlobUri, nameof(summaryReportBlobUri)); - Status = status; - CompletedOn = completedOn; SummaryReportBlobUri = summaryReportBlobUri; } @@ -66,7 +62,7 @@ internal StorageTaskAssignmentCompletedEventData(StorageTaskAssignmentCompletedS /// The task name for a storage task. /// The summary report blob url for a storage task. /// Keeps track of any properties unknown to the library. - internal StorageTaskAssignmentCompletedEventData(StorageTaskAssignmentCompletedStatus status, DateTimeOffset completedOn, string taskExecutionId, string taskName, Uri summaryReportBlobUri, IDictionary serializedAdditionalRawData) + internal StorageTaskAssignmentCompletedEventData(StorageTaskAssignmentCompletedStatus? status, DateTimeOffset? completedOn, string taskExecutionId, string taskName, Uri summaryReportBlobUri, IDictionary serializedAdditionalRawData) { Status = status; CompletedOn = completedOn; @@ -82,9 +78,9 @@ internal StorageTaskAssignmentCompletedEventData() } /// The status for a storage task. - public StorageTaskAssignmentCompletedStatus Status { get; } + public StorageTaskAssignmentCompletedStatus? Status { get; } /// The time at which a storage task was completed. - public DateTimeOffset CompletedOn { get; } + public DateTimeOffset? CompletedOn { get; } /// The execution id for a storage task. public string TaskExecutionId { get; } /// The task name for a storage task. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentQueuedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentQueuedEventData.Serialization.cs index 2c7f37b81b43..32854032bd7f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentQueuedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentQueuedEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter write } writer.WriteStartObject(); - writer.WritePropertyName("queuedDateTime"u8); - writer.WriteStringValue(QueuedOn, "O"); + if (Optional.IsDefined(QueuedOn)) + { + writer.WritePropertyName("queuedDateTime"u8); + writer.WriteStringValue(QueuedOn.Value, "O"); + } if (Optional.IsDefined(TaskExecutionId)) { writer.WritePropertyName("taskExecutionId"u8); @@ -71,7 +74,7 @@ internal static StorageTaskAssignmentQueuedEventData DeserializeStorageTaskAssig { return null; } - DateTimeOffset queuedDateTime = default; + DateTimeOffset? queuedDateTime = default; string taskExecutionId = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -79,6 +82,10 @@ internal static StorageTaskAssignmentQueuedEventData DeserializeStorageTaskAssig { if (property.NameEquals("queuedDateTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } queuedDateTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentQueuedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentQueuedEventData.cs index 629cae0b0418..c03472230485 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentQueuedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskAssignmentQueuedEventData.cs @@ -46,30 +46,23 @@ public partial class StorageTaskAssignmentQueuedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time at which a storage task was queued. - internal StorageTaskAssignmentQueuedEventData(DateTimeOffset queuedOn) + internal StorageTaskAssignmentQueuedEventData() { - QueuedOn = queuedOn; } /// Initializes a new instance of . /// The time at which a storage task was queued. /// The execution id for a storage task. /// Keeps track of any properties unknown to the library. - internal StorageTaskAssignmentQueuedEventData(DateTimeOffset queuedOn, string taskExecutionId, IDictionary serializedAdditionalRawData) + internal StorageTaskAssignmentQueuedEventData(DateTimeOffset? queuedOn, string taskExecutionId, IDictionary serializedAdditionalRawData) { QueuedOn = queuedOn; TaskExecutionId = taskExecutionId; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal StorageTaskAssignmentQueuedEventData() - { - } - /// The time at which a storage task was queued. - public DateTimeOffset QueuedOn { get; } + public DateTimeOffset? QueuedOn { get; } /// The execution id for a storage task. public string TaskExecutionId { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskCompletedEventData.Serialization.cs index 1dec95ca7cc9..62c9f0d7e9a8 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskCompletedEventData.Serialization.cs @@ -26,10 +26,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode } writer.WriteStartObject(); - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.ToString()); - writer.WritePropertyName("completedDateTime"u8); - writer.WriteStringValue(CompletedDateTime, "O"); + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (Optional.IsDefined(CompletedDateTime)) + { + writer.WritePropertyName("completedDateTime"u8); + writer.WriteStringValue(CompletedDateTime.Value, "O"); + } if (Optional.IsDefined(TaskExecutionId)) { writer.WritePropertyName("taskExecutionId"u8); @@ -80,8 +86,8 @@ internal static StorageTaskCompletedEventData DeserializeStorageTaskCompletedEve { return null; } - StorageTaskCompletedStatus status = default; - DateTimeOffset completedDateTime = default; + StorageTaskCompletedStatus? status = default; + DateTimeOffset? completedDateTime = default; string taskExecutionId = default; string taskName = default; Uri summaryReportBlobUrl = default; @@ -91,11 +97,19 @@ internal static StorageTaskCompletedEventData DeserializeStorageTaskCompletedEve { if (property.NameEquals("status"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } status = new StorageTaskCompletedStatus(property.Value.GetString()); continue; } if (property.NameEquals("completedDateTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } completedDateTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskCompletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskCompletedEventData.cs index a7e3b6af287d..068d575deae8 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskCompletedEventData.cs @@ -46,16 +46,12 @@ public partial class StorageTaskCompletedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The status for a storage task. - /// The time at which a storage task was completed. /// The summary report blob url for a storage task. /// is null. - internal StorageTaskCompletedEventData(StorageTaskCompletedStatus status, DateTimeOffset completedDateTime, Uri summaryReportBlobUrl) + internal StorageTaskCompletedEventData(Uri summaryReportBlobUrl) { Argument.AssertNotNull(summaryReportBlobUrl, nameof(summaryReportBlobUrl)); - Status = status; - CompletedDateTime = completedDateTime; SummaryReportBlobUrl = summaryReportBlobUrl; } @@ -66,7 +62,7 @@ internal StorageTaskCompletedEventData(StorageTaskCompletedStatus status, DateTi /// The task name for a storage task. /// The summary report blob url for a storage task. /// Keeps track of any properties unknown to the library. - internal StorageTaskCompletedEventData(StorageTaskCompletedStatus status, DateTimeOffset completedDateTime, string taskExecutionId, string taskName, Uri summaryReportBlobUrl, IDictionary serializedAdditionalRawData) + internal StorageTaskCompletedEventData(StorageTaskCompletedStatus? status, DateTimeOffset? completedDateTime, string taskExecutionId, string taskName, Uri summaryReportBlobUrl, IDictionary serializedAdditionalRawData) { Status = status; CompletedDateTime = completedDateTime; @@ -82,9 +78,9 @@ internal StorageTaskCompletedEventData() } /// The status for a storage task. - public StorageTaskCompletedStatus Status { get; } + public StorageTaskCompletedStatus? Status { get; } /// The time at which a storage task was completed. - public DateTimeOffset CompletedDateTime { get; } + public DateTimeOffset? CompletedDateTime { get; } /// The execution id for a storage task. public string TaskExecutionId { get; } /// The task name for a storage task. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskQueuedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskQueuedEventData.Serialization.cs index 9fe80d23b2b2..88f1c24ab5ee 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskQueuedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskQueuedEventData.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe } writer.WriteStartObject(); - writer.WritePropertyName("queuedDateTime"u8); - writer.WriteStringValue(QueuedDateTime, "O"); + if (Optional.IsDefined(QueuedDateTime)) + { + writer.WritePropertyName("queuedDateTime"u8); + writer.WriteStringValue(QueuedDateTime.Value, "O"); + } if (Optional.IsDefined(TaskExecutionId)) { writer.WritePropertyName("taskExecutionId"u8); @@ -71,7 +74,7 @@ internal static StorageTaskQueuedEventData DeserializeStorageTaskQueuedEventData { return null; } - DateTimeOffset queuedDateTime = default; + DateTimeOffset? queuedDateTime = default; string taskExecutionId = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -79,6 +82,10 @@ internal static StorageTaskQueuedEventData DeserializeStorageTaskQueuedEventData { if (property.NameEquals("queuedDateTime"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } queuedDateTime = property.Value.GetDateTimeOffset("O"); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskQueuedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskQueuedEventData.cs index 0ad77410c7c3..79169b81a03e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskQueuedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/StorageTaskQueuedEventData.cs @@ -46,30 +46,23 @@ public partial class StorageTaskQueuedEventData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The time at which a storage task was queued. - internal StorageTaskQueuedEventData(DateTimeOffset queuedDateTime) + internal StorageTaskQueuedEventData() { - QueuedDateTime = queuedDateTime; } /// Initializes a new instance of . /// The time at which a storage task was queued. /// The execution id for a storage task. /// Keeps track of any properties unknown to the library. - internal StorageTaskQueuedEventData(DateTimeOffset queuedDateTime, string taskExecutionId, IDictionary serializedAdditionalRawData) + internal StorageTaskQueuedEventData(DateTimeOffset? queuedDateTime, string taskExecutionId, IDictionary serializedAdditionalRawData) { QueuedDateTime = queuedDateTime; TaskExecutionId = taskExecutionId; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal StorageTaskQueuedEventData() - { - } - /// The time at which a storage task was queued. - public DateTimeOffset QueuedDateTime { get; } + public DateTimeOffset? QueuedDateTime { get; } /// The execution id for a storage task. public string TaskExecutionId { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SystemEventsClientOptions.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SystemEventsClientOptions.cs index 0d99553ffa77..17e37e2f9d4b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SystemEventsClientOptions.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/SystemEventsClientOptions.cs @@ -13,13 +13,13 @@ namespace Azure.Messaging.EventGrid.SystemEvents /// Client options for SystemEventsClient. internal partial class SystemEventsClientOptions : ClientOptions { - private const ServiceVersion LatestVersion = ServiceVersion.V2024_01_01; + private const ServiceVersion LatestVersion = ServiceVersion.V2018_01_01; /// The version of the service to use. internal enum ServiceVersion { - /// Service version "2024-01-01". - V2024_01_01 = 1, + /// Service version "2018-01-01". + V2018_01_01 = 1, } internal string Version { get; } @@ -29,7 +29,7 @@ public SystemEventsClientOptions(ServiceVersion version = LatestVersion) { Version = version switch { - ServiceVersion.V2024_01_01 => "2024-01-01", + ServiceVersion.V2018_01_01 => "2018-01-01", _ => throw new NotSupportedException() }; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/UnknownMediaJobOutput.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/UnknownMediaJobOutput.Serialization.cs index 01e4ff8b3e1c..9c616f4f8516 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/UnknownMediaJobOutput.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/UnknownMediaJobOutput.Serialization.cs @@ -37,8 +37,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp } writer.WritePropertyName("progress"u8); writer.WriteNumberValue(Progress); - writer.WritePropertyName("state"u8); - writer.WriteStringValue(State.ToString()); + if (Optional.IsDefined(State)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -81,7 +84,7 @@ internal static UnknownMediaJobOutput DeserializeUnknownMediaJobOutput(JsonEleme MediaJobError error = default; string label = default; long progress = default; - MediaJobState state = default; + MediaJobState? state = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -108,6 +111,10 @@ internal static UnknownMediaJobOutput DeserializeUnknownMediaJobOutput(JsonEleme } if (property.NameEquals("state"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } state = new MediaJobState(property.Value.GetString()); continue; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/UnknownMediaJobOutput.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/UnknownMediaJobOutput.cs index 0bfb2f76e943..1e59a62941b6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/UnknownMediaJobOutput.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/UnknownMediaJobOutput.cs @@ -20,7 +20,7 @@ internal partial class UnknownMediaJobOutput : MediaJobOutput /// Gets the Job output progress. /// Gets the Job output state. /// Keeps track of any properties unknown to the library. - internal UnknownMediaJobOutput(string odataType, MediaJobError error, string label, long progress, MediaJobState state, IDictionary serializedAdditionalRawData) : base(odataType, error, label, progress, state, serializedAdditionalRawData) + internal UnknownMediaJobOutput(string odataType, MediaJobError error, string label, long progress, MediaJobState? state, IDictionary serializedAdditionalRawData) : base(odataType, error, label, progress, state, serializedAdditionalRawData) { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/tsp-location.yaml b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/tsp-location.yaml index e59d0681c201..ed0d74d70449 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/tsp-location.yaml +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/tsp-location.yaml @@ -1,3 +1,4 @@ +directory: specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents +commit: 75af203a2e61f012df7acb36ecc7c5febe878a2d repo: Azure/azure-rest-api-specs -directory: "specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents" -commit: 9f024124361561030653abd1e8ec6d5ad1080c1a +additionalDirectories: diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/Azure.Messaging.EventGrid.Namespaces.sln b/sdk/eventgrid/Azure.Messaging.EventGridV2/Azure.Messaging.EventGrid.Namespaces.sln new file mode 100644 index 000000000000..391d7e850673 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/Azure.Messaging.EventGrid.Namespaces.sln @@ -0,0 +1,54 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework", "..\..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{ECC730C1-4AEA-420C-916A-66B19B79E4DC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Messaging.EventGrid.Namespaces", "src\Azure.Messaging.EventGrid.Namespaces.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/CHANGELOG.md b/sdk/eventgrid/Azure.Messaging.EventGridV2/CHANGELOG.md new file mode 100644 index 000000000000..13dd08af78ab --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/Directory.Build.props b/sdk/eventgrid/Azure.Messaging.EventGridV2/Directory.Build.props new file mode 100644 index 000000000000..63bd836ad44b --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/README.md b/sdk/eventgrid/Azure.Messaging.EventGridV2/README.md new file mode 100644 index 000000000000..4989c61c2afb --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/README.md @@ -0,0 +1,107 @@ +# Azure.Messaging.EventGrid.Namespaces client library for .NET + +Azure.Messaging.EventGrid.Namespaces is a managed service that helps developers get secret simply and securely. + +Use the client library for to: + +* [Get secret](https://docs.microsoft.com/azure) + +[Source code][source_root] | [Package (NuGet)][package] | [API reference documentation][reference_docs] | [Product documentation][azconfig_docs] | [Samples][source_samples] + + [Source code](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventgrid/Azure.Messaging.EventGrid.Namespaces/src) | [Package (NuGet)](https://www.nuget.org/packages) | [API reference documentation](https://azure.github.io/azure-sdk-for-net) | [Product documentation](https://docs.microsoft.com/azure) + +## Getting started + +This section should include everything a developer needs to do to install and create their first client connection *very quickly*. + +### Install the package + +First, provide instruction for obtaining and installing the package or library. This section might include only a single line of code, like `dotnet add package package-name`, but should enable a developer to successfully install the package from NuGet, npm, or even cloning a GitHub repository. + +Install the client library for .NET with [NuGet](https://www.nuget.org/ ): + +```dotnetcli +dotnet add package Azure.Messaging.EventGrid.Namespaces --prerelease +``` + +### Prerequisites + +Include a section after the install command that details any requirements that must be satisfied before a developer can [authenticate](#authenticate-the-client) and test all of the snippets in the [Examples](#examples) section. For example, for Cosmos DB: + +> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and [Cosmos DB account](https://docs.microsoft.com/azure/cosmos-db/account-overview) (SQL API). In order to take advantage of the C# 8.0 syntax, it is recommended that you compile using the [.NET Core SDK](https://dotnet.microsoft.com/download) 3.0 or higher with a [language version](https://docs.microsoft.com/dotnet/csharp/language-reference/configure-language-version#override-a-default) of `latest`. It is also possible to compile with the .NET Core SDK 2.1.x using a language version of `preview`. + +### Authenticate the client + +If your library requires authentication for use, such as for Azure services, include instructions and example code needed for initializing and authenticating. + +For example, include details on obtaining an account key and endpoint URI, setting environment variables for each, and initializing the client object. + +### Service API versions + +The client library targets the latest service API version by default. A client instance accepts an optional service API version parameter from its options to specify which API version service to communicate. + +#### Select a service API version + +You have the flexibility to explicitly select a supported service API version when instantiating a client by configuring its associated options. This ensures that the client can communicate with services using the specified API version. + +For example, + +```C# Snippet:CreateClientForSpecificApiVersion +Uri endpoint = new Uri(""); +DefaultAzureCredential credential = new DefaultAzureCredential(); +ClientOptions options = new ClientOptions(ClientOptions.ServiceVersion.) +var client = new Client(endpoint, credential, options); +``` + +When selecting an API version, it's important to verify that there are no breaking changes compared to the latest API version. If there are significant differences, API calls may fail due to incompatibility. + +Always ensure that the chosen API version is fully supported and operational for your specific use case and that it aligns with the service's versioning policy. + +## Key concepts + +The *Key concepts* section should describe the functionality of the main classes. Point out the most important and useful classes in the package (with links to their reference pages) and explain how those classes work together. Feel free to use bulleted lists, tables, code blocks, or even diagrams for clarity. + +Include the *Thread safety* and *Additional concepts* sections below at the end of your *Key concepts* section. You may remove or add links depending on what your library makes use of: + +### Thread safety + +We guarantee that all client instance methods are thread-safe and independent of each other ([guideline](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-service-methods-thread-safety)). This ensures that the recommendation of reusing client instances is always safe, even across threads. + +### Additional concepts + +[Client options](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#configuring-service-clients-using-clientoptions) | +[Accessing the response](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#accessing-http-response-details-using-responset) | +[Long-running operations](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#consuming-long-running-operations-using-operationt) | +[Handling failures](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#reporting-errors-requestfailedexception) | +[Diagnostics](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md) | +[Mocking](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#mocking) | +[Client lifetime](https://devblogs.microsoft.com/azure-sdk/lifetime-management-and-thread-safety-guarantees-of-azure-sdk-net-clients/) + + +## Examples + +You can familiarize yourself with different APIs using [Samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/eventgrid/Azure.Messaging.EventGrid.Namespaces/samples). + +## Troubleshooting + +Describe common errors and exceptions, how to "unpack" them if necessary, and include guidance for graceful handling and recovery. + +Provide information to help developers avoid throttling or other service-enforced errors they might encounter. For example, provide guidance and examples for using retry or connection policies in the API. + +If the package or a related package supports it, include tips for logging or enabling instrumentation to help them debug their code. + +## Next steps + +* Provide a link to additional code examples, ideally to those sitting alongside the README in the package's `/samples` directory. +* If appropriate, point users to other packages that might be useful. +* If you think there's a good chance that developers might stumble across your package in error (because they're searching for specific functionality and mistakenly think the package provides that functionality), point them to the packages they might be looking for. + +## Contributing + +This is a template, but your SDK readme should include details on how to contribute code to the repo/package. + + +[style-guide-msft]: https://docs.microsoft.com/style-guide/capitalization +[style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/eventgrid/Azure.Messaging.EventGrid.Namespaces/README.png) diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/api/Azure.Messaging.EventGrid.Namespaces.netstandard2.0.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/api/Azure.Messaging.EventGrid.Namespaces.netstandard2.0.cs new file mode 100644 index 000000000000..6622666b54ad --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/api/Azure.Messaging.EventGrid.Namespaces.netstandard2.0.cs @@ -0,0 +1,126 @@ +namespace Azure.Messaging.EventGrid.Namespaces +{ + public partial class AcknowledgeResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AcknowledgeResult() { } + public System.Collections.Generic.IReadOnlyList FailedLockTokens { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SucceededLockTokens { get { throw null; } } + Azure.Messaging.EventGrid.Namespaces.AcknowledgeResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Messaging.EventGrid.Namespaces.AcknowledgeResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AzureMessagingEventGridNamespacesClientOptions : Azure.Core.ClientOptions + { + public AzureMessagingEventGridNamespacesClientOptions(Azure.Messaging.EventGrid.Namespaces.AzureMessagingEventGridNamespacesClientOptions.ServiceVersion version = Azure.Messaging.EventGrid.Namespaces.AzureMessagingEventGridNamespacesClientOptions.ServiceVersion.V2024_06_01) { } + public enum ServiceVersion + { + V2023_11_01 = 1, + V2024_06_01 = 2, + } + } + public partial class EventGridReceiverClient + { + protected EventGridReceiverClient() { } + public EventGridReceiverClient(System.Uri endpoint, Azure.AzureKeyCredential credential) { } + public EventGridReceiverClient(System.Uri endpoint, Azure.AzureKeyCredential credential, Azure.Messaging.EventGrid.Namespaces.AzureMessagingEventGridNamespacesClientOptions options) { } + public EventGridReceiverClient(System.Uri endpoint, Azure.Core.TokenCredential credential) { } + public EventGridReceiverClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.Messaging.EventGrid.Namespaces.AzureMessagingEventGridNamespacesClientOptions options) { } + public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } + } + public partial class EventGridSenderClient + { + protected EventGridSenderClient() { } + public EventGridSenderClient(System.Uri endpoint, Azure.AzureKeyCredential credential) { } + public EventGridSenderClient(System.Uri endpoint, Azure.AzureKeyCredential credential, Azure.Messaging.EventGrid.Namespaces.AzureMessagingEventGridNamespacesClientOptions options) { } + public EventGridSenderClient(System.Uri endpoint, Azure.Core.TokenCredential credential) { } + public EventGridSenderClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.Messaging.EventGrid.Namespaces.AzureMessagingEventGridNamespacesClientOptions options) { } + public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } + } + public partial class FailedLockToken : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal FailedLockToken() { } + public Azure.ResponseError Error { get { throw null; } } + public string LockToken { get { throw null; } } + Azure.Messaging.EventGrid.Namespaces.FailedLockToken System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Messaging.EventGrid.Namespaces.FailedLockToken System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public static partial class MessagingEventGridNamespacesModelFactory + { + public static Azure.Messaging.EventGrid.Namespaces.AcknowledgeResult AcknowledgeResult(System.Collections.Generic.IEnumerable failedLockTokens = null, System.Collections.Generic.IEnumerable succeededLockTokens = null) { throw null; } + public static Azure.Messaging.EventGrid.Namespaces.FailedLockToken FailedLockToken(string lockToken = null, Azure.ResponseError error = null) { throw null; } + public static Azure.Messaging.EventGrid.Namespaces.RejectResult RejectResult(System.Collections.Generic.IEnumerable failedLockTokens = null, System.Collections.Generic.IEnumerable succeededLockTokens = null) { throw null; } + public static Azure.Messaging.EventGrid.Namespaces.ReleaseResult ReleaseResult(System.Collections.Generic.IEnumerable failedLockTokens = null, System.Collections.Generic.IEnumerable succeededLockTokens = null) { throw null; } + public static Azure.Messaging.EventGrid.Namespaces.RenewLocksResult RenewLocksResult(System.Collections.Generic.IEnumerable failedLockTokens = null, System.Collections.Generic.IEnumerable succeededLockTokens = null) { throw null; } + } + public partial class RejectResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal RejectResult() { } + public System.Collections.Generic.IReadOnlyList FailedLockTokens { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SucceededLockTokens { get { throw null; } } + Azure.Messaging.EventGrid.Namespaces.RejectResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Messaging.EventGrid.Namespaces.RejectResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ReleaseDelay : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ReleaseDelay(string value) { throw null; } + public static Azure.Messaging.EventGrid.Namespaces.ReleaseDelay NoDelay { get { throw null; } } + public static Azure.Messaging.EventGrid.Namespaces.ReleaseDelay OneHour { get { throw null; } } + public static Azure.Messaging.EventGrid.Namespaces.ReleaseDelay OneMinute { get { throw null; } } + public static Azure.Messaging.EventGrid.Namespaces.ReleaseDelay TenMinutes { get { throw null; } } + public static Azure.Messaging.EventGrid.Namespaces.ReleaseDelay TenSeconds { get { throw null; } } + public bool Equals(Azure.Messaging.EventGrid.Namespaces.ReleaseDelay other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Messaging.EventGrid.Namespaces.ReleaseDelay left, Azure.Messaging.EventGrid.Namespaces.ReleaseDelay right) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.Namespaces.ReleaseDelay (string value) { throw null; } + public static bool operator !=(Azure.Messaging.EventGrid.Namespaces.ReleaseDelay left, Azure.Messaging.EventGrid.Namespaces.ReleaseDelay right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ReleaseResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ReleaseResult() { } + public System.Collections.Generic.IReadOnlyList FailedLockTokens { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SucceededLockTokens { get { throw null; } } + Azure.Messaging.EventGrid.Namespaces.ReleaseResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Messaging.EventGrid.Namespaces.ReleaseResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class RenewLocksResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal RenewLocksResult() { } + public System.Collections.Generic.IReadOnlyList FailedLockTokens { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SucceededLockTokens { get { throw null; } } + Azure.Messaging.EventGrid.Namespaces.RenewLocksResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Messaging.EventGrid.Namespaces.RenewLocksResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +} +namespace Microsoft.Extensions.Azure +{ + public static partial class MessagingEventGridNamespacesClientBuilderExtensions + { + public static Azure.Core.Extensions.IAzureClientBuilder AddEventGridReceiverClient(this TBuilder builder, System.Uri endpoint) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithCredential { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddEventGridReceiverClient(this TBuilder builder, System.Uri endpoint, Azure.AzureKeyCredential credential) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilder { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddEventGridReceiverClient(this TBuilder builder, TConfiguration configuration) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithConfiguration { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddEventGridSenderClient(this TBuilder builder, System.Uri endpoint) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithCredential { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddEventGridSenderClient(this TBuilder builder, System.Uri endpoint, Azure.AzureKeyCredential credential) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilder { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddEventGridSenderClient(this TBuilder builder, TConfiguration configuration) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithConfiguration { throw null; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Azure.Messaging.EventGrid.Namespaces.csproj b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Azure.Messaging.EventGrid.Namespaces.csproj new file mode 100644 index 000000000000..63c432e943e1 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Azure.Messaging.EventGrid.Namespaces.csproj @@ -0,0 +1,20 @@ + + + This is the Azure.Messaging.EventGrid.Namespaces client library for developing .NET applications with rich experience. + Azure SDK Code Generation Azure.Messaging.EventGrid.Namespaces for Azure Data Plane + 1.0.0-beta.1 + Azure.Messaging.EventGrid.Namespaces + $(RequiredTargetFrameworks) + true + + + + + + + + + + + + diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/AcknowledgeRequest.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/AcknowledgeRequest.Serialization.cs new file mode 100644 index 000000000000..03769320022b --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/AcknowledgeRequest.Serialization.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + internal partial class AcknowledgeRequest : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AcknowledgeRequest)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("lockTokens"u8); + writer.WriteStartArray(); + foreach (var item in LockTokens) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + AcknowledgeRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AcknowledgeRequest)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcknowledgeRequest(document.RootElement, options); + } + + internal static AcknowledgeRequest DeserializeAcknowledgeRequest(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList lockTokens = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("lockTokens"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + lockTokens = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AcknowledgeRequest(lockTokens, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AcknowledgeRequest)} does not support writing '{options.Format}' format."); + } + } + + AcknowledgeRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAcknowledgeRequest(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AcknowledgeRequest)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AcknowledgeRequest FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAcknowledgeRequest(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRule.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/AcknowledgeRequest.cs similarity index 63% rename from sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRule.cs rename to sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/AcknowledgeRequest.cs index 6a99ca26cdbc..da487d167f8b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRule.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/AcknowledgeRequest.cs @@ -7,11 +7,12 @@ using System; using System.Collections.Generic; +using System.Linq; -namespace Azure.ResourceManager.CosmosDB.Models +namespace Azure.Messaging.EventGrid.Namespaces { - /// Access rule in a network security perimeter configuration profile. - public partial class AccessRule + /// The AcknowledgeRequest. + internal partial class AcknowledgeRequest { /// /// Keeps track of any properties unknown to the library. @@ -45,27 +46,31 @@ public partial class AccessRule /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public AccessRule() + /// Initializes a new instance of . + /// Array of lock tokens. + /// is null. + internal AcknowledgeRequest(IEnumerable lockTokens) { + Argument.AssertNotNull(lockTokens, nameof(lockTokens)); + + LockTokens = lockTokens.ToList(); } - /// Initializes a new instance of . - /// Name of the access rule. - /// Properties of Access Rule. + /// Initializes a new instance of . + /// Array of lock tokens. /// Keeps track of any properties unknown to the library. - internal AccessRule(string name, AccessRuleProperties properties, IDictionary serializedAdditionalRawData) + internal AcknowledgeRequest(IReadOnlyList lockTokens, IDictionary serializedAdditionalRawData) { - Name = name; - Properties = properties; + LockTokens = lockTokens; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Name of the access rule. - [WirePath("name")] - public string Name { get; set; } - /// Properties of Access Rule. - [WirePath("properties")] - public AccessRuleProperties Properties { get; set; } + /// Initializes a new instance of for deserialization. + internal AcknowledgeRequest() + { + } + + /// Array of lock tokens. + public IReadOnlyList LockTokens { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/AcknowledgeResult.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/AcknowledgeResult.Serialization.cs new file mode 100644 index 000000000000..deff988099d1 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/AcknowledgeResult.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + public partial class AcknowledgeResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AcknowledgeResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("failedLockTokens"u8); + writer.WriteStartArray(); + foreach (var item in FailedLockTokens) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + writer.WritePropertyName("succeededLockTokens"u8); + writer.WriteStartArray(); + foreach (var item in SucceededLockTokens) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + AcknowledgeResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AcknowledgeResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAcknowledgeResult(document.RootElement, options); + } + + internal static AcknowledgeResult DeserializeAcknowledgeResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList failedLockTokens = default; + IReadOnlyList succeededLockTokens = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("failedLockTokens"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FailedLockToken.DeserializeFailedLockToken(item, options)); + } + failedLockTokens = array; + continue; + } + if (property.NameEquals("succeededLockTokens"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + succeededLockTokens = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AcknowledgeResult(failedLockTokens, succeededLockTokens, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AcknowledgeResult)} does not support writing '{options.Format}' format."); + } + } + + AcknowledgeResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAcknowledgeResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AcknowledgeResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AcknowledgeResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAcknowledgeResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/AcknowledgeResult.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/AcknowledgeResult.cs new file mode 100644 index 000000000000..a30895c4a023 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/AcknowledgeResult.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + /// The result of the Acknowledge operation. + public partial class AcknowledgeResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). + /// Array of lock tokens for the successfully acknowledged cloud events. + /// or is null. + internal AcknowledgeResult(IEnumerable failedLockTokens, IEnumerable succeededLockTokens) + { + Argument.AssertNotNull(failedLockTokens, nameof(failedLockTokens)); + Argument.AssertNotNull(succeededLockTokens, nameof(succeededLockTokens)); + + FailedLockTokens = failedLockTokens.ToList(); + SucceededLockTokens = succeededLockTokens.ToList(); + } + + /// Initializes a new instance of . + /// Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). + /// Array of lock tokens for the successfully acknowledged cloud events. + /// Keeps track of any properties unknown to the library. + internal AcknowledgeResult(IReadOnlyList failedLockTokens, IReadOnlyList succeededLockTokens, IDictionary serializedAdditionalRawData) + { + FailedLockTokens = failedLockTokens; + SucceededLockTokens = succeededLockTokens; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AcknowledgeResult() + { + } + + /// Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). + public IReadOnlyList FailedLockTokens { get; } + /// Array of lock tokens for the successfully acknowledged cloud events. + public IReadOnlyList SucceededLockTokens { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/AzureMessagingEventGridNamespacesClientOptions.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/AzureMessagingEventGridNamespacesClientOptions.cs new file mode 100644 index 000000000000..028d63a6a191 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/AzureMessagingEventGridNamespacesClientOptions.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + /// Client options for Azure.Messaging.EventGrid.Namespaces library clients. + public partial class AzureMessagingEventGridNamespacesClientOptions : ClientOptions + { + private const ServiceVersion LatestVersion = ServiceVersion.V2024_06_01; + + /// The version of the service to use. + public enum ServiceVersion + { + /// Service version "2023-11-01". + V2023_11_01 = 1, + /// Service version "2024-06-01". + V2024_06_01 = 2, + } + + internal string Version { get; } + + /// Initializes new instance of AzureMessagingEventGridNamespacesClientOptions. + public AzureMessagingEventGridNamespacesClientOptions(ServiceVersion version = LatestVersion) + { + Version = version switch + { + ServiceVersion.V2023_11_01 => "2023-11-01", + ServiceVersion.V2024_06_01 => "2024-06-01", + _ => throw new NotSupportedException() + }; + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/BrokerProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/BrokerProperties.Serialization.cs new file mode 100644 index 000000000000..ece1cd39340e --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/BrokerProperties.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + internal partial class BrokerProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("lockToken"u8); + writer.WriteStringValue(LockToken); + writer.WritePropertyName("deliveryCount"u8); + writer.WriteNumberValue(DeliveryCount); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + BrokerProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BrokerProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBrokerProperties(document.RootElement, options); + } + + internal static BrokerProperties DeserializeBrokerProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string lockToken = default; + int deliveryCount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("lockToken"u8)) + { + lockToken = property.Value.GetString(); + continue; + } + if (property.NameEquals("deliveryCount"u8)) + { + deliveryCount = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BrokerProperties(lockToken, deliveryCount, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BrokerProperties)} does not support writing '{options.Format}' format."); + } + } + + BrokerProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBrokerProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BrokerProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static BrokerProperties FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeBrokerProperties(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/BrokerProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/BrokerProperties.cs new file mode 100644 index 000000000000..78d00f1266d5 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/BrokerProperties.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + /// Properties of the Event Broker operation. + internal partial class BrokerProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The token of the lock on the event. + /// The attempt count for delivering the event. + /// is null. + internal BrokerProperties(string lockToken, int deliveryCount) + { + Argument.AssertNotNull(lockToken, nameof(lockToken)); + + LockToken = lockToken; + DeliveryCount = deliveryCount; + } + + /// Initializes a new instance of . + /// The token of the lock on the event. + /// The attempt count for delivering the event. + /// Keeps track of any properties unknown to the library. + internal BrokerProperties(string lockToken, int deliveryCount, IDictionary serializedAdditionalRawData) + { + LockToken = lockToken; + DeliveryCount = deliveryCount; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BrokerProperties() + { + } + + /// The token of the lock on the event. + public string LockToken { get; } + /// The attempt count for delivering the event. + public int DeliveryCount { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/CloudEvent.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/CloudEvent.Serialization.cs new file mode 100644 index 000000000000..6f9591d6edd5 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/CloudEvent.Serialization.cs @@ -0,0 +1,255 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + internal partial class CloudEvent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CloudEvent)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + writer.WritePropertyName("source"u8); + writer.WriteStringValue(Source); + if (Optional.IsDefined(Data)) + { + writer.WritePropertyName("data"u8); +#if NET6_0_OR_GREATER + writer.WriteRawValue(Data); +#else + using (JsonDocument document = JsonDocument.Parse(Data)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + if (Optional.IsDefined(DataBase64)) + { + writer.WritePropertyName("data_base64"u8); + writer.WriteBase64StringValue(DataBase64.ToArray(), "D"); + } + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + if (Optional.IsDefined(Time)) + { + writer.WritePropertyName("time"u8); + writer.WriteStringValue(Time.Value, "O"); + } + writer.WritePropertyName("specversion"u8); + writer.WriteStringValue(Specversion); + if (Optional.IsDefined(Dataschema)) + { + writer.WritePropertyName("dataschema"u8); + writer.WriteStringValue(Dataschema); + } + if (Optional.IsDefined(Datacontenttype)) + { + writer.WritePropertyName("datacontenttype"u8); + writer.WriteStringValue(Datacontenttype); + } + if (Optional.IsDefined(Subject)) + { + writer.WritePropertyName("subject"u8); + writer.WriteStringValue(Subject); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + CloudEvent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CloudEvent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCloudEvent(document.RootElement, options); + } + + internal static CloudEvent DeserializeCloudEvent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + string source = default; + BinaryData data = default; + BinaryData dataBase64 = default; + string type = default; + DateTimeOffset? time = default; + string specversion = default; + string dataschema = default; + string datacontenttype = default; + string subject = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("source"u8)) + { + source = property.Value.GetString(); + continue; + } + if (property.NameEquals("data"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + data = BinaryData.FromString(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("data_base64"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataBase64 = BinaryData.FromBytes(property.Value.GetBytesFromBase64("D")); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("time"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + time = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("specversion"u8)) + { + specversion = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataschema"u8)) + { + dataschema = property.Value.GetString(); + continue; + } + if (property.NameEquals("datacontenttype"u8)) + { + datacontenttype = property.Value.GetString(); + continue; + } + if (property.NameEquals("subject"u8)) + { + subject = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CloudEvent( + id, + source, + data, + dataBase64, + type, + time, + specversion, + dataschema, + datacontenttype, + subject, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CloudEvent)} does not support writing '{options.Format}' format."); + } + } + + CloudEvent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCloudEvent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CloudEvent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static CloudEvent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCloudEvent(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/CloudEvent.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/CloudEvent.cs new file mode 100644 index 000000000000..6d49af6075dd --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/CloudEvent.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + /// Properties of an event published to an Azure Messaging EventGrid Namespace topic using the CloudEvent 1.0 Schema. + internal partial class CloudEvent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// An identifier for the event. The combination of id and source must be unique for each distinct event. + /// Identifies the context in which an event happened. The combination of id and source must be unique for each distinct event. + /// Type of event related to the originating occurrence. + /// The version of the CloudEvents specification which the event uses. + /// , , or is null. + public CloudEvent(string id, string source, string type, string specversion) + { + Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(source, nameof(source)); + Argument.AssertNotNull(type, nameof(type)); + Argument.AssertNotNull(specversion, nameof(specversion)); + + Id = id; + Source = source; + Type = type; + Specversion = specversion; + } + + /// Initializes a new instance of . + /// An identifier for the event. The combination of id and source must be unique for each distinct event. + /// Identifies the context in which an event happened. The combination of id and source must be unique for each distinct event. + /// Event data specific to the event type. + /// Event data specific to the event type, encoded as a base64 string. + /// Type of event related to the originating occurrence. + /// The time (in UTC) the event was generated, in RFC3339 format. + /// The version of the CloudEvents specification which the event uses. + /// Identifies the schema that data adheres to. + /// Content type of data value. + /// This describes the subject of the event in the context of the event producer (identified by source). + /// Keeps track of any properties unknown to the library. + internal CloudEvent(string id, string source, BinaryData data, BinaryData dataBase64, string type, DateTimeOffset? time, string specversion, string dataschema, string datacontenttype, string subject, IDictionary serializedAdditionalRawData) + { + Id = id; + Source = source; + Data = data; + DataBase64 = dataBase64; + Type = type; + Time = time; + Specversion = specversion; + Dataschema = dataschema; + Datacontenttype = datacontenttype; + Subject = subject; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CloudEvent() + { + } + + /// An identifier for the event. The combination of id and source must be unique for each distinct event. + public string Id { get; set; } + /// Identifies the context in which an event happened. The combination of id and source must be unique for each distinct event. + public string Source { get; set; } + /// + /// Event data specific to the event type. + /// + /// To assign an object to this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public BinaryData Data { get; set; } + /// + /// Event data specific to the event type, encoded as a base64 string. + /// + /// To assign a byte[] to this property use . + /// The byte[] will be serialized to a Base64 encoded string. + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromBytes(new byte[] { 1, 2, 3 }) + /// Creates a payload of "AQID". + /// + /// + /// + /// + public BinaryData DataBase64 { get; set; } + /// Type of event related to the originating occurrence. + public string Type { get; set; } + /// The time (in UTC) the event was generated, in RFC3339 format. + public DateTimeOffset? Time { get; set; } + /// The version of the CloudEvents specification which the event uses. + public string Specversion { get; set; } + /// Identifies the schema that data adheres to. + public string Dataschema { get; set; } + /// Content type of data value. + public string Datacontenttype { get; set; } + /// This describes the subject of the event in the context of the event producer (identified by source). + public string Subject { get; set; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/EventGridReceiverClient.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/EventGridReceiverClient.cs new file mode 100644 index 000000000000..43b45c5c3811 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/EventGridReceiverClient.cs @@ -0,0 +1,840 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + // Data plane generated client. + /// The EventGridReceiver service client. + public partial class EventGridReceiverClient + { + private const string AuthorizationHeader = "Authorization"; + private readonly AzureKeyCredential _keyCredential; + private const string AuthorizationApiKeyPrefix = "SharedAccessKey"; + private static readonly string[] AuthorizationScopes = new string[] { "https://eventgrid.azure.net/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of EventGridReceiverClient for mocking. + protected EventGridReceiverClient() + { + } + + /// Initializes a new instance of EventGridReceiverClient. + /// The host name of the namespace, e.g. namespaceName1.westus-1.eventgrid.azure.net. + /// A credential used to authenticate to an Azure Service. + /// or is null. + public EventGridReceiverClient(Uri endpoint, AzureKeyCredential credential) : this(endpoint, credential, new AzureMessagingEventGridNamespacesClientOptions()) + { + } + + /// Initializes a new instance of EventGridReceiverClient. + /// The host name of the namespace, e.g. namespaceName1.westus-1.eventgrid.azure.net. + /// A credential used to authenticate to an Azure Service. + /// or is null. + public EventGridReceiverClient(Uri endpoint, TokenCredential credential) : this(endpoint, credential, new AzureMessagingEventGridNamespacesClientOptions()) + { + } + + /// Initializes a new instance of EventGridReceiverClient. + /// The host name of the namespace, e.g. namespaceName1.westus-1.eventgrid.azure.net. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public EventGridReceiverClient(Uri endpoint, AzureKeyCredential credential, AzureMessagingEventGridNamespacesClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new AzureMessagingEventGridNamespacesClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _keyCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new AzureKeyCredentialPolicy(_keyCredential, AuthorizationHeader, AuthorizationApiKeyPrefix) }, new ResponseClassifier()); + _endpoint = endpoint; + _apiVersion = options.Version; + } + + /// Initializes a new instance of EventGridReceiverClient. + /// The host name of the namespace, e.g. namespaceName1.westus-1.eventgrid.azure.net. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public EventGridReceiverClient(Uri endpoint, TokenCredential credential, AzureMessagingEventGridNamespacesClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new AzureMessagingEventGridNamespacesClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _tokenCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); + _endpoint = endpoint; + _apiVersion = options.Version; + } + + /// Receive a batch of Cloud Events from a subscription. + /// Topic Name. + /// Event Subscription Name. + /// Max Events count to be received. Minimum value is 1, while maximum value is 100 events. If not specified, the default value is 1. + /// Max wait time value for receive operation in Seconds. It is the time in seconds that the server approximately waits for the availability of an event and responds to the request. If an event is available, the broker responds immediately to the client. Minimum value is 10 seconds, while maximum value is 120 seconds. If not specified, the default value is 60 seconds. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + internal virtual async Task> ReceiveAsync(string topicName, string eventSubscriptionName, int? maxEvents = null, TimeSpan? maxWaitTime = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNullOrEmpty(eventSubscriptionName, nameof(eventSubscriptionName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await ReceiveAsync(topicName, eventSubscriptionName, maxEvents, maxWaitTime, context).ConfigureAwait(false); + return Response.FromValue(ReceiveResult.FromResponse(response), response); + } + + /// Receive a batch of Cloud Events from a subscription. + /// Topic Name. + /// Event Subscription Name. + /// Max Events count to be received. Minimum value is 1, while maximum value is 100 events. If not specified, the default value is 1. + /// Max wait time value for receive operation in Seconds. It is the time in seconds that the server approximately waits for the availability of an event and responds to the request. If an event is available, the broker responds immediately to the client. Minimum value is 10 seconds, while maximum value is 120 seconds. If not specified, the default value is 60 seconds. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + internal virtual Response Receive(string topicName, string eventSubscriptionName, int? maxEvents = null, TimeSpan? maxWaitTime = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNullOrEmpty(eventSubscriptionName, nameof(eventSubscriptionName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = Receive(topicName, eventSubscriptionName, maxEvents, maxWaitTime, context); + return Response.FromValue(ReceiveResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Receive a batch of Cloud Events from a subscription. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Topic Name. + /// Event Subscription Name. + /// Max Events count to be received. Minimum value is 1, while maximum value is 100 events. If not specified, the default value is 1. + /// Max wait time value for receive operation in Seconds. It is the time in seconds that the server approximately waits for the availability of an event and responds to the request. If an event is available, the broker responds immediately to the client. Minimum value is 10 seconds, while maximum value is 120 seconds. If not specified, the default value is 60 seconds. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual async Task ReceiveAsync(string topicName, string eventSubscriptionName, int? maxEvents, TimeSpan? maxWaitTime, RequestContext context) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNullOrEmpty(eventSubscriptionName, nameof(eventSubscriptionName)); + + using var scope = ClientDiagnostics.CreateScope("EventGridReceiverClient.Receive"); + scope.Start(); + try + { + using HttpMessage message = CreateReceiveRequest(topicName, eventSubscriptionName, maxEvents, maxWaitTime, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Receive a batch of Cloud Events from a subscription. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Topic Name. + /// Event Subscription Name. + /// Max Events count to be received. Minimum value is 1, while maximum value is 100 events. If not specified, the default value is 1. + /// Max wait time value for receive operation in Seconds. It is the time in seconds that the server approximately waits for the availability of an event and responds to the request. If an event is available, the broker responds immediately to the client. Minimum value is 10 seconds, while maximum value is 120 seconds. If not specified, the default value is 60 seconds. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual Response Receive(string topicName, string eventSubscriptionName, int? maxEvents, TimeSpan? maxWaitTime, RequestContext context) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNullOrEmpty(eventSubscriptionName, nameof(eventSubscriptionName)); + + using var scope = ClientDiagnostics.CreateScope("EventGridReceiverClient.Receive"); + scope.Start(); + try + { + using HttpMessage message = CreateReceiveRequest(topicName, eventSubscriptionName, maxEvents, maxWaitTime, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Acknowledge a batch of Cloud Events. The response will include the set of successfully acknowledged lock tokens, along with other failed lock tokens with their corresponding error information. Successfully acknowledged events will no longer be available to be received by any consumer. + /// Topic Name. + /// Event Subscription Name. + /// Array of lock tokens. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + internal virtual async Task> AcknowledgeAsync(string topicName, string eventSubscriptionName, IEnumerable lockTokens, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNullOrEmpty(eventSubscriptionName, nameof(eventSubscriptionName)); + Argument.AssertNotNull(lockTokens, nameof(lockTokens)); + + AcknowledgeRequest acknowledgeRequest = new AcknowledgeRequest(lockTokens.ToList(), null); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await AcknowledgeAsync(topicName, eventSubscriptionName, acknowledgeRequest.ToRequestContent(), context).ConfigureAwait(false); + return Response.FromValue(AcknowledgeResult.FromResponse(response), response); + } + + /// Acknowledge a batch of Cloud Events. The response will include the set of successfully acknowledged lock tokens, along with other failed lock tokens with their corresponding error information. Successfully acknowledged events will no longer be available to be received by any consumer. + /// Topic Name. + /// Event Subscription Name. + /// Array of lock tokens. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + internal virtual Response Acknowledge(string topicName, string eventSubscriptionName, IEnumerable lockTokens, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNullOrEmpty(eventSubscriptionName, nameof(eventSubscriptionName)); + Argument.AssertNotNull(lockTokens, nameof(lockTokens)); + + AcknowledgeRequest acknowledgeRequest = new AcknowledgeRequest(lockTokens.ToList(), null); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = Acknowledge(topicName, eventSubscriptionName, acknowledgeRequest.ToRequestContent(), context); + return Response.FromValue(AcknowledgeResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Acknowledge a batch of Cloud Events. The response will include the set of successfully acknowledged lock tokens, along with other failed lock tokens with their corresponding error information. Successfully acknowledged events will no longer be available to be received by any consumer. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Topic Name. + /// Event Subscription Name. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual async Task AcknowledgeAsync(string topicName, string eventSubscriptionName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNullOrEmpty(eventSubscriptionName, nameof(eventSubscriptionName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EventGridReceiverClient.Acknowledge"); + scope.Start(); + try + { + using HttpMessage message = CreateAcknowledgeRequest(topicName, eventSubscriptionName, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Acknowledge a batch of Cloud Events. The response will include the set of successfully acknowledged lock tokens, along with other failed lock tokens with their corresponding error information. Successfully acknowledged events will no longer be available to be received by any consumer. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Topic Name. + /// Event Subscription Name. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual Response Acknowledge(string topicName, string eventSubscriptionName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNullOrEmpty(eventSubscriptionName, nameof(eventSubscriptionName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EventGridReceiverClient.Acknowledge"); + scope.Start(); + try + { + using HttpMessage message = CreateAcknowledgeRequest(topicName, eventSubscriptionName, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Release a batch of Cloud Events. The response will include the set of successfully released lock tokens, along with other failed lock tokens with their corresponding error information. Successfully released events can be received by consumers. + /// Topic Name. + /// Event Subscription Name. + /// Array of lock tokens. + /// Release cloud events with the specified delay in seconds. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + internal virtual async Task> ReleaseAsync(string topicName, string eventSubscriptionName, IEnumerable lockTokens, ReleaseDelay? releaseDelayInSeconds = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNullOrEmpty(eventSubscriptionName, nameof(eventSubscriptionName)); + Argument.AssertNotNull(lockTokens, nameof(lockTokens)); + + ReleaseRequest releaseRequest = new ReleaseRequest(lockTokens.ToList(), null); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await ReleaseAsync(topicName, eventSubscriptionName, releaseRequest.ToRequestContent(), releaseDelayInSeconds?.ToString(), context).ConfigureAwait(false); + return Response.FromValue(ReleaseResult.FromResponse(response), response); + } + + /// Release a batch of Cloud Events. The response will include the set of successfully released lock tokens, along with other failed lock tokens with their corresponding error information. Successfully released events can be received by consumers. + /// Topic Name. + /// Event Subscription Name. + /// Array of lock tokens. + /// Release cloud events with the specified delay in seconds. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + internal virtual Response Release(string topicName, string eventSubscriptionName, IEnumerable lockTokens, ReleaseDelay? releaseDelayInSeconds = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNullOrEmpty(eventSubscriptionName, nameof(eventSubscriptionName)); + Argument.AssertNotNull(lockTokens, nameof(lockTokens)); + + ReleaseRequest releaseRequest = new ReleaseRequest(lockTokens.ToList(), null); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = Release(topicName, eventSubscriptionName, releaseRequest.ToRequestContent(), releaseDelayInSeconds?.ToString(), context); + return Response.FromValue(ReleaseResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Release a batch of Cloud Events. The response will include the set of successfully released lock tokens, along with other failed lock tokens with their corresponding error information. Successfully released events can be received by consumers. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Topic Name. + /// Event Subscription Name. + /// The content to send as the body of the request. + /// Release cloud events with the specified delay in seconds. Allowed values: "0" | "10" | "60" | "600" | "3600". + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual async Task ReleaseAsync(string topicName, string eventSubscriptionName, RequestContent content, string releaseDelayInSeconds = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNullOrEmpty(eventSubscriptionName, nameof(eventSubscriptionName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EventGridReceiverClient.Release"); + scope.Start(); + try + { + using HttpMessage message = CreateReleaseRequest(topicName, eventSubscriptionName, content, releaseDelayInSeconds, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Release a batch of Cloud Events. The response will include the set of successfully released lock tokens, along with other failed lock tokens with their corresponding error information. Successfully released events can be received by consumers. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Topic Name. + /// Event Subscription Name. + /// The content to send as the body of the request. + /// Release cloud events with the specified delay in seconds. Allowed values: "0" | "10" | "60" | "600" | "3600". + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual Response Release(string topicName, string eventSubscriptionName, RequestContent content, string releaseDelayInSeconds = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNullOrEmpty(eventSubscriptionName, nameof(eventSubscriptionName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EventGridReceiverClient.Release"); + scope.Start(); + try + { + using HttpMessage message = CreateReleaseRequest(topicName, eventSubscriptionName, content, releaseDelayInSeconds, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Reject a batch of Cloud Events. The response will include the set of successfully rejected lock tokens, along with other failed lock tokens with their corresponding error information. Successfully rejected events will be dead-lettered and can no longer be received by a consumer. + /// Topic Name. + /// Event Subscription Name. + /// Array of lock tokens. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + internal virtual async Task> RejectAsync(string topicName, string eventSubscriptionName, IEnumerable lockTokens, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNullOrEmpty(eventSubscriptionName, nameof(eventSubscriptionName)); + Argument.AssertNotNull(lockTokens, nameof(lockTokens)); + + RejectRequest rejectRequest = new RejectRequest(lockTokens.ToList(), null); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await RejectAsync(topicName, eventSubscriptionName, rejectRequest.ToRequestContent(), context).ConfigureAwait(false); + return Response.FromValue(RejectResult.FromResponse(response), response); + } + + /// Reject a batch of Cloud Events. The response will include the set of successfully rejected lock tokens, along with other failed lock tokens with their corresponding error information. Successfully rejected events will be dead-lettered and can no longer be received by a consumer. + /// Topic Name. + /// Event Subscription Name. + /// Array of lock tokens. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + internal virtual Response Reject(string topicName, string eventSubscriptionName, IEnumerable lockTokens, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNullOrEmpty(eventSubscriptionName, nameof(eventSubscriptionName)); + Argument.AssertNotNull(lockTokens, nameof(lockTokens)); + + RejectRequest rejectRequest = new RejectRequest(lockTokens.ToList(), null); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = Reject(topicName, eventSubscriptionName, rejectRequest.ToRequestContent(), context); + return Response.FromValue(RejectResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Reject a batch of Cloud Events. The response will include the set of successfully rejected lock tokens, along with other failed lock tokens with their corresponding error information. Successfully rejected events will be dead-lettered and can no longer be received by a consumer. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Topic Name. + /// Event Subscription Name. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual async Task RejectAsync(string topicName, string eventSubscriptionName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNullOrEmpty(eventSubscriptionName, nameof(eventSubscriptionName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EventGridReceiverClient.Reject"); + scope.Start(); + try + { + using HttpMessage message = CreateRejectRequest(topicName, eventSubscriptionName, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Reject a batch of Cloud Events. The response will include the set of successfully rejected lock tokens, along with other failed lock tokens with their corresponding error information. Successfully rejected events will be dead-lettered and can no longer be received by a consumer. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Topic Name. + /// Event Subscription Name. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual Response Reject(string topicName, string eventSubscriptionName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNullOrEmpty(eventSubscriptionName, nameof(eventSubscriptionName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EventGridReceiverClient.Reject"); + scope.Start(); + try + { + using HttpMessage message = CreateRejectRequest(topicName, eventSubscriptionName, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Renew locks for a batch of Cloud Events. The response will include the set of successfully renewed lock tokens, along with other failed lock tokens with their corresponding error information. Successfully renewed locks will ensure that the associated event is only available to the consumer that holds the renewed lock. + /// Topic Name. + /// Event Subscription Name. + /// Array of lock tokens. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + internal virtual async Task> RenewLocksAsync(string topicName, string eventSubscriptionName, IEnumerable lockTokens, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNullOrEmpty(eventSubscriptionName, nameof(eventSubscriptionName)); + Argument.AssertNotNull(lockTokens, nameof(lockTokens)); + + RenewLocksRequest renewLocksRequest = new RenewLocksRequest(lockTokens.ToList(), null); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await RenewLocksAsync(topicName, eventSubscriptionName, renewLocksRequest.ToRequestContent(), context).ConfigureAwait(false); + return Response.FromValue(RenewLocksResult.FromResponse(response), response); + } + + /// Renew locks for a batch of Cloud Events. The response will include the set of successfully renewed lock tokens, along with other failed lock tokens with their corresponding error information. Successfully renewed locks will ensure that the associated event is only available to the consumer that holds the renewed lock. + /// Topic Name. + /// Event Subscription Name. + /// Array of lock tokens. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + internal virtual Response RenewLocks(string topicName, string eventSubscriptionName, IEnumerable lockTokens, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNullOrEmpty(eventSubscriptionName, nameof(eventSubscriptionName)); + Argument.AssertNotNull(lockTokens, nameof(lockTokens)); + + RenewLocksRequest renewLocksRequest = new RenewLocksRequest(lockTokens.ToList(), null); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = RenewLocks(topicName, eventSubscriptionName, renewLocksRequest.ToRequestContent(), context); + return Response.FromValue(RenewLocksResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Renew locks for a batch of Cloud Events. The response will include the set of successfully renewed lock tokens, along with other failed lock tokens with their corresponding error information. Successfully renewed locks will ensure that the associated event is only available to the consumer that holds the renewed lock. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Topic Name. + /// Event Subscription Name. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual async Task RenewLocksAsync(string topicName, string eventSubscriptionName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNullOrEmpty(eventSubscriptionName, nameof(eventSubscriptionName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EventGridReceiverClient.RenewLocks"); + scope.Start(); + try + { + using HttpMessage message = CreateRenewLocksRequest(topicName, eventSubscriptionName, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Renew locks for a batch of Cloud Events. The response will include the set of successfully renewed lock tokens, along with other failed lock tokens with their corresponding error information. Successfully renewed locks will ensure that the associated event is only available to the consumer that holds the renewed lock. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Topic Name. + /// Event Subscription Name. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual Response RenewLocks(string topicName, string eventSubscriptionName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNullOrEmpty(eventSubscriptionName, nameof(eventSubscriptionName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EventGridReceiverClient.RenewLocks"); + scope.Start(); + try + { + using HttpMessage message = CreateRenewLocksRequest(topicName, eventSubscriptionName, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + internal HttpMessage CreateReceiveRequest(string topicName, string eventSubscriptionName, int? maxEvents, TimeSpan? maxWaitTime, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/topics/", false); + uri.AppendPath(topicName, true); + uri.AppendPath("/eventsubscriptions/", false); + uri.AppendPath(eventSubscriptionName, true); + uri.AppendPath(":receive", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxEvents != null) + { + uri.AppendQuery("maxEvents", maxEvents.Value, true); + } + if (maxWaitTime != null) + { + uri.AppendQuery("maxWaitTime", maxWaitTime.Value, "%s", true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateAcknowledgeRequest(string topicName, string eventSubscriptionName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/topics/", false); + uri.AppendPath(topicName, true); + uri.AppendPath("/eventsubscriptions/", false); + uri.AppendPath(eventSubscriptionName, true); + uri.AppendPath(":acknowledge", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateReleaseRequest(string topicName, string eventSubscriptionName, RequestContent content, string releaseDelayInSeconds, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/topics/", false); + uri.AppendPath(topicName, true); + uri.AppendPath("/eventsubscriptions/", false); + uri.AppendPath(eventSubscriptionName, true); + uri.AppendPath(":release", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (releaseDelayInSeconds != null) + { + uri.AppendQuery("releaseDelayInSeconds", releaseDelayInSeconds, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateRejectRequest(string topicName, string eventSubscriptionName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/topics/", false); + uri.AppendPath(topicName, true); + uri.AppendPath("/eventsubscriptions/", false); + uri.AppendPath(eventSubscriptionName, true); + uri.AppendPath(":reject", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateRenewLocksRequest(string topicName, string eventSubscriptionName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/topics/", false); + uri.AppendPath(topicName, true); + uri.AppendPath("/eventsubscriptions/", false); + uri.AppendPath(eventSubscriptionName, true); + uri.AppendPath(":renewLock", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/EventGridSenderClient.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/EventGridSenderClient.cs new file mode 100644 index 000000000000..7823b6e8d6e3 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/EventGridSenderClient.cs @@ -0,0 +1,375 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + // Data plane generated client. + /// The EventGridSender service client. + public partial class EventGridSenderClient + { + private const string AuthorizationHeader = "Authorization"; + private readonly AzureKeyCredential _keyCredential; + private const string AuthorizationApiKeyPrefix = "SharedAccessKey"; + private static readonly string[] AuthorizationScopes = new string[] { "https://eventgrid.azure.net/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of EventGridSenderClient for mocking. + protected EventGridSenderClient() + { + } + + /// Initializes a new instance of EventGridSenderClient. + /// The host name of the namespace, e.g. namespaceName1.westus-1.eventgrid.azure.net. + /// A credential used to authenticate to an Azure Service. + /// or is null. + public EventGridSenderClient(Uri endpoint, AzureKeyCredential credential) : this(endpoint, credential, new AzureMessagingEventGridNamespacesClientOptions()) + { + } + + /// Initializes a new instance of EventGridSenderClient. + /// The host name of the namespace, e.g. namespaceName1.westus-1.eventgrid.azure.net. + /// A credential used to authenticate to an Azure Service. + /// or is null. + public EventGridSenderClient(Uri endpoint, TokenCredential credential) : this(endpoint, credential, new AzureMessagingEventGridNamespacesClientOptions()) + { + } + + /// Initializes a new instance of EventGridSenderClient. + /// The host name of the namespace, e.g. namespaceName1.westus-1.eventgrid.azure.net. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public EventGridSenderClient(Uri endpoint, AzureKeyCredential credential, AzureMessagingEventGridNamespacesClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new AzureMessagingEventGridNamespacesClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _keyCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new AzureKeyCredentialPolicy(_keyCredential, AuthorizationHeader, AuthorizationApiKeyPrefix) }, new ResponseClassifier()); + _endpoint = endpoint; + _apiVersion = options.Version; + } + + /// Initializes a new instance of EventGridSenderClient. + /// The host name of the namespace, e.g. namespaceName1.westus-1.eventgrid.azure.net. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public EventGridSenderClient(Uri endpoint, TokenCredential credential, AzureMessagingEventGridNamespacesClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new AzureMessagingEventGridNamespacesClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _tokenCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); + _endpoint = endpoint; + _apiVersion = options.Version; + } + + /// Publish a single Cloud Event to a namespace topic. + /// Topic Name. + /// Single Cloud Event being published. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + internal virtual async Task> SendAsync(string topicName, CloudEvent @event, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNull(@event, nameof(@event)); + + using RequestContent content = @event.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await SendAsync(topicName, content, context).ConfigureAwait(false); + return Response.FromValue(PublishResult.FromResponse(response), response); + } + + /// Publish a single Cloud Event to a namespace topic. + /// Topic Name. + /// Single Cloud Event being published. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + internal virtual Response Send(string topicName, CloudEvent @event, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNull(@event, nameof(@event)); + + using RequestContent content = @event.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = Send(topicName, content, context); + return Response.FromValue(PublishResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Publish a single Cloud Event to a namespace topic. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Topic Name. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual async Task SendAsync(string topicName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EventGridSenderClient.Send"); + scope.Start(); + try + { + using HttpMessage message = CreateSendRequest(topicName, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Publish a single Cloud Event to a namespace topic. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Topic Name. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual Response Send(string topicName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EventGridSenderClient.Send"); + scope.Start(); + try + { + using HttpMessage message = CreateSendRequest(topicName, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Publish a batch of Cloud Events to a namespace topic. + /// Topic Name. + /// Array of Cloud Events being published. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + internal virtual async Task> SendEventsAsync(string topicName, IEnumerable events, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNull(events, nameof(events)); + + using RequestContent content = RequestContentHelper.FromEnumerable(events); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await SendEventsAsync(topicName, content, context).ConfigureAwait(false); + return Response.FromValue(PublishResult.FromResponse(response), response); + } + + /// Publish a batch of Cloud Events to a namespace topic. + /// Topic Name. + /// Array of Cloud Events being published. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + internal virtual Response SendEvents(string topicName, IEnumerable events, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNull(events, nameof(events)); + + using RequestContent content = RequestContentHelper.FromEnumerable(events); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = SendEvents(topicName, content, context); + return Response.FromValue(PublishResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Publish a batch of Cloud Events to a namespace topic. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Topic Name. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual async Task SendEventsAsync(string topicName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EventGridSenderClient.SendEvents"); + scope.Start(); + try + { + using HttpMessage message = CreateSendEventsRequest(topicName, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Publish a batch of Cloud Events to a namespace topic. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Topic Name. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + internal virtual Response SendEvents(string topicName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(topicName, nameof(topicName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EventGridSenderClient.SendEvents"); + scope.Start(); + try + { + using HttpMessage message = CreateSendEventsRequest(topicName, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + internal HttpMessage CreateSendRequest(string topicName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/topics/", false); + uri.AppendPath(topicName, true); + uri.AppendPath(":publish", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/cloudevents+json; charset=utf-8"); + request.Content = content; + return message; + } + + internal HttpMessage CreateSendEventsRequest(string topicName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/topics/", false); + uri.AppendPath(topicName, true); + uri.AppendPath(":publish", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/cloudevents-batch+json; charset=utf-8"); + request.Content = content; + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MergeParameters.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/FailedLockToken.Serialization.cs similarity index 52% rename from sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MergeParameters.Serialization.cs rename to sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/FailedLockToken.Serialization.cs index 1fcc123a5530..bdce37c4d667 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MergeParameters.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/FailedLockToken.Serialization.cs @@ -11,26 +11,25 @@ using System.Text.Json; using Azure.Core; -namespace Azure.ResourceManager.CosmosDB.Models +namespace Azure.Messaging.EventGrid.Namespaces { - public partial class MergeParameters : IUtf8JsonSerializable, IJsonModel + public partial class FailedLockToken : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MergeParameters)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(FailedLockToken)} does not support writing '{format}' format."); } writer.WriteStartObject(); - if (Optional.IsDefined(IsDryRun)) - { - writer.WritePropertyName("isDryRun"u8); - writer.WriteBooleanValue(IsDryRun.Value); - } + writer.WritePropertyName("lockToken"u8); + writer.WriteStringValue(LockToken); + writer.WritePropertyName("error"u8); + JsonSerializer.Serialize(writer, Error); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -49,19 +48,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO writer.WriteEndObject(); } - MergeParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + FailedLockToken IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MergeParameters)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(FailedLockToken)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMergeParameters(document.RootElement, options); + return DeserializeFailedLockToken(document.RootElement, options); } - internal static MergeParameters DeserializeMergeParameters(JsonElement element, ModelReaderWriterOptions options = null) + internal static FailedLockToken DeserializeFailedLockToken(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -69,18 +68,20 @@ internal static MergeParameters DeserializeMergeParameters(JsonElement element, { return null; } - bool? isDryRun = default; + string lockToken = default; + ResponseError error = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("isDryRun"u8)) + if (property.NameEquals("lockToken"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - isDryRun = property.Value.GetBoolean(); + lockToken = property.Value.GetString(); + continue; + } + if (property.NameEquals("error"u8)) + { + error = JsonSerializer.Deserialize(property.Value.GetRawText()); continue; } if (options.Format != "W") @@ -89,38 +90,54 @@ internal static MergeParameters DeserializeMergeParameters(JsonElement element, } } serializedAdditionalRawData = rawDataDictionary; - return new MergeParameters(isDryRun, serializedAdditionalRawData); + return new FailedLockToken(lockToken, error, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(MergeParameters)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(FailedLockToken)} does not support writing '{options.Format}' format."); } } - MergeParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + FailedLockToken IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMergeParameters(document.RootElement, options); + return DeserializeFailedLockToken(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MergeParameters)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(FailedLockToken)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static FailedLockToken FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFailedLockToken(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/FailedLockToken.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/FailedLockToken.cs new file mode 100644 index 000000000000..a098a39a8a15 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/FailedLockToken.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + /// Failed LockToken information. + public partial class FailedLockToken + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The lock token of an entry in the request. + /// Error information of the failed operation result for the lock token in the request. + /// or is null. + internal FailedLockToken(string lockToken, ResponseError error) + { + Argument.AssertNotNull(lockToken, nameof(lockToken)); + Argument.AssertNotNull(error, nameof(error)); + + LockToken = lockToken; + Error = error; + } + + /// Initializes a new instance of . + /// The lock token of an entry in the request. + /// Error information of the failed operation result for the lock token in the request. + /// Keeps track of any properties unknown to the library. + internal FailedLockToken(string lockToken, ResponseError error, IDictionary serializedAdditionalRawData) + { + LockToken = lockToken; + Error = error; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FailedLockToken() + { + } + + /// The lock token of an entry in the request. + public string LockToken { get; } + /// Error information of the failed operation result for the lock token in the request. + public ResponseError Error { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/Argument.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..7f53b5f11f4a --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/Argument.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + internal static class Argument + { + public static void AssertNotNull(T value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNull(T? value, string name) + where T : struct + { + if (!value.HasValue) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNullOrEmpty(IEnumerable value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value is ICollection collectionOfT && collectionOfT.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + if (value is ICollection collection && collection.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + using IEnumerator e = value.GetEnumerator(); + if (!e.MoveNext()) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + } + + public static void AssertNotNullOrEmpty(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value.Length == 0) + { + throw new ArgumentException("Value cannot be an empty string.", name); + } + } + + public static void AssertNotNullOrWhiteSpace(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (string.IsNullOrWhiteSpace(value)) + { + throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name); + } + } + + public static void AssertNotDefault(ref T value, string name) + where T : struct, IEquatable + { + if (value.Equals(default)) + { + throw new ArgumentException("Value cannot be empty.", name); + } + } + + public static void AssertInRange(T value, T minimum, T maximum, string name) + where T : notnull, IComparable + { + if (minimum.CompareTo(value) > 0) + { + throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed."); + } + if (maximum.CompareTo(value) < 0) + { + throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed."); + } + } + + public static void AssertEnumDefined(Type enumType, object value, string name) + { + if (!Enum.IsDefined(enumType, value)) + { + throw new ArgumentException($"Value not defined for {enumType.FullName}.", name); + } + } + + public static T CheckNotNull(T value, string name) + where T : class + { + AssertNotNull(value, name); + return value; + } + + public static string CheckNotNullOrEmpty(string value, string name) + { + AssertNotNullOrEmpty(value, name); + return value; + } + + public static void AssertNull(T value, string name, string message = null) + { + if (value != null) + { + throw new ArgumentException(message ?? "Value must be null.", name); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..da590bd8315a --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull + { + private IDictionary _innerDictionary; + + public ChangeTrackingDictionary() + { + } + + public ChangeTrackingDictionary(IDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(dictionary); + } + + public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(); + foreach (var pair in dictionary) + { + _innerDictionary.Add(pair); + } + } + + public bool IsUndefined => _innerDictionary == null; + + public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + + public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + + public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + + public TValue this[TKey key] + { + get + { + if (IsUndefined) + { + throw new KeyNotFoundException(nameof(key)); + } + return EnsureDictionary()[key]; + } + set + { + EnsureDictionary()[key] = value; + } + } + + IEnumerable IReadOnlyDictionary.Keys => Keys; + + IEnumerable IReadOnlyDictionary.Values => Values; + + public IEnumerator> GetEnumerator() + { + if (IsUndefined) + { + IEnumerator> enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureDictionary().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(KeyValuePair item) + { + EnsureDictionary().Add(item); + } + + public void Clear() + { + EnsureDictionary().Clear(); + } + + public bool Contains(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Contains(item); + } + + public void CopyTo(KeyValuePair[] array, int index) + { + if (IsUndefined) + { + return; + } + EnsureDictionary().CopyTo(array, index); + } + + public bool Remove(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(item); + } + + public void Add(TKey key, TValue value) + { + EnsureDictionary().Add(key, value); + } + + public bool ContainsKey(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().ContainsKey(key); + } + + public bool Remove(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(key); + } + + public bool TryGetValue(TKey key, out TValue value) + { + if (IsUndefined) + { + value = default; + return false; + } + return EnsureDictionary().TryGetValue(key, out value); + } + + public IDictionary EnsureDictionary() + { + return _innerDictionary ??= new Dictionary(); + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/ChangeTrackingList.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..86ec5baff961 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/ChangeTrackingList.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + internal class ChangeTrackingList : IList, IReadOnlyList + { + private IList _innerList; + + public ChangeTrackingList() + { + } + + public ChangeTrackingList(IList innerList) + { + if (innerList != null) + { + _innerList = innerList; + } + } + + public ChangeTrackingList(IReadOnlyList innerList) + { + if (innerList != null) + { + _innerList = innerList.ToList(); + } + } + + public bool IsUndefined => _innerList == null; + + public int Count => IsUndefined ? 0 : EnsureList().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + + public T this[int index] + { + get + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + return EnsureList()[index]; + } + set + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList()[index] = value; + } + } + + public void Reset() + { + _innerList = null; + } + + public IEnumerator GetEnumerator() + { + if (IsUndefined) + { + IEnumerator enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureList().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(T item) + { + EnsureList().Add(item); + } + + public void Clear() + { + EnsureList().Clear(); + } + + public bool Contains(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Contains(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + if (IsUndefined) + { + return; + } + EnsureList().CopyTo(array, arrayIndex); + } + + public bool Remove(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Remove(item); + } + + public int IndexOf(T item) + { + if (IsUndefined) + { + return -1; + } + return EnsureList().IndexOf(item); + } + + public void Insert(int index, T item) + { + EnsureList().Insert(index, item); + } + + public void RemoveAt(int index) + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList().RemoveAt(index); + } + + public IList EnsureList() + { + return _innerList ??= new List(); + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..905e7c682f17 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,398 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.Text.Json; +using System.Xml; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + internal static class ModelSerializationExtensions + { + internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + + public static object GetObject(this JsonElement element) + { + switch (element.ValueKind) + { + case JsonValueKind.String: + return element.GetString(); + case JsonValueKind.Number: + if (element.TryGetInt32(out int intValue)) + { + return intValue; + } + if (element.TryGetInt64(out long longValue)) + { + return longValue; + } + return element.GetDouble(); + case JsonValueKind.True: + return true; + case JsonValueKind.False: + return false; + case JsonValueKind.Undefined: + case JsonValueKind.Null: + return null; + case JsonValueKind.Object: + var dictionary = new Dictionary(); + foreach (var jsonProperty in element.EnumerateObject()) + { + dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject()); + } + return dictionary; + case JsonValueKind.Array: + var list = new List(); + foreach (var item in element.EnumerateArray()) + { + list.Add(item.GetObject()); + } + return list.ToArray(); + default: + throw new NotSupportedException($"Not supported value kind {element.ValueKind}"); + } + } + + public static byte[] GetBytesFromBase64(this JsonElement element, string format) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + + return format switch + { + "U" => TypeFormatters.FromBase64UrlString(element.GetRequiredString()), + "D" => element.GetBytesFromBase64(), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + } + + public static DateTimeOffset GetDateTimeOffset(this JsonElement element, string format) => format switch + { + "U" when element.ValueKind == JsonValueKind.Number => DateTimeOffset.FromUnixTimeSeconds(element.GetInt64()), + _ => TypeFormatters.ParseDateTimeOffset(element.GetString(), format) + }; + + public static TimeSpan GetTimeSpan(this JsonElement element, string format) => TypeFormatters.ParseTimeSpan(element.GetString(), format); + + public static char GetChar(this JsonElement element) + { + if (element.ValueKind == JsonValueKind.String) + { + var text = element.GetString(); + if (text == null || text.Length != 1) + { + throw new NotSupportedException($"Cannot convert \"{text}\" to a char"); + } + return text[0]; + } + else + { + throw new NotSupportedException($"Cannot convert {element.ValueKind} to a char"); + } + } + + [Conditional("DEBUG")] + public static void ThrowNonNullablePropertyIsNull(this JsonProperty property) + { + throw new JsonException($"A property '{property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); + } + + public static string GetRequiredString(this JsonElement element) + { + var value = element.GetString(); + if (value == null) + { + throw new InvalidOperationException($"The requested operation requires an element of type 'String', but the target element has type '{element.ValueKind}'."); + } + return value; + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTime value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, TimeSpan value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, char value) + { + writer.WriteStringValue(value.ToString(CultureInfo.InvariantCulture)); + } + + public static void WriteBase64StringValue(this Utf8JsonWriter writer, byte[] value, string format) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + switch (format) + { + case "U": + writer.WriteStringValue(TypeFormatters.ToBase64UrlString(value)); + break; + case "D": + writer.WriteBase64StringValue(value); + break; + default: + throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)); + } + } + + public static void WriteNumberValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + if (format != "U") + { + throw new ArgumentOutOfRangeException(nameof(format), "Only 'U' format is supported when writing a DateTimeOffset as a Number."); + } + writer.WriteNumberValue(value.ToUnixTimeSeconds()); + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, T value, ModelReaderWriterOptions options = null) + { + switch (value) + { + case null: + writer.WriteNullValue(); + break; + case IJsonModel jsonModel: + jsonModel.Write(writer, options ?? WireOptions); + break; + case IUtf8JsonSerializable serializable: + serializable.Write(writer); + break; + case byte[] bytes: + writer.WriteBase64StringValue(bytes); + break; + case BinaryData bytes0: + writer.WriteBase64StringValue(bytes0); + break; + case JsonElement json: + json.WriteTo(writer); + break; + case int i: + writer.WriteNumberValue(i); + break; + case decimal d: + writer.WriteNumberValue(d); + break; + case double d0: + if (double.IsNaN(d0)) + { + writer.WriteStringValue("NaN"); + } + else + { + writer.WriteNumberValue(d0); + } + break; + case float f: + writer.WriteNumberValue(f); + break; + case long l: + writer.WriteNumberValue(l); + break; + case string s: + writer.WriteStringValue(s); + break; + case bool b: + writer.WriteBooleanValue(b); + break; + case Guid g: + writer.WriteStringValue(g); + break; + case DateTimeOffset dateTimeOffset: + writer.WriteStringValue(dateTimeOffset, "O"); + break; + case DateTime dateTime: + writer.WriteStringValue(dateTime, "O"); + break; + case IEnumerable> enumerable: + writer.WriteStartObject(); + foreach (var pair in enumerable) + { + writer.WritePropertyName(pair.Key); + writer.WriteObjectValue(pair.Value, options); + } + writer.WriteEndObject(); + break; + case IEnumerable objectEnumerable: + writer.WriteStartArray(); + foreach (var item in objectEnumerable) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + break; + case TimeSpan timeSpan: + writer.WriteStringValue(timeSpan, "P"); + break; + default: + throw new NotSupportedException($"Not supported type {value.GetType()}"); + } + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, object value, ModelReaderWriterOptions options = null) + { + writer.WriteObjectValue(value, options); + } + + internal static class TypeFormatters + { + private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; + public const string DefaultNumberFormat = "G"; + + public static string ToString(bool value) => value ? "true" : "false"; + + public static string ToString(DateTime value, string format) => value.Kind switch + { + DateTimeKind.Utc => ToString((DateTimeOffset)value, format), + _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Azure SDK requires it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") + }; + + public static string ToString(DateTimeOffset value, string format) => format switch + { + "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), + "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), + "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "R" => value.ToString("r", CultureInfo.InvariantCulture), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(TimeSpan value, string format) => format switch + { + "P" => XmlConvert.ToString(value), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(byte[] value, string format) => format switch + { + "U" => ToBase64UrlString(value), + "D" => Convert.ToBase64String(value), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + + public static string ToBase64UrlString(byte[] value) + { + int numWholeOrPartialInputBlocks = checked(value.Length + 2) / 3; + int size = checked(numWholeOrPartialInputBlocks * 4); + char[] output = new char[size]; + + int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); + + int i = 0; + for (; i < numBase64Chars; i++) + { + char ch = output[i]; + if (ch == '+') + { + output[i] = '-'; + } + else + { + if (ch == '/') + { + output[i] = '_'; + } + else + { + if (ch == '=') + { + break; + } + } + } + } + + return new string(output, 0, i); + } + + public static byte[] FromBase64UrlString(string value) + { + int paddingCharsToAdd = (value.Length % 4) switch + { + 0 => 0, + 2 => 2, + 3 => 1, + _ => throw new InvalidOperationException("Malformed input") + }; + char[] output = new char[(value.Length + paddingCharsToAdd)]; + int i = 0; + for (; i < value.Length; i++) + { + char ch = value[i]; + if (ch == '-') + { + output[i] = '+'; + } + else + { + if (ch == '_') + { + output[i] = '/'; + } + else + { + output[i] = ch; + } + } + } + + for (; i < output.Length; i++) + { + output[i] = '='; + } + + return Convert.FromBase64CharArray(output, 0, output.Length); + } + + public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch + { + "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), + _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) + }; + + public static TimeSpan ParseTimeSpan(string value, string format) => format switch + { + "P" => XmlConvert.ToTimeSpan(value), + _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) + }; + + public static string ConvertToString(object value, string format = null) => value switch + { + null => "null", + string s => s, + bool b => ToString(b), + int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), + byte[] b0 when format != null => ToString(b0, format), + IEnumerable s0 => string.Join(",", s0), + DateTimeOffset dateTime when format != null => ToString(dateTime, format), + TimeSpan timeSpan when format != null => ToString(timeSpan, format), + TimeSpan timeSpan0 => XmlConvert.ToString(timeSpan0), + Guid guid => guid.ToString(), + BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), + _ => value.ToString() + }; + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/Optional.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..9b1683fa02e9 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/Optional.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + internal static class Optional + { + public static bool IsCollectionDefined(IEnumerable collection) + { + return !(collection is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined); + } + + public static bool IsCollectionDefined(IDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsCollectionDefined(IReadOnlyDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsDefined(T? value) + where T : struct + { + return value.HasValue; + } + + public static bool IsDefined(object value) + { + return value != null; + } + + public static bool IsDefined(JsonElement value) + { + return value.ValueKind != JsonValueKind.Undefined; + } + + public static bool IsDefined(string value) + { + return value != null; + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/RequestContentHelper.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/RequestContentHelper.cs new file mode 100644 index 000000000000..61d8e1dae3f7 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/RequestContentHelper.cs @@ -0,0 +1,136 @@ +// 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.Messaging.EventGrid.Namespaces +{ + internal static class RequestContentHelper + { + public static RequestContent FromEnumerable(IEnumerable enumerable) + where T : notnull + { + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteStartArray(); + foreach (var item in enumerable) + { + content.JsonWriter.WriteObjectValue(item, ModelSerializationExtensions.WireOptions); + } + content.JsonWriter.WriteEndArray(); + + return content; + } + + public static RequestContent FromEnumerable(IEnumerable enumerable) + { + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteStartArray(); + foreach (var item in enumerable) + { + if (item == null) + { + content.JsonWriter.WriteNullValue(); + } + else + { +#if NET6_0_OR_GREATER + content.JsonWriter.WriteRawValue(item); +#else + using (JsonDocument document = JsonDocument.Parse(item)) + { + JsonSerializer.Serialize(content.JsonWriter, document.RootElement); + } +#endif + } + } + content.JsonWriter.WriteEndArray(); + + return content; + } + + public static RequestContent FromEnumerable(ReadOnlySpan span) + where T : notnull + { + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteStartArray(); + for (int i = 0; i < span.Length; i++) + { + content.JsonWriter.WriteObjectValue(span[i], ModelSerializationExtensions.WireOptions); + } + content.JsonWriter.WriteEndArray(); + + return content; + } + + public static RequestContent FromDictionary(IDictionary dictionary) + where TValue : notnull + { + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteStartObject(); + foreach (var item in dictionary) + { + content.JsonWriter.WritePropertyName(item.Key); + content.JsonWriter.WriteObjectValue(item.Value, ModelSerializationExtensions.WireOptions); + } + content.JsonWriter.WriteEndObject(); + + return content; + } + + public static RequestContent FromDictionary(IDictionary dictionary) + { + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteStartObject(); + foreach (var item in dictionary) + { + content.JsonWriter.WritePropertyName(item.Key); + if (item.Value == null) + { + content.JsonWriter.WriteNullValue(); + } + else + { +#if NET6_0_OR_GREATER + content.JsonWriter.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(content.JsonWriter, document.RootElement); + } +#endif + } + } + content.JsonWriter.WriteEndObject(); + + return content; + } + + public static RequestContent FromObject(object value) + { + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(value, ModelSerializationExtensions.WireOptions); + return content; + } + + public static RequestContent FromObject(BinaryData value) + { + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); +#if NET6_0_OR_GREATER + content.JsonWriter.WriteRawValue(value); +#else + using (JsonDocument document = JsonDocument.Parse(value)) + { + JsonSerializer.Serialize(content.JsonWriter, document.RootElement); + } +#endif + return content; + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..78323219e281 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/Internal/Utf8JsonRequestContent.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.IO; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + internal class Utf8JsonRequestContent : RequestContent + { + private readonly MemoryStream _stream; + private readonly RequestContent _content; + + public Utf8JsonRequestContent() + { + _stream = new MemoryStream(); + _content = Create(_stream); + JsonWriter = new Utf8JsonWriter(_stream); + } + + public Utf8JsonWriter JsonWriter { get; } + + public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) + { + await JsonWriter.FlushAsync().ConfigureAwait(false); + await _content.WriteToAsync(stream, cancellationToken).ConfigureAwait(false); + } + + public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) + { + JsonWriter.Flush(); + _content.WriteTo(stream, cancellationToken); + } + + public override bool TryComputeLength(out long length) + { + length = JsonWriter.BytesCommitted + JsonWriter.BytesPending; + return true; + } + + public override void Dispose() + { + JsonWriter.Dispose(); + _content.Dispose(); + _stream.Dispose(); + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/MessagingEventGridNamespacesClientBuilderExtensions.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/MessagingEventGridNamespacesClientBuilderExtensions.cs new file mode 100644 index 000000000000..e710c7ce03c9 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/MessagingEventGridNamespacesClientBuilderExtensions.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure; +using Azure.Core.Extensions; +using Azure.Messaging.EventGrid.Namespaces; + +namespace Microsoft.Extensions.Azure +{ + /// Extension methods to add , to client builder. + public static partial class MessagingEventGridNamespacesClientBuilderExtensions + { + /// Registers a instance. + /// The builder to register with. + /// The host name of the namespace, e.g. namespaceName1.westus-1.eventgrid.azure.net. + /// A credential used to authenticate to an Azure Service. + public static IAzureClientBuilder AddEventGridSenderClient(this TBuilder builder, Uri endpoint, AzureKeyCredential credential) + where TBuilder : IAzureClientFactoryBuilder + { + return builder.RegisterClientFactory((options) => new EventGridSenderClient(endpoint, credential, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// The host name of the namespace, e.g. namespaceName1.westus-1.eventgrid.azure.net. + public static IAzureClientBuilder AddEventGridSenderClient(this TBuilder builder, Uri endpoint) + where TBuilder : IAzureClientFactoryBuilderWithCredential + { + return builder.RegisterClientFactory((options, cred) => new EventGridSenderClient(endpoint, cred, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// The host name of the namespace, e.g. namespaceName1.westus-1.eventgrid.azure.net. + /// A credential used to authenticate to an Azure Service. + public static IAzureClientBuilder AddEventGridReceiverClient(this TBuilder builder, Uri endpoint, AzureKeyCredential credential) + where TBuilder : IAzureClientFactoryBuilder + { + return builder.RegisterClientFactory((options) => new EventGridReceiverClient(endpoint, credential, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// The host name of the namespace, e.g. namespaceName1.westus-1.eventgrid.azure.net. + public static IAzureClientBuilder AddEventGridReceiverClient(this TBuilder builder, Uri endpoint) + where TBuilder : IAzureClientFactoryBuilderWithCredential + { + return builder.RegisterClientFactory((options, cred) => new EventGridReceiverClient(endpoint, cred, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// The configuration values. + public static IAzureClientBuilder AddEventGridSenderClient(this TBuilder builder, TConfiguration configuration) + where TBuilder : IAzureClientFactoryBuilderWithConfiguration + { + return builder.RegisterClientFactory(configuration); + } + /// Registers a instance. + /// The builder to register with. + /// The configuration values. + public static IAzureClientBuilder AddEventGridReceiverClient(this TBuilder builder, TConfiguration configuration) + where TBuilder : IAzureClientFactoryBuilderWithConfiguration + { + return builder.RegisterClientFactory(configuration); + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/MessagingEventGridNamespacesModelFactory.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/MessagingEventGridNamespacesModelFactory.cs new file mode 100644 index 000000000000..f78936f09961 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/MessagingEventGridNamespacesModelFactory.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + /// Model factory for models. + public static partial class MessagingEventGridNamespacesModelFactory + { + /// Initializes a new instance of . + /// Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). + /// Array of lock tokens for the successfully acknowledged cloud events. + /// A new instance for mocking. + public static AcknowledgeResult AcknowledgeResult(IEnumerable failedLockTokens = null, IEnumerable succeededLockTokens = null) + { + failedLockTokens ??= new List(); + succeededLockTokens ??= new List(); + + return new AcknowledgeResult(failedLockTokens?.ToList(), succeededLockTokens?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The lock token of an entry in the request. + /// Error information of the failed operation result for the lock token in the request. + /// A new instance for mocking. + public static FailedLockToken FailedLockToken(string lockToken = null, ResponseError error = null) + { + return new FailedLockToken(lockToken, error, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). + /// Array of lock tokens for the successfully released cloud events. + /// A new instance for mocking. + public static ReleaseResult ReleaseResult(IEnumerable failedLockTokens = null, IEnumerable succeededLockTokens = null) + { + failedLockTokens ??= new List(); + succeededLockTokens ??= new List(); + + return new ReleaseResult(failedLockTokens?.ToList(), succeededLockTokens?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). + /// Array of lock tokens for the successfully rejected cloud events. + /// A new instance for mocking. + public static RejectResult RejectResult(IEnumerable failedLockTokens = null, IEnumerable succeededLockTokens = null) + { + failedLockTokens ??= new List(); + succeededLockTokens ??= new List(); + + return new RejectResult(failedLockTokens?.ToList(), succeededLockTokens?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). + /// Array of lock tokens for the successfully renewed locks. + /// A new instance for mocking. + public static RenewLocksResult RenewLocksResult(IEnumerable failedLockTokens = null, IEnumerable succeededLockTokens = null) + { + failedLockTokens ??= new List(); + succeededLockTokens ??= new List(); + + return new RenewLocksResult(failedLockTokens?.ToList(), succeededLockTokens?.ToList(), serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/PublishResult.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/PublishResult.Serialization.cs new file mode 100644 index 000000000000..d6a82190d386 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/PublishResult.Serialization.cs @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + internal partial class PublishResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PublishResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + PublishResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PublishResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePublishResult(document.RootElement, options); + } + + internal static PublishResult DeserializePublishResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PublishResult(serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PublishResult)} does not support writing '{options.Format}' format."); + } + } + + PublishResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePublishResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PublishResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static PublishResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializePublishResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListCommands.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/PublishResult.cs similarity index 68% rename from sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListCommands.cs rename to sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/PublishResult.cs index d8d7eb6149b8..1427f94a2dbc 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListCommands.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/PublishResult.cs @@ -8,10 +8,10 @@ using System; using System.Collections.Generic; -namespace Azure.ResourceManager.CosmosDB.Models +namespace Azure.Messaging.EventGrid.Namespaces { - /// List of commands for cluster. - internal partial class ListCommands + /// The result of the Publish operation. + internal partial class PublishResult { /// /// Keeps track of any properties unknown to the library. @@ -45,23 +45,16 @@ internal partial class ListCommands /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal ListCommands() + /// Initializes a new instance of . + internal PublishResult() { - Value = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// Container for array of commands. + /// Initializes a new instance of . /// Keeps track of any properties unknown to the library. - internal ListCommands(IReadOnlyList value, IDictionary serializedAdditionalRawData) + internal PublishResult(IDictionary serializedAdditionalRawData) { - Value = value; _serializedAdditionalRawData = serializedAdditionalRawData; } - - /// Container for array of commands. - [WirePath("value")] - public IReadOnlyList Value { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReceiveDetails.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReceiveDetails.Serialization.cs new file mode 100644 index 000000000000..02d175e5152c --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReceiveDetails.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + internal partial class ReceiveDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReceiveDetails)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("brokerProperties"u8); + writer.WriteObjectValue(BrokerProperties, options); + writer.WritePropertyName("event"u8); + writer.WriteObjectValue(Event, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ReceiveDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReceiveDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeReceiveDetails(document.RootElement, options); + } + + internal static ReceiveDetails DeserializeReceiveDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + BrokerProperties brokerProperties = default; + CloudEvent @event = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("brokerProperties"u8)) + { + brokerProperties = BrokerProperties.DeserializeBrokerProperties(property.Value, options); + continue; + } + if (property.NameEquals("event"u8)) + { + @event = CloudEvent.DeserializeCloudEvent(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ReceiveDetails(brokerProperties, @event, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ReceiveDetails)} does not support writing '{options.Format}' format."); + } + } + + ReceiveDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeReceiveDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ReceiveDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ReceiveDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeReceiveDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReceiveDetails.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReceiveDetails.cs new file mode 100644 index 000000000000..13b99065b26d --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReceiveDetails.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + /// Receive operation details per Cloud Event. + internal partial class ReceiveDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The Event Broker details. + /// Cloud Event details. + /// or is null. + internal ReceiveDetails(BrokerProperties brokerProperties, CloudEvent @event) + { + Argument.AssertNotNull(brokerProperties, nameof(brokerProperties)); + Argument.AssertNotNull(@event, nameof(@event)); + + BrokerProperties = brokerProperties; + Event = @event; + } + + /// Initializes a new instance of . + /// The Event Broker details. + /// Cloud Event details. + /// Keeps track of any properties unknown to the library. + internal ReceiveDetails(BrokerProperties brokerProperties, CloudEvent @event, IDictionary serializedAdditionalRawData) + { + BrokerProperties = brokerProperties; + Event = @event; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ReceiveDetails() + { + } + + /// The Event Broker details. + public BrokerProperties BrokerProperties { get; } + /// Cloud Event details. + public CloudEvent Event { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReceiveResult.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReceiveResult.Serialization.cs new file mode 100644 index 000000000000..d54ddbeb506b --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReceiveResult.Serialization.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + internal partial class ReceiveResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReceiveResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Details) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ReceiveResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReceiveResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeReceiveResult(document.RootElement, options); + } + + internal static ReceiveResult DeserializeReceiveResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ReceiveDetails.DeserializeReceiveDetails(item, options)); + } + value = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ReceiveResult(value, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ReceiveResult)} does not support writing '{options.Format}' format."); + } + } + + ReceiveResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeReceiveResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ReceiveResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ReceiveResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeReceiveResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputPropertiesResource.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReceiveResult.cs similarity index 60% rename from sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputPropertiesResource.cs rename to sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReceiveResult.cs index c964fa9ca2b6..394c066f5f88 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputPropertiesResource.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReceiveResult.cs @@ -8,12 +8,11 @@ using System; using System.Collections.Generic; using System.Linq; -using Azure.ResourceManager.Resources.Models; -namespace Azure.ResourceManager.CosmosDB.Models +namespace Azure.Messaging.EventGrid.Namespaces { - /// Resource to retrieve throughput information for Cosmos DB resource. - public partial class RetrieveThroughputPropertiesResource + /// Details of the Receive operation response. + internal partial class ReceiveResult { /// /// Keeps track of any properties unknown to the library. @@ -47,32 +46,31 @@ public partial class RetrieveThroughputPropertiesResource /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// Array of PhysicalPartitionId objects. - /// is null. - public RetrieveThroughputPropertiesResource(IEnumerable physicalPartitionIds) + /// Initializes a new instance of . + /// Array of receive responses, one per cloud event. + /// is null. + internal ReceiveResult(IEnumerable details) { - Argument.AssertNotNull(physicalPartitionIds, nameof(physicalPartitionIds)); + Argument.AssertNotNull(details, nameof(details)); - PhysicalPartitionIds = physicalPartitionIds.ToList(); + Details = details.ToList(); } - /// Initializes a new instance of . - /// Array of PhysicalPartitionId objects. + /// Initializes a new instance of . + /// Array of receive responses, one per cloud event. /// Keeps track of any properties unknown to the library. - internal RetrieveThroughputPropertiesResource(IList physicalPartitionIds, IDictionary serializedAdditionalRawData) + internal ReceiveResult(IReadOnlyList details, IDictionary serializedAdditionalRawData) { - PhysicalPartitionIds = physicalPartitionIds; + Details = details; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal RetrieveThroughputPropertiesResource() + /// Initializes a new instance of for deserialization. + internal ReceiveResult() { } - /// Array of PhysicalPartitionId objects. - [WirePath("physicalPartitionIds")] - public IList PhysicalPartitionIds { get; } + /// Array of receive responses, one per cloud event. + public IReadOnlyList Details { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RejectRequest.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RejectRequest.Serialization.cs new file mode 100644 index 000000000000..b5c0f789ea08 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RejectRequest.Serialization.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + internal partial class RejectRequest : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RejectRequest)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("lockTokens"u8); + writer.WriteStartArray(); + foreach (var item in LockTokens) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RejectRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RejectRequest)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRejectRequest(document.RootElement, options); + } + + internal static RejectRequest DeserializeRejectRequest(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList lockTokens = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("lockTokens"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + lockTokens = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RejectRequest(lockTokens, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RejectRequest)} does not support writing '{options.Format}' format."); + } + } + + RejectRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRejectRequest(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RejectRequest)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static RejectRequest FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeRejectRequest(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceAssociation.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RejectRequest.cs similarity index 64% rename from sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceAssociation.cs rename to sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RejectRequest.cs index f4875e8731e8..e64cfb88fa65 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceAssociation.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RejectRequest.cs @@ -7,11 +7,12 @@ using System; using System.Collections.Generic; +using System.Linq; -namespace Azure.ResourceManager.CosmosDB.Models +namespace Azure.Messaging.EventGrid.Namespaces { - /// Information about resource association. - public partial class ResourceAssociation + /// The RejectRequest. + internal partial class RejectRequest { /// /// Keeps track of any properties unknown to the library. @@ -45,27 +46,31 @@ public partial class ResourceAssociation /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public ResourceAssociation() + /// Initializes a new instance of . + /// Array of lock tokens. + /// is null. + internal RejectRequest(IEnumerable lockTokens) { + Argument.AssertNotNull(lockTokens, nameof(lockTokens)); + + LockTokens = lockTokens.ToList(); } - /// Initializes a new instance of . - /// Name of the resource association. - /// Access mode of the resource association. + /// Initializes a new instance of . + /// Array of lock tokens. /// Keeps track of any properties unknown to the library. - internal ResourceAssociation(string name, ResourceAssociationAccessMode? accessMode, IDictionary serializedAdditionalRawData) + internal RejectRequest(IReadOnlyList lockTokens, IDictionary serializedAdditionalRawData) { - Name = name; - AccessMode = accessMode; + LockTokens = lockTokens; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Name of the resource association. - [WirePath("name")] - public string Name { get; set; } - /// Access mode of the resource association. - [WirePath("accessMode")] - public ResourceAssociationAccessMode? AccessMode { get; set; } + /// Initializes a new instance of for deserialization. + internal RejectRequest() + { + } + + /// Array of lock tokens. + public IReadOnlyList LockTokens { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RejectResult.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RejectResult.Serialization.cs new file mode 100644 index 000000000000..2e9d4852d1b1 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RejectResult.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + public partial class RejectResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RejectResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("failedLockTokens"u8); + writer.WriteStartArray(); + foreach (var item in FailedLockTokens) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + writer.WritePropertyName("succeededLockTokens"u8); + writer.WriteStartArray(); + foreach (var item in SucceededLockTokens) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RejectResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RejectResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRejectResult(document.RootElement, options); + } + + internal static RejectResult DeserializeRejectResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList failedLockTokens = default; + IReadOnlyList succeededLockTokens = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("failedLockTokens"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FailedLockToken.DeserializeFailedLockToken(item, options)); + } + failedLockTokens = array; + continue; + } + if (property.NameEquals("succeededLockTokens"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + succeededLockTokens = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RejectResult(failedLockTokens, succeededLockTokens, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RejectResult)} does not support writing '{options.Format}' format."); + } + } + + RejectResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRejectResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RejectResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static RejectResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeRejectResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RejectResult.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RejectResult.cs new file mode 100644 index 000000000000..1b8a06457430 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RejectResult.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + /// The result of the Reject operation. + public partial class RejectResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). + /// Array of lock tokens for the successfully rejected cloud events. + /// or is null. + internal RejectResult(IEnumerable failedLockTokens, IEnumerable succeededLockTokens) + { + Argument.AssertNotNull(failedLockTokens, nameof(failedLockTokens)); + Argument.AssertNotNull(succeededLockTokens, nameof(succeededLockTokens)); + + FailedLockTokens = failedLockTokens.ToList(); + SucceededLockTokens = succeededLockTokens.ToList(); + } + + /// Initializes a new instance of . + /// Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). + /// Array of lock tokens for the successfully rejected cloud events. + /// Keeps track of any properties unknown to the library. + internal RejectResult(IReadOnlyList failedLockTokens, IReadOnlyList succeededLockTokens, IDictionary serializedAdditionalRawData) + { + FailedLockTokens = failedLockTokens; + SucceededLockTokens = succeededLockTokens; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal RejectResult() + { + } + + /// Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). + public IReadOnlyList FailedLockTokens { get; } + /// Array of lock tokens for the successfully rejected cloud events. + public IReadOnlyList SucceededLockTokens { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReleaseDelay.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReleaseDelay.cs new file mode 100644 index 000000000000..498243b8a657 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReleaseDelay.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + /// Supported delays for release operation. + public readonly partial struct ReleaseDelay : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ReleaseDelay(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoDelayValue = "0"; + private const string TenSecondsValue = "10"; + private const string OneMinuteValue = "60"; + private const string TenMinutesValue = "600"; + private const string OneHourValue = "3600"; + + /// Release the event after 0 seconds. + public static ReleaseDelay NoDelay { get; } = new ReleaseDelay(NoDelayValue); + /// Release the event after 10 seconds. + public static ReleaseDelay TenSeconds { get; } = new ReleaseDelay(TenSecondsValue); + /// Release the event after 60 seconds. + public static ReleaseDelay OneMinute { get; } = new ReleaseDelay(OneMinuteValue); + /// Release the event after 600 seconds. + public static ReleaseDelay TenMinutes { get; } = new ReleaseDelay(TenMinutesValue); + /// Release the event after 3600 seconds. + public static ReleaseDelay OneHour { get; } = new ReleaseDelay(OneHourValue); + /// Determines if two values are the same. + public static bool operator ==(ReleaseDelay left, ReleaseDelay right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ReleaseDelay left, ReleaseDelay right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ReleaseDelay(string value) => new ReleaseDelay(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ReleaseDelay other && Equals(other); + /// + public bool Equals(ReleaseDelay other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReleaseRequest.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReleaseRequest.Serialization.cs new file mode 100644 index 000000000000..b18dd3aad27e --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReleaseRequest.Serialization.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + internal partial class ReleaseRequest : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReleaseRequest)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("lockTokens"u8); + writer.WriteStartArray(); + foreach (var item in LockTokens) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ReleaseRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReleaseRequest)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeReleaseRequest(document.RootElement, options); + } + + internal static ReleaseRequest DeserializeReleaseRequest(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList lockTokens = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("lockTokens"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + lockTokens = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ReleaseRequest(lockTokens, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ReleaseRequest)} does not support writing '{options.Format}' format."); + } + } + + ReleaseRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeReleaseRequest(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ReleaseRequest)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ReleaseRequest FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeReleaseRequest(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBErrorResult.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReleaseRequest.cs similarity index 62% rename from sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBErrorResult.cs rename to sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReleaseRequest.cs index 39831ff05b05..8081e38d2411 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBErrorResult.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReleaseRequest.cs @@ -7,11 +7,12 @@ using System; using System.Collections.Generic; +using System.Linq; -namespace Azure.ResourceManager.CosmosDB.Models +namespace Azure.Messaging.EventGrid.Namespaces { - /// Error Response. - public partial class CosmosDBErrorResult + /// The ReleaseRequest. + internal partial class ReleaseRequest { /// /// Keeps track of any properties unknown to the library. @@ -45,27 +46,31 @@ public partial class CosmosDBErrorResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal CosmosDBErrorResult() + /// Initializes a new instance of . + /// Array of lock tokens. + /// is null. + internal ReleaseRequest(IEnumerable lockTokens) { + Argument.AssertNotNull(lockTokens, nameof(lockTokens)); + + LockTokens = lockTokens.ToList(); } - /// Initializes a new instance of . - /// Error code. - /// Error message indicating why the operation failed. + /// Initializes a new instance of . + /// Array of lock tokens. /// Keeps track of any properties unknown to the library. - internal CosmosDBErrorResult(string code, string message, IDictionary serializedAdditionalRawData) + internal ReleaseRequest(IReadOnlyList lockTokens, IDictionary serializedAdditionalRawData) { - Code = code; - Message = message; + LockTokens = lockTokens; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Error code. - [WirePath("code")] - public string Code { get; } - /// Error message indicating why the operation failed. - [WirePath("message")] - public string Message { get; } + /// Initializes a new instance of for deserialization. + internal ReleaseRequest() + { + } + + /// Array of lock tokens. + public IReadOnlyList LockTokens { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReleaseResult.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReleaseResult.Serialization.cs new file mode 100644 index 000000000000..a4a27af1a013 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReleaseResult.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + public partial class ReleaseResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReleaseResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("failedLockTokens"u8); + writer.WriteStartArray(); + foreach (var item in FailedLockTokens) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + writer.WritePropertyName("succeededLockTokens"u8); + writer.WriteStartArray(); + foreach (var item in SucceededLockTokens) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ReleaseResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReleaseResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeReleaseResult(document.RootElement, options); + } + + internal static ReleaseResult DeserializeReleaseResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList failedLockTokens = default; + IReadOnlyList succeededLockTokens = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("failedLockTokens"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FailedLockToken.DeserializeFailedLockToken(item, options)); + } + failedLockTokens = array; + continue; + } + if (property.NameEquals("succeededLockTokens"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + succeededLockTokens = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ReleaseResult(failedLockTokens, succeededLockTokens, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ReleaseResult)} does not support writing '{options.Format}' format."); + } + } + + ReleaseResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeReleaseResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ReleaseResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ReleaseResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeReleaseResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReleaseResult.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReleaseResult.cs new file mode 100644 index 000000000000..a12f10dc025a --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/ReleaseResult.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + /// The result of the Release operation. + public partial class ReleaseResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). + /// Array of lock tokens for the successfully released cloud events. + /// or is null. + internal ReleaseResult(IEnumerable failedLockTokens, IEnumerable succeededLockTokens) + { + Argument.AssertNotNull(failedLockTokens, nameof(failedLockTokens)); + Argument.AssertNotNull(succeededLockTokens, nameof(succeededLockTokens)); + + FailedLockTokens = failedLockTokens.ToList(); + SucceededLockTokens = succeededLockTokens.ToList(); + } + + /// Initializes a new instance of . + /// Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). + /// Array of lock tokens for the successfully released cloud events. + /// Keeps track of any properties unknown to the library. + internal ReleaseResult(IReadOnlyList failedLockTokens, IReadOnlyList succeededLockTokens, IDictionary serializedAdditionalRawData) + { + FailedLockTokens = failedLockTokens; + SucceededLockTokens = succeededLockTokens; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ReleaseResult() + { + } + + /// Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). + public IReadOnlyList FailedLockTokens { get; } + /// Array of lock tokens for the successfully released cloud events. + public IReadOnlyList SucceededLockTokens { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RenewLocksRequest.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RenewLocksRequest.Serialization.cs new file mode 100644 index 000000000000..65ebd81a6091 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RenewLocksRequest.Serialization.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + internal partial class RenewLocksRequest : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RenewLocksRequest)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("lockTokens"u8); + writer.WriteStartArray(); + foreach (var item in LockTokens) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RenewLocksRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RenewLocksRequest)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRenewLocksRequest(document.RootElement, options); + } + + internal static RenewLocksRequest DeserializeRenewLocksRequest(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList lockTokens = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("lockTokens"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + lockTokens = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RenewLocksRequest(lockTokens, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RenewLocksRequest)} does not support writing '{options.Format}' format."); + } + } + + RenewLocksRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRenewLocksRequest(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RenewLocksRequest)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static RenewLocksRequest FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeRenewLocksRequest(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListBackups.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RenewLocksRequest.cs similarity index 59% rename from sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListBackups.cs rename to sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RenewLocksRequest.cs index c829eb59141a..60ac0dd1be38 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListBackups.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RenewLocksRequest.cs @@ -7,11 +7,12 @@ using System; using System.Collections.Generic; +using System.Linq; -namespace Azure.ResourceManager.CosmosDB.Models +namespace Azure.Messaging.EventGrid.Namespaces { - /// List of restorable backups for a Cassandra cluster. - internal partial class ListBackups + /// The RenewLocksRequest. + internal partial class RenewLocksRequest { /// /// Keeps track of any properties unknown to the library. @@ -45,22 +46,31 @@ internal partial class ListBackups /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal ListBackups() + /// Initializes a new instance of . + /// Array of lock tokens. + /// is null. + internal RenewLocksRequest(IEnumerable lockTokens) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(lockTokens, nameof(lockTokens)); + + LockTokens = lockTokens.ToList(); } - /// Initializes a new instance of . - /// Container for array of backups. + /// Initializes a new instance of . + /// Array of lock tokens. /// Keeps track of any properties unknown to the library. - internal ListBackups(IReadOnlyList value, IDictionary serializedAdditionalRawData) + internal RenewLocksRequest(IReadOnlyList lockTokens, IDictionary serializedAdditionalRawData) { - Value = value; + LockTokens = lockTokens; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Container for array of backups. - public IReadOnlyList Value { get; } + /// Initializes a new instance of for deserialization. + internal RenewLocksRequest() + { + } + + /// Array of lock tokens. + public IReadOnlyList LockTokens { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RenewLocksResult.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RenewLocksResult.Serialization.cs new file mode 100644 index 000000000000..f96a0e876430 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RenewLocksResult.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + public partial class RenewLocksResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RenewLocksResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("failedLockTokens"u8); + writer.WriteStartArray(); + foreach (var item in FailedLockTokens) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + writer.WritePropertyName("succeededLockTokens"u8); + writer.WriteStartArray(); + foreach (var item in SucceededLockTokens) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RenewLocksResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RenewLocksResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRenewLocksResult(document.RootElement, options); + } + + internal static RenewLocksResult DeserializeRenewLocksResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList failedLockTokens = default; + IReadOnlyList succeededLockTokens = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("failedLockTokens"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FailedLockToken.DeserializeFailedLockToken(item, options)); + } + failedLockTokens = array; + continue; + } + if (property.NameEquals("succeededLockTokens"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + succeededLockTokens = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RenewLocksResult(failedLockTokens, succeededLockTokens, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RenewLocksResult)} does not support writing '{options.Format}' format."); + } + } + + RenewLocksResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRenewLocksResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RenewLocksResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static RenewLocksResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeRenewLocksResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RenewLocksResult.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RenewLocksResult.cs new file mode 100644 index 000000000000..5f3f38c60eff --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Generated/RenewLocksResult.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Messaging.EventGrid.Namespaces +{ + /// The result of the RenewLock operation. + public partial class RenewLocksResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). + /// Array of lock tokens for the successfully renewed locks. + /// or is null. + internal RenewLocksResult(IEnumerable failedLockTokens, IEnumerable succeededLockTokens) + { + Argument.AssertNotNull(failedLockTokens, nameof(failedLockTokens)); + Argument.AssertNotNull(succeededLockTokens, nameof(succeededLockTokens)); + + FailedLockTokens = failedLockTokens.ToList(); + SucceededLockTokens = succeededLockTokens.ToList(); + } + + /// Initializes a new instance of . + /// Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). + /// Array of lock tokens for the successfully renewed locks. + /// Keeps track of any properties unknown to the library. + internal RenewLocksResult(IReadOnlyList failedLockTokens, IReadOnlyList succeededLockTokens, IDictionary serializedAdditionalRawData) + { + FailedLockTokens = failedLockTokens; + SucceededLockTokens = succeededLockTokens; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal RenewLocksResult() + { + } + + /// Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). + public IReadOnlyList FailedLockTokens { get; } + /// Array of lock tokens for the successfully renewed locks. + public IReadOnlyList SucceededLockTokens { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Properties/AssemblyInfo.cs b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..d5b2dd2228ed --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/src/Properties/AssemblyInfo.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Azure.Messaging.EventGrid.Namespaces.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] + +// Replace Microsoft.Test with the correct resource provider namepace for your service and uncomment. +// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers +// for the list of possible values. +[assembly: Azure.Core.AzureResourceProviderNamespace("Microsoft.Template")] diff --git a/sdk/eventgrid/Azure.Messaging.EventGridV2/tsp-location.yaml b/sdk/eventgrid/Azure.Messaging.EventGridV2/tsp-location.yaml new file mode 100644 index 000000000000..b5850b6909f7 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGridV2/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/eventgrid/Azure.Messaging.EventGrid +commit: 75af203a2e61f012df7acb36ecc7c5febe878a2d +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/RestOperations/FabricCapacitiesRestOperations.cs b/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/RestOperations/FabricCapacitiesRestOperations.cs index 92f198ab1e48..7436cef1459d 100644 --- a/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/RestOperations/FabricCapacitiesRestOperations.cs +++ b/sdk/fabric/Azure.ResourceManager.Fabric/src/Generated/RestOperations/FabricCapacitiesRestOperations.cs @@ -618,6 +618,7 @@ public async Task ResumeAsync(string subscriptionId, string resourceGr switch (message.Response.Status) { case 202: + case 200: return message.Response; default: throw new RequestFailedException(message.Response); @@ -642,6 +643,7 @@ public Response Resume(string subscriptionId, string resourceGroupName, string c switch (message.Response.Status) { case 202: + case 200: return message.Response; default: throw new RequestFailedException(message.Response); @@ -702,6 +704,7 @@ public async Task SuspendAsync(string subscriptionId, string resourceG switch (message.Response.Status) { case 202: + case 200: return message.Response; default: throw new RequestFailedException(message.Response); @@ -726,6 +729,7 @@ public Response Suspend(string subscriptionId, string resourceGroupName, string switch (message.Response.Status) { case 202: + case 200: return message.Response; default: throw new RequestFailedException(message.Response); diff --git a/sdk/fabric/Azure.ResourceManager.Fabric/tsp-location.yaml b/sdk/fabric/Azure.ResourceManager.Fabric/tsp-location.yaml index 0544d66822a9..39ffcb43dae9 100644 --- a/sdk/fabric/Azure.ResourceManager.Fabric/tsp-location.yaml +++ b/sdk/fabric/Azure.ResourceManager.Fabric/tsp-location.yaml @@ -1,3 +1,4 @@ directory: specification/fabric/Microsoft.Fabric.Management -commit: 2812cf7809bf4ebb00edcbba09a2af1d74ad7d76 +commit: 75af203a2e61f012df7acb36ecc7c5febe878a2d repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tsp-location.yaml b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tsp-location.yaml index 987ea6420462..a4b58fcca30c 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tsp-location.yaml +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tsp-location.yaml @@ -1,3 +1,4 @@ -directory: specification\mongocluster\DocumentDB.MongoCluster.Management -commit: 019e40050a0477d1b973ae91e0be68c96bcf3cce -repo: Azure/azure-rest-api-specs \ No newline at end of file +directory: specification/mongocluster/DocumentDB.MongoCluster.Management +commit: 75af203a2e61f012df7acb36ecc7c5febe878a2d +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/Azure.Communication.ProgrammableConnectivity.sln b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/Azure.Communication.ProgrammableConnectivity.sln new file mode 100644 index 000000000000..fc1ee5156b11 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/Azure.Communication.ProgrammableConnectivity.sln @@ -0,0 +1,56 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework", "..\..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{ECC730C1-4AEA-420C-916A-66B19B79E4DC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Communication.ProgrammableConnectivity", "src\Azure.Communication.ProgrammableConnectivity.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Communication.ProgrammableConnectivity.Tests", "tests\Azure.Communication.ProgrammableConnectivity.Tests.csproj", "{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/CHANGELOG.md b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/CHANGELOG.md new file mode 100644 index 000000000000..13dd08af78ab --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/Directory.Build.props b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/Directory.Build.props new file mode 100644 index 000000000000..63bd836ad44b --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/README.md b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/README.md new file mode 100644 index 000000000000..84978564a517 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/README.md @@ -0,0 +1,107 @@ +# Azure.Communication.ProgrammableConnectivity client library for .NET + +Azure.Communication.ProgrammableConnectivity is a managed service that helps developers get secret simply and securely. + +Use the client library for to: + +* [Get secret](https://docs.microsoft.com/azure) + +[Source code][source_root] | [Package (NuGet)][package] | [API reference documentation][reference_docs] | [Product documentation][azconfig_docs] | [Samples][source_samples] + + [Source code](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src) | [Package (NuGet)](https://www.nuget.org/packages) | [API reference documentation](https://azure.github.io/azure-sdk-for-net) | [Product documentation](https://docs.microsoft.com/azure) + +## Getting started + +This section should include everything a developer needs to do to install and create their first client connection *very quickly*. + +### Install the package + +First, provide instruction for obtaining and installing the package or library. This section might include only a single line of code, like `dotnet add package package-name`, but should enable a developer to successfully install the package from NuGet, npm, or even cloning a GitHub repository. + +Install the client library for .NET with [NuGet](https://www.nuget.org/ ): + +```dotnetcli +dotnet add package Azure.Communication.ProgrammableConnectivity --prerelease +``` + +### Prerequisites + +Include a section after the install command that details any requirements that must be satisfied before a developer can [authenticate](#authenticate-the-client) and test all of the snippets in the [Examples](#examples) section. For example, for Cosmos DB: + +> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and [Cosmos DB account](https://docs.microsoft.com/azure/cosmos-db/account-overview) (SQL API). In order to take advantage of the C# 8.0 syntax, it is recommended that you compile using the [.NET Core SDK](https://dotnet.microsoft.com/download) 3.0 or higher with a [language version](https://docs.microsoft.com/dotnet/csharp/language-reference/configure-language-version#override-a-default) of `latest`. It is also possible to compile with the .NET Core SDK 2.1.x using a language version of `preview`. + +### Authenticate the client + +If your library requires authentication for use, such as for Azure services, include instructions and example code needed for initializing and authenticating. + +For example, include details on obtaining an account key and endpoint URI, setting environment variables for each, and initializing the client object. + +### Service API versions + +The client library targets the latest service API version by default. A client instance accepts an optional service API version parameter from its options to specify which API version service to communicate. + +#### Select a service API version + +You have the flexibility to explicitly select a supported service API version when instantiating a client by configuring its associated options. This ensures that the client can communicate with services using the specified API version. + +For example, + +```C# Snippet:CreateClientForSpecificApiVersion +Uri endpoint = new Uri(""); +DefaultAzureCredential credential = new DefaultAzureCredential(); +ClientOptions options = new ClientOptions(ClientOptions.ServiceVersion.) +var client = new Client(endpoint, credential, options); +``` + +When selecting an API version, it's important to verify that there are no breaking changes compared to the latest API version. If there are significant differences, API calls may fail due to incompatibility. + +Always ensure that the chosen API version is fully supported and operational for your specific use case and that it aligns with the service's versioning policy. + +## Key concepts + +The *Key concepts* section should describe the functionality of the main classes. Point out the most important and useful classes in the package (with links to their reference pages) and explain how those classes work together. Feel free to use bulleted lists, tables, code blocks, or even diagrams for clarity. + +Include the *Thread safety* and *Additional concepts* sections below at the end of your *Key concepts* section. You may remove or add links depending on what your library makes use of: + +### Thread safety + +We guarantee that all client instance methods are thread-safe and independent of each other ([guideline](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-service-methods-thread-safety)). This ensures that the recommendation of reusing client instances is always safe, even across threads. + +### Additional concepts + +[Client options](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#configuring-service-clients-using-clientoptions) | +[Accessing the response](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#accessing-http-response-details-using-responset) | +[Long-running operations](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#consuming-long-running-operations-using-operationt) | +[Handling failures](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#reporting-errors-requestfailedexception) | +[Diagnostics](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md) | +[Mocking](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#mocking) | +[Client lifetime](https://devblogs.microsoft.com/azure-sdk/lifetime-management-and-thread-safety-guarantees-of-azure-sdk-net-clients/) + + +## Examples + +You can familiarize yourself with different APIs using [Samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/samples). + +## Troubleshooting + +Describe common errors and exceptions, how to "unpack" them if necessary, and include guidance for graceful handling and recovery. + +Provide information to help developers avoid throttling or other service-enforced errors they might encounter. For example, provide guidance and examples for using retry or connection policies in the API. + +If the package or a related package supports it, include tips for logging or enabling instrumentation to help them debug their code. + +## Next steps + +* Provide a link to additional code examples, ideally to those sitting alongside the README in the package's `/samples` directory. +* If appropriate, point users to other packages that might be useful. +* If you think there's a good chance that developers might stumble across your package in error (because they're searching for specific functionality and mistakenly think the package provides that functionality), point them to the packages they might be looking for. + +## Contributing + +This is a template, but your SDK readme should include details on how to contribute code to the repo/package. + + +[style-guide-msft]: https://docs.microsoft.com/style-guide/capitalization +[style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/README.png) diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/api/Azure.Communication.ProgrammableConnectivity.netstandard2.0.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/api/Azure.Communication.ProgrammableConnectivity.netstandard2.0.cs new file mode 100644 index 000000000000..86b3cbb0da7b --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/api/Azure.Communication.ProgrammableConnectivity.netstandard2.0.cs @@ -0,0 +1,241 @@ +namespace Azure.Communication.ProgrammableConnectivity +{ + public static partial class CommunicationProgrammableConnectivityModelFactory + { + public static Azure.Communication.ProgrammableConnectivity.DeviceLocationVerificationResult DeviceLocationVerificationResult(bool verificationResult = false) { throw null; } + public static Azure.Communication.ProgrammableConnectivity.NetworkRetrievalResult NetworkRetrievalResult(string networkCode = null) { throw null; } + public static Azure.Communication.ProgrammableConnectivity.NumberVerificationResult NumberVerificationResult(bool verificationResult = false) { throw null; } + public static Azure.Communication.ProgrammableConnectivity.NumberVerificationWithoutCodeContent NumberVerificationWithoutCodeContent(Azure.Communication.ProgrammableConnectivity.NetworkIdentifier networkIdentifier = null, string phoneNumber = null, string hashedPhoneNumber = null, System.Uri redirectUri = null) { throw null; } + public static Azure.Communication.ProgrammableConnectivity.SimSwapRetrievalContent SimSwapRetrievalContent(string phoneNumber = null, Azure.Communication.ProgrammableConnectivity.NetworkIdentifier networkIdentifier = null) { throw null; } + public static Azure.Communication.ProgrammableConnectivity.SimSwapRetrievalResult SimSwapRetrievalResult(System.DateTimeOffset? date = default(System.DateTimeOffset?)) { throw null; } + public static Azure.Communication.ProgrammableConnectivity.SimSwapVerificationContent SimSwapVerificationContent(string phoneNumber = null, int? maxAgeHours = default(int?), Azure.Communication.ProgrammableConnectivity.NetworkIdentifier networkIdentifier = null) { throw null; } + public static Azure.Communication.ProgrammableConnectivity.SimSwapVerificationResult SimSwapVerificationResult(bool verificationResult = false) { throw null; } + } + public partial class DeviceLocation + { + protected DeviceLocation() { } + public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } + public virtual Azure.Response Verify(string apcGatewayId, Azure.Communication.ProgrammableConnectivity.DeviceLocationVerificationContent body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Verify(string apcGatewayId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> VerifyAsync(string apcGatewayId, Azure.Communication.ProgrammableConnectivity.DeviceLocationVerificationContent body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task VerifyAsync(string apcGatewayId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + } + public partial class DeviceLocationVerificationContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeviceLocationVerificationContent(Azure.Communication.ProgrammableConnectivity.NetworkIdentifier networkIdentifier, double latitude, double longitude, int accuracy, Azure.Communication.ProgrammableConnectivity.LocationDevice device) { } + public int Accuracy { get { throw null; } } + public Azure.Communication.ProgrammableConnectivity.LocationDevice Device { get { throw null; } } + public double Latitude { get { throw null; } } + public double Longitude { get { throw null; } } + public Azure.Communication.ProgrammableConnectivity.NetworkIdentifier NetworkIdentifier { get { throw null; } } + Azure.Communication.ProgrammableConnectivity.DeviceLocationVerificationContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.ProgrammableConnectivity.DeviceLocationVerificationContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceLocationVerificationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DeviceLocationVerificationResult() { } + public bool VerificationResult { get { throw null; } } + Azure.Communication.ProgrammableConnectivity.DeviceLocationVerificationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.ProgrammableConnectivity.DeviceLocationVerificationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeviceNetwork + { + protected DeviceNetwork() { } + public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } + public virtual Azure.Response Retrieve(string apcGatewayId, Azure.Communication.ProgrammableConnectivity.NetworkIdentifier body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Retrieve(string apcGatewayId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> RetrieveAsync(string apcGatewayId, Azure.Communication.ProgrammableConnectivity.NetworkIdentifier body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task RetrieveAsync(string apcGatewayId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + } + public partial class Ipv4Address : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public Ipv4Address(string ipv4, int port) { } + public string Ipv4 { get { throw null; } } + public int Port { get { throw null; } } + Azure.Communication.ProgrammableConnectivity.Ipv4Address System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.ProgrammableConnectivity.Ipv4Address System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class Ipv6Address : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public Ipv6Address(string ipv6, int port) { } + public string Ipv6 { get { throw null; } } + public int Port { get { throw null; } } + Azure.Communication.ProgrammableConnectivity.Ipv6Address System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.ProgrammableConnectivity.Ipv6Address System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class LocationDevice : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public LocationDevice() { } + public Azure.Communication.ProgrammableConnectivity.Ipv4Address Ipv4Address { get { throw null; } set { } } + public Azure.Communication.ProgrammableConnectivity.Ipv6Address Ipv6Address { get { throw null; } set { } } + public string NetworkAccessIdentifier { get { throw null; } set { } } + public string PhoneNumber { get { throw null; } set { } } + Azure.Communication.ProgrammableConnectivity.LocationDevice System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.ProgrammableConnectivity.LocationDevice System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NetworkIdentifier : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NetworkIdentifier(string identifierType, string identifier) { } + public string Identifier { get { throw null; } } + public string IdentifierType { get { throw null; } } + Azure.Communication.ProgrammableConnectivity.NetworkIdentifier System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.ProgrammableConnectivity.NetworkIdentifier System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NetworkRetrievalResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NetworkRetrievalResult() { } + public string NetworkCode { get { throw null; } } + Azure.Communication.ProgrammableConnectivity.NetworkRetrievalResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.ProgrammableConnectivity.NetworkRetrievalResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NumberVerification + { + protected NumberVerification() { } + public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } + public virtual Azure.Response VerifyWithCode(string apcGatewayId, Azure.Communication.ProgrammableConnectivity.NumberVerificationWithCodeContent body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response VerifyWithCode(string apcGatewayId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> VerifyWithCodeAsync(string apcGatewayId, Azure.Communication.ProgrammableConnectivity.NumberVerificationWithCodeContent body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task VerifyWithCodeAsync(string apcGatewayId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response VerifyWithoutCode(string apcGatewayId, Azure.Communication.ProgrammableConnectivity.NumberVerificationWithoutCodeContent body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response VerifyWithoutCode(string apcGatewayId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task VerifyWithoutCodeAsync(string apcGatewayId, Azure.Communication.ProgrammableConnectivity.NumberVerificationWithoutCodeContent body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task VerifyWithoutCodeAsync(string apcGatewayId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + } + public partial class NumberVerificationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NumberVerificationResult() { } + public bool VerificationResult { get { throw null; } } + Azure.Communication.ProgrammableConnectivity.NumberVerificationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.ProgrammableConnectivity.NumberVerificationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NumberVerificationWithCodeContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NumberVerificationWithCodeContent(string apcCode) { } + public string ApcCode { get { throw null; } } + Azure.Communication.ProgrammableConnectivity.NumberVerificationWithCodeContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.ProgrammableConnectivity.NumberVerificationWithCodeContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NumberVerificationWithoutCodeContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NumberVerificationWithoutCodeContent(Azure.Communication.ProgrammableConnectivity.NetworkIdentifier networkIdentifier, System.Uri redirectUri) { } + public string HashedPhoneNumber { get { throw null; } set { } } + public Azure.Communication.ProgrammableConnectivity.NetworkIdentifier NetworkIdentifier { get { throw null; } } + public string PhoneNumber { get { throw null; } set { } } + public System.Uri RedirectUri { get { throw null; } } + Azure.Communication.ProgrammableConnectivity.NumberVerificationWithoutCodeContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.ProgrammableConnectivity.NumberVerificationWithoutCodeContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ProgrammableConnectivityClient + { + protected ProgrammableConnectivityClient() { } + public ProgrammableConnectivityClient(System.Uri endpoint, Azure.Core.TokenCredential credential) { } + public ProgrammableConnectivityClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.Communication.ProgrammableConnectivity.ProgrammableConnectivityClientOptions options) { } + public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } + public virtual Azure.Communication.ProgrammableConnectivity.DeviceLocation GetDeviceLocationClient(string apiVersion = "2024-02-09-preview") { throw null; } + public virtual Azure.Communication.ProgrammableConnectivity.DeviceNetwork GetDeviceNetworkClient(string apiVersion = "2024-02-09-preview") { throw null; } + public virtual Azure.Communication.ProgrammableConnectivity.NumberVerification GetNumberVerificationClient(string apiVersion = "2024-02-09-preview") { throw null; } + public virtual Azure.Communication.ProgrammableConnectivity.SimSwap GetSimSwapClient(string apiVersion = "2024-02-09-preview") { throw null; } + } + public partial class ProgrammableConnectivityClientOptions : Azure.Core.ClientOptions + { + public ProgrammableConnectivityClientOptions(Azure.Communication.ProgrammableConnectivity.ProgrammableConnectivityClientOptions.ServiceVersion version = Azure.Communication.ProgrammableConnectivity.ProgrammableConnectivityClientOptions.ServiceVersion.V2024_02_09_Preview) { } + public enum ServiceVersion + { + V2024_02_09_Preview = 1, + } + } + public partial class SimSwap + { + protected SimSwap() { } + public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } + public virtual Azure.Response Retrieve(string apcGatewayId, Azure.Communication.ProgrammableConnectivity.SimSwapRetrievalContent body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Retrieve(string apcGatewayId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> RetrieveAsync(string apcGatewayId, Azure.Communication.ProgrammableConnectivity.SimSwapRetrievalContent body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task RetrieveAsync(string apcGatewayId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response Verify(string apcGatewayId, Azure.Communication.ProgrammableConnectivity.SimSwapVerificationContent body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Verify(string apcGatewayId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> VerifyAsync(string apcGatewayId, Azure.Communication.ProgrammableConnectivity.SimSwapVerificationContent body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task VerifyAsync(string apcGatewayId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + } + public partial class SimSwapRetrievalContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SimSwapRetrievalContent(Azure.Communication.ProgrammableConnectivity.NetworkIdentifier networkIdentifier) { } + public Azure.Communication.ProgrammableConnectivity.NetworkIdentifier NetworkIdentifier { get { throw null; } } + public string PhoneNumber { get { throw null; } set { } } + Azure.Communication.ProgrammableConnectivity.SimSwapRetrievalContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.ProgrammableConnectivity.SimSwapRetrievalContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SimSwapRetrievalResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SimSwapRetrievalResult() { } + public System.DateTimeOffset? Date { get { throw null; } } + Azure.Communication.ProgrammableConnectivity.SimSwapRetrievalResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.ProgrammableConnectivity.SimSwapRetrievalResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SimSwapVerificationContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SimSwapVerificationContent(Azure.Communication.ProgrammableConnectivity.NetworkIdentifier networkIdentifier) { } + public int? MaxAgeHours { get { throw null; } set { } } + public Azure.Communication.ProgrammableConnectivity.NetworkIdentifier NetworkIdentifier { get { throw null; } } + public string PhoneNumber { get { throw null; } set { } } + Azure.Communication.ProgrammableConnectivity.SimSwapVerificationContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.ProgrammableConnectivity.SimSwapVerificationContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SimSwapVerificationResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SimSwapVerificationResult() { } + public bool VerificationResult { get { throw null; } } + Azure.Communication.ProgrammableConnectivity.SimSwapVerificationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Communication.ProgrammableConnectivity.SimSwapVerificationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +} +namespace Microsoft.Extensions.Azure +{ + public static partial class CommunicationProgrammableConnectivityClientBuilderExtensions + { + public static Azure.Core.Extensions.IAzureClientBuilder AddProgrammableConnectivityClient(this TBuilder builder, System.Uri endpoint) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithCredential { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddProgrammableConnectivityClient(this TBuilder builder, TConfiguration configuration) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithConfiguration { throw null; } + } +} diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Azure.Communication.ProgrammableConnectivity.csproj b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Azure.Communication.ProgrammableConnectivity.csproj new file mode 100644 index 000000000000..a3206b8c2f96 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Azure.Communication.ProgrammableConnectivity.csproj @@ -0,0 +1,19 @@ + + + This is the Azure.Communication.ProgrammableConnectivity client library for developing .NET applications with rich experience. + Azure SDK Code Generation Azure.Communication.ProgrammableConnectivity for Azure Data Plane + 1.0.0-beta.1 + Azure.Communication.ProgrammableConnectivity + $(RequiredTargetFrameworks) + true + + + + + + + + + + + diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/CommunicationProgrammableConnectivityClientBuilderExtensions.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/CommunicationProgrammableConnectivityClientBuilderExtensions.cs new file mode 100644 index 000000000000..e5e56416b03c --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/CommunicationProgrammableConnectivityClientBuilderExtensions.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Communication.ProgrammableConnectivity; +using Azure.Core.Extensions; + +namespace Microsoft.Extensions.Azure +{ + /// Extension methods to add to client builder. + public static partial class CommunicationProgrammableConnectivityClientBuilderExtensions + { + /// Registers a instance. + /// The builder to register with. + /// An Azure Programmable Connectivity Endpoint providing access to Network APIs, for example https://{region}.apcgatewayapi.azure.com. + public static IAzureClientBuilder AddProgrammableConnectivityClient(this TBuilder builder, Uri endpoint) + where TBuilder : IAzureClientFactoryBuilderWithCredential + { + return builder.RegisterClientFactory((options, cred) => new ProgrammableConnectivityClient(endpoint, cred, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// The configuration values. + public static IAzureClientBuilder AddProgrammableConnectivityClient(this TBuilder builder, TConfiguration configuration) + where TBuilder : IAzureClientFactoryBuilderWithConfiguration + { + return builder.RegisterClientFactory(configuration); + } + } +} diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/CommunicationProgrammableConnectivityModelFactory.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/CommunicationProgrammableConnectivityModelFactory.cs new file mode 100644 index 000000000000..10a3a049d2e7 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/CommunicationProgrammableConnectivityModelFactory.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Communication.ProgrammableConnectivity +{ + /// Model factory for models. + public static partial class CommunicationProgrammableConnectivityModelFactory + { + /// Initializes a new instance of . + /// Phone number in E.164 format (starting with country code), and optionally prefixed with '+'. + /// Network to query for this device. + /// A new instance for mocking. + public static SimSwapRetrievalContent SimSwapRetrievalContent(string phoneNumber = null, NetworkIdentifier networkIdentifier = null) + { + return new SimSwapRetrievalContent(phoneNumber, networkIdentifier, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Datetime of most recent swap for SIM. + /// A new instance for mocking. + public static SimSwapRetrievalResult SimSwapRetrievalResult(DateTimeOffset? date = null) + { + return new SimSwapRetrievalResult(date, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Phone number in E.164 format (starting with country code), and optionally prefixed with '+'. + /// Maximum lookback for SimSwap verification. + /// Identifier for the network to query for this device. + /// A new instance for mocking. + public static SimSwapVerificationContent SimSwapVerificationContent(string phoneNumber = null, int? maxAgeHours = null, NetworkIdentifier networkIdentifier = null) + { + return new SimSwapVerificationContent(phoneNumber, maxAgeHours, networkIdentifier, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// True if the SIM has swapped in the specified period, False otherwise. + /// A new instance for mocking. + public static SimSwapVerificationResult SimSwapVerificationResult(bool verificationResult = default) + { + return new SimSwapVerificationResult(verificationResult, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Identifier for the network to query for this device. + /// Phone number in E.164 format (starting with country code), and optionally prefixed with '+'. + /// Hashed phone number. SHA-256 (in hexadecimal representation) of the mobile phone number in **E.164 format (starting with country code)**. Optionally prefixed with '+'. + /// Redirect URI to backend application. + /// A new instance for mocking. + public static NumberVerificationWithoutCodeContent NumberVerificationWithoutCodeContent(NetworkIdentifier networkIdentifier = null, string phoneNumber = null, string hashedPhoneNumber = null, Uri redirectUri = null) + { + return new NumberVerificationWithoutCodeContent(networkIdentifier, phoneNumber, hashedPhoneNumber, redirectUri, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// True if number if the phone number matches the device, False otherwise. + /// A new instance for mocking. + public static NumberVerificationResult NumberVerificationResult(bool verificationResult = default) + { + return new NumberVerificationResult(verificationResult, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The identifier for the network. This can be used as the networkIdentifier for the service APIs. + /// A new instance for mocking. + public static NetworkRetrievalResult NetworkRetrievalResult(string networkCode = null) + { + return new NetworkRetrievalResult(networkCode, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// True if the location is in the specified area, False otherwise. + /// A new instance for mocking. + public static DeviceLocationVerificationResult DeviceLocationVerificationResult(bool verificationResult = default) + { + return new DeviceLocationVerificationResult(verificationResult, serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/DeviceLocation.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/DeviceLocation.cs new file mode 100644 index 000000000000..927683a9c7ad --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/DeviceLocation.cs @@ -0,0 +1,199 @@ +// 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.Core; +using Azure.Core.Pipeline; + +namespace Azure.Communication.ProgrammableConnectivity +{ + // Data plane generated sub-client. + /// The DeviceLocation sub-client. + public partial class DeviceLocation + { + private static readonly string[] AuthorizationScopes = new string[] { "https://management.azure.com//.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of DeviceLocation for mocking. + protected DeviceLocation() + { + } + + /// Initializes a new instance of DeviceLocation. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The token credential to copy. + /// An Azure Programmable Connectivity Endpoint providing access to Network APIs, for example https://{region}.apcgatewayapi.azure.com. + /// The API version to use for this operation. + internal DeviceLocation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, TokenCredential tokenCredential, Uri endpoint, string apiVersion) + { + ClientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + _tokenCredential = tokenCredential; + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + /// Verifies whether a device is within a specified location area, defined as an accuracy (radius) around a point, specified by longitude and latitude. + /// The identifier of the APC Gateway resource which should handle this request. + /// Body parameter. + /// The cancellation token to use. + /// or is null. + /// + public virtual async Task> VerifyAsync(string apcGatewayId, DeviceLocationVerificationContent body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(apcGatewayId, nameof(apcGatewayId)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await VerifyAsync(apcGatewayId, content, context).ConfigureAwait(false); + return Response.FromValue(DeviceLocationVerificationResult.FromResponse(response), response); + } + + /// Verifies whether a device is within a specified location area, defined as an accuracy (radius) around a point, specified by longitude and latitude. + /// The identifier of the APC Gateway resource which should handle this request. + /// Body parameter. + /// The cancellation token to use. + /// or is null. + /// + public virtual Response Verify(string apcGatewayId, DeviceLocationVerificationContent body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(apcGatewayId, nameof(apcGatewayId)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = Verify(apcGatewayId, content, context); + return Response.FromValue(DeviceLocationVerificationResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Verifies whether a device is within a specified location area, defined as an accuracy (radius) around a point, specified by longitude and latitude. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The identifier of the APC Gateway resource which should handle this request. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task VerifyAsync(string apcGatewayId, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(apcGatewayId, nameof(apcGatewayId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("DeviceLocation.Verify"); + scope.Start(); + try + { + using HttpMessage message = CreateVerifyRequest(apcGatewayId, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Verifies whether a device is within a specified location area, defined as an accuracy (radius) around a point, specified by longitude and latitude. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The identifier of the APC Gateway resource which should handle this request. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Verify(string apcGatewayId, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(apcGatewayId, nameof(apcGatewayId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("DeviceLocation.Verify"); + scope.Start(); + try + { + using HttpMessage message = CreateVerifyRequest(apcGatewayId, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + internal HttpMessage CreateVerifyRequest(string apcGatewayId, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/device-location/location:verify", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("apc-gateway-id", apcGatewayId); + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + } +} diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/DeviceLocationVerificationContent.Serialization.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/DeviceLocationVerificationContent.Serialization.cs new file mode 100644 index 000000000000..4598da3a5436 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/DeviceLocationVerificationContent.Serialization.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.ProgrammableConnectivity +{ + public partial class DeviceLocationVerificationContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceLocationVerificationContent)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("networkIdentifier"u8); + writer.WriteObjectValue(NetworkIdentifier, options); + writer.WritePropertyName("latitude"u8); + writer.WriteNumberValue(Latitude); + writer.WritePropertyName("longitude"u8); + writer.WriteNumberValue(Longitude); + writer.WritePropertyName("accuracy"u8); + writer.WriteNumberValue(Accuracy); + writer.WritePropertyName("device"u8); + writer.WriteObjectValue(Device, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + DeviceLocationVerificationContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceLocationVerificationContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeviceLocationVerificationContent(document.RootElement, options); + } + + internal static DeviceLocationVerificationContent DeserializeDeviceLocationVerificationContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NetworkIdentifier networkIdentifier = default; + double latitude = default; + double longitude = default; + int accuracy = default; + LocationDevice device = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("networkIdentifier"u8)) + { + networkIdentifier = NetworkIdentifier.DeserializeNetworkIdentifier(property.Value, options); + continue; + } + if (property.NameEquals("latitude"u8)) + { + latitude = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("longitude"u8)) + { + longitude = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("accuracy"u8)) + { + accuracy = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("device"u8)) + { + device = LocationDevice.DeserializeLocationDevice(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeviceLocationVerificationContent( + networkIdentifier, + latitude, + longitude, + accuracy, + device, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeviceLocationVerificationContent)} does not support writing '{options.Format}' format."); + } + } + + DeviceLocationVerificationContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeviceLocationVerificationContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeviceLocationVerificationContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DeviceLocationVerificationContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDeviceLocationVerificationContent(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/DeviceLocationVerificationContent.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/DeviceLocationVerificationContent.cs new file mode 100644 index 000000000000..64761dc7ca20 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/DeviceLocationVerificationContent.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; + +namespace Azure.Communication.ProgrammableConnectivity +{ + /// Request to verify Location. + public partial class DeviceLocationVerificationContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Network to query for this device, or device information to enable network routing. + /// Latitude of location to be verified. + /// Longitude of location to be verified. + /// Accuracy expected for location verification in kilometers. + /// The device to find the location for. Exactly one of Network Access Code, Phone Number, IPv4 address, or IPv6 address. + /// or is null. + public DeviceLocationVerificationContent(NetworkIdentifier networkIdentifier, double latitude, double longitude, int accuracy, LocationDevice device) + { + Argument.AssertNotNull(networkIdentifier, nameof(networkIdentifier)); + Argument.AssertNotNull(device, nameof(device)); + + NetworkIdentifier = networkIdentifier; + Latitude = latitude; + Longitude = longitude; + Accuracy = accuracy; + Device = device; + } + + /// Initializes a new instance of . + /// Network to query for this device, or device information to enable network routing. + /// Latitude of location to be verified. + /// Longitude of location to be verified. + /// Accuracy expected for location verification in kilometers. + /// The device to find the location for. Exactly one of Network Access Code, Phone Number, IPv4 address, or IPv6 address. + /// Keeps track of any properties unknown to the library. + internal DeviceLocationVerificationContent(NetworkIdentifier networkIdentifier, double latitude, double longitude, int accuracy, LocationDevice device, IDictionary serializedAdditionalRawData) + { + NetworkIdentifier = networkIdentifier; + Latitude = latitude; + Longitude = longitude; + Accuracy = accuracy; + Device = device; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DeviceLocationVerificationContent() + { + } + + /// Network to query for this device, or device information to enable network routing. + public NetworkIdentifier NetworkIdentifier { get; } + /// Latitude of location to be verified. + public double Latitude { get; } + /// Longitude of location to be verified. + public double Longitude { get; } + /// Accuracy expected for location verification in kilometers. + public int Accuracy { get; } + /// The device to find the location for. Exactly one of Network Access Code, Phone Number, IPv4 address, or IPv6 address. + public LocationDevice Device { get; } + } +} diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/DeviceLocationVerificationResult.Serialization.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/DeviceLocationVerificationResult.Serialization.cs new file mode 100644 index 000000000000..2bb4a5c29585 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/DeviceLocationVerificationResult.Serialization.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.ProgrammableConnectivity +{ + public partial class DeviceLocationVerificationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceLocationVerificationResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("verificationResult"u8); + writer.WriteBooleanValue(VerificationResult); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + DeviceLocationVerificationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeviceLocationVerificationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeviceLocationVerificationResult(document.RootElement, options); + } + + internal static DeviceLocationVerificationResult DeserializeDeviceLocationVerificationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool verificationResult = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("verificationResult"u8)) + { + verificationResult = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeviceLocationVerificationResult(verificationResult, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeviceLocationVerificationResult)} does not support writing '{options.Format}' format."); + } + } + + DeviceLocationVerificationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeviceLocationVerificationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeviceLocationVerificationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DeviceLocationVerificationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDeviceLocationVerificationResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DiagnosticLogSettings.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/DeviceLocationVerificationResult.cs similarity index 62% rename from sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DiagnosticLogSettings.cs rename to sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/DeviceLocationVerificationResult.cs index b06a52a0eccd..dff7039b7fff 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DiagnosticLogSettings.cs +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/DeviceLocationVerificationResult.cs @@ -8,10 +8,10 @@ using System; using System.Collections.Generic; -namespace Azure.ResourceManager.CosmosDB.Models +namespace Azure.Communication.ProgrammableConnectivity { - /// Indicates what diagnostic log settings are to be enabled. - internal partial class DiagnosticLogSettings + /// Response verifying location. + public partial class DeviceLocationVerificationResult { /// /// Keeps track of any properties unknown to the library. @@ -45,22 +45,28 @@ internal partial class DiagnosticLogSettings /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public DiagnosticLogSettings() + /// Initializes a new instance of . + /// True if the location is in the specified area, False otherwise. + internal DeviceLocationVerificationResult(bool verificationResult) { + VerificationResult = verificationResult; } - /// Initializes a new instance of . - /// Describe the level of detail with which queries are to be logged. + /// Initializes a new instance of . + /// True if the location is in the specified area, False otherwise. /// Keeps track of any properties unknown to the library. - internal DiagnosticLogSettings(EnableFullTextQuery? enableFullTextQuery, IDictionary serializedAdditionalRawData) + internal DeviceLocationVerificationResult(bool verificationResult, IDictionary serializedAdditionalRawData) { - EnableFullTextQuery = enableFullTextQuery; + VerificationResult = verificationResult; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Describe the level of detail with which queries are to be logged. - [WirePath("enableFullTextQuery")] - public EnableFullTextQuery? EnableFullTextQuery { get; set; } + /// Initializes a new instance of for deserialization. + internal DeviceLocationVerificationResult() + { + } + + /// True if the location is in the specified area, False otherwise. + public bool VerificationResult { get; } } } diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/DeviceNetwork.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/DeviceNetwork.cs new file mode 100644 index 000000000000..d2c1e51dee07 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/DeviceNetwork.cs @@ -0,0 +1,199 @@ +// 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.Core; +using Azure.Core.Pipeline; + +namespace Azure.Communication.ProgrammableConnectivity +{ + // Data plane generated sub-client. + /// The DeviceNetwork sub-client. + public partial class DeviceNetwork + { + private static readonly string[] AuthorizationScopes = new string[] { "https://management.azure.com//.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of DeviceNetwork for mocking. + protected DeviceNetwork() + { + } + + /// Initializes a new instance of DeviceNetwork. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The token credential to copy. + /// An Azure Programmable Connectivity Endpoint providing access to Network APIs, for example https://{region}.apcgatewayapi.azure.com. + /// The API version to use for this operation. + internal DeviceNetwork(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, TokenCredential tokenCredential, Uri endpoint, string apiVersion) + { + ClientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + _tokenCredential = tokenCredential; + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + /// Retrieves the network a given device is on. Returns network in a networkCode format that can be used for other APIs. + /// The identifier of the APC Gateway resource which should handle this request. + /// Body parameter. + /// The cancellation token to use. + /// or is null. + /// + public virtual async Task> RetrieveAsync(string apcGatewayId, NetworkIdentifier body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(apcGatewayId, nameof(apcGatewayId)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await RetrieveAsync(apcGatewayId, content, context).ConfigureAwait(false); + return Response.FromValue(NetworkRetrievalResult.FromResponse(response), response); + } + + /// Retrieves the network a given device is on. Returns network in a networkCode format that can be used for other APIs. + /// The identifier of the APC Gateway resource which should handle this request. + /// Body parameter. + /// The cancellation token to use. + /// or is null. + /// + public virtual Response Retrieve(string apcGatewayId, NetworkIdentifier body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(apcGatewayId, nameof(apcGatewayId)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = Retrieve(apcGatewayId, content, context); + return Response.FromValue(NetworkRetrievalResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Retrieves the network a given device is on. Returns network in a networkCode format that can be used for other APIs. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The identifier of the APC Gateway resource which should handle this request. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task RetrieveAsync(string apcGatewayId, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(apcGatewayId, nameof(apcGatewayId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("DeviceNetwork.Retrieve"); + scope.Start(); + try + { + using HttpMessage message = CreateRetrieveRequest(apcGatewayId, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Retrieves the network a given device is on. Returns network in a networkCode format that can be used for other APIs. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The identifier of the APC Gateway resource which should handle this request. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Retrieve(string apcGatewayId, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(apcGatewayId, nameof(apcGatewayId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("DeviceNetwork.Retrieve"); + scope.Start(); + try + { + using HttpMessage message = CreateRetrieveRequest(apcGatewayId, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + internal HttpMessage CreateRetrieveRequest(string apcGatewayId, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/device-network/network:retrieve", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("apc-gateway-id", apcGatewayId); + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + } +} diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Docs/DeviceLocation.xml b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Docs/DeviceLocation.xml new file mode 100644 index 000000000000..78861d2d14d8 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Docs/DeviceLocation.xml @@ -0,0 +1,185 @@ + + + + + +This sample shows how to call VerifyAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +DeviceLocation client = new ProgrammableConnectivityClient(endpoint, credential).GetDeviceLocationClient(apiVersion: "2024-02-09-preview"); + +DeviceLocationVerificationContent body = new DeviceLocationVerificationContent(new NetworkIdentifier("", ""), 123.45, 123.45, 1234, new LocationDevice()); +Response response = await client.VerifyAsync("", body); +]]> +This sample shows how to call VerifyAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +DeviceLocation client = new ProgrammableConnectivityClient(endpoint, credential).GetDeviceLocationClient(apiVersion: "2024-02-09-preview"); + +DeviceLocationVerificationContent body = new DeviceLocationVerificationContent(new NetworkIdentifier("", ""), 123.45, 123.45, 1234, new LocationDevice +{ + NetworkAccessIdentifier = "", + PhoneNumber = "", + Ipv4Address = new Ipv4Address("", 1234), + Ipv6Address = new Ipv6Address("", 1234), +}); +Response response = await client.VerifyAsync("", body); +]]> + + + +This sample shows how to call Verify. +"); +TokenCredential credential = new DefaultAzureCredential(); +DeviceLocation client = new ProgrammableConnectivityClient(endpoint, credential).GetDeviceLocationClient(apiVersion: "2024-02-09-preview"); + +DeviceLocationVerificationContent body = new DeviceLocationVerificationContent(new NetworkIdentifier("", ""), 123.45, 123.45, 1234, new LocationDevice()); +Response response = client.Verify("", body); +]]> +This sample shows how to call Verify with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +DeviceLocation client = new ProgrammableConnectivityClient(endpoint, credential).GetDeviceLocationClient(apiVersion: "2024-02-09-preview"); + +DeviceLocationVerificationContent body = new DeviceLocationVerificationContent(new NetworkIdentifier("", ""), 123.45, 123.45, 1234, new LocationDevice +{ + NetworkAccessIdentifier = "", + PhoneNumber = "", + Ipv4Address = new Ipv4Address("", 1234), + Ipv6Address = new Ipv6Address("", 1234), +}); +Response response = client.Verify("", body); +]]> + + + +This sample shows how to call VerifyAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +DeviceLocation client = new ProgrammableConnectivityClient(endpoint, credential).GetDeviceLocationClient(apiVersion: "2024-02-09-preview"); + +using RequestContent content = RequestContent.Create(new +{ + networkIdentifier = new + { + identifierType = "", + identifier = "", + }, + latitude = 123.45, + longitude = 123.45, + accuracy = 1234, + device = new object(), +}); +Response response = await client.VerifyAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("verificationResult").ToString()); +]]> +This sample shows how to call VerifyAsync with all parameters and request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +DeviceLocation client = new ProgrammableConnectivityClient(endpoint, credential).GetDeviceLocationClient(apiVersion: "2024-02-09-preview"); + +using RequestContent content = RequestContent.Create(new +{ + networkIdentifier = new + { + identifierType = "", + identifier = "", + }, + latitude = 123.45, + longitude = 123.45, + accuracy = 1234, + device = new + { + networkAccessIdentifier = "", + phoneNumber = "", + ipv4Address = new + { + ipv4 = "", + port = 1234, + }, + ipv6Address = new + { + ipv6 = "", + port = 1234, + }, + }, +}); +Response response = await client.VerifyAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("verificationResult").ToString()); +]]> + + + +This sample shows how to call Verify and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +DeviceLocation client = new ProgrammableConnectivityClient(endpoint, credential).GetDeviceLocationClient(apiVersion: "2024-02-09-preview"); + +using RequestContent content = RequestContent.Create(new +{ + networkIdentifier = new + { + identifierType = "", + identifier = "", + }, + latitude = 123.45, + longitude = 123.45, + accuracy = 1234, + device = new object(), +}); +Response response = client.Verify("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("verificationResult").ToString()); +]]> +This sample shows how to call Verify with all parameters and request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +DeviceLocation client = new ProgrammableConnectivityClient(endpoint, credential).GetDeviceLocationClient(apiVersion: "2024-02-09-preview"); + +using RequestContent content = RequestContent.Create(new +{ + networkIdentifier = new + { + identifierType = "", + identifier = "", + }, + latitude = 123.45, + longitude = 123.45, + accuracy = 1234, + device = new + { + networkAccessIdentifier = "", + phoneNumber = "", + ipv4Address = new + { + ipv4 = "", + port = 1234, + }, + ipv6Address = new + { + ipv6 = "", + port = 1234, + }, + }, +}); +Response response = client.Verify("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("verificationResult").ToString()); +]]> + + + \ No newline at end of file diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Docs/DeviceNetwork.xml b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Docs/DeviceNetwork.xml new file mode 100644 index 000000000000..1f977fef38cb --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Docs/DeviceNetwork.xml @@ -0,0 +1,117 @@ + + + + + +This sample shows how to call RetrieveAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +DeviceNetwork client = new ProgrammableConnectivityClient(endpoint, credential).GetDeviceNetworkClient(apiVersion: "2024-02-09-preview"); + +NetworkIdentifier body = new NetworkIdentifier("", ""); +Response response = await client.RetrieveAsync("", body); +]]> +This sample shows how to call RetrieveAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +DeviceNetwork client = new ProgrammableConnectivityClient(endpoint, credential).GetDeviceNetworkClient(apiVersion: "2024-02-09-preview"); + +NetworkIdentifier body = new NetworkIdentifier("", ""); +Response response = await client.RetrieveAsync("", body); +]]> + + + +This sample shows how to call Retrieve. +"); +TokenCredential credential = new DefaultAzureCredential(); +DeviceNetwork client = new ProgrammableConnectivityClient(endpoint, credential).GetDeviceNetworkClient(apiVersion: "2024-02-09-preview"); + +NetworkIdentifier body = new NetworkIdentifier("", ""); +Response response = client.Retrieve("", body); +]]> +This sample shows how to call Retrieve with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +DeviceNetwork client = new ProgrammableConnectivityClient(endpoint, credential).GetDeviceNetworkClient(apiVersion: "2024-02-09-preview"); + +NetworkIdentifier body = new NetworkIdentifier("", ""); +Response response = client.Retrieve("", body); +]]> + + + +This sample shows how to call RetrieveAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +DeviceNetwork client = new ProgrammableConnectivityClient(endpoint, credential).GetDeviceNetworkClient(apiVersion: "2024-02-09-preview"); + +using RequestContent content = RequestContent.Create(new +{ + identifierType = "", + identifier = "", +}); +Response response = await client.RetrieveAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("networkCode").ToString()); +]]> +This sample shows how to call RetrieveAsync with all parameters and request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +DeviceNetwork client = new ProgrammableConnectivityClient(endpoint, credential).GetDeviceNetworkClient(apiVersion: "2024-02-09-preview"); + +using RequestContent content = RequestContent.Create(new +{ + identifierType = "", + identifier = "", +}); +Response response = await client.RetrieveAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("networkCode").ToString()); +]]> + + + +This sample shows how to call Retrieve and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +DeviceNetwork client = new ProgrammableConnectivityClient(endpoint, credential).GetDeviceNetworkClient(apiVersion: "2024-02-09-preview"); + +using RequestContent content = RequestContent.Create(new +{ + identifierType = "", + identifier = "", +}); +Response response = client.Retrieve("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("networkCode").ToString()); +]]> +This sample shows how to call Retrieve with all parameters and request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +DeviceNetwork client = new ProgrammableConnectivityClient(endpoint, credential).GetDeviceNetworkClient(apiVersion: "2024-02-09-preview"); + +using RequestContent content = RequestContent.Create(new +{ + identifierType = "", + identifier = "", +}); +Response response = client.Retrieve("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("networkCode").ToString()); +]]> + + + \ No newline at end of file diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Docs/NumberVerification.xml b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Docs/NumberVerification.xml new file mode 100644 index 000000000000..d4e2d4703591 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Docs/NumberVerification.xml @@ -0,0 +1,249 @@ + + + + + +This sample shows how to call VerifyWithoutCodeAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +NumberVerification client = new ProgrammableConnectivityClient(endpoint, credential).GetNumberVerificationClient(apiVersion: "2024-02-09-preview"); + +NumberVerificationWithoutCodeContent body = new NumberVerificationWithoutCodeContent(new NetworkIdentifier("", ""), new Uri("http://localhost:3000")); +Response response = await client.VerifyWithoutCodeAsync("", body); +]]> +This sample shows how to call VerifyWithoutCodeAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +NumberVerification client = new ProgrammableConnectivityClient(endpoint, credential).GetNumberVerificationClient(apiVersion: "2024-02-09-preview"); + +NumberVerificationWithoutCodeContent body = new NumberVerificationWithoutCodeContent(new NetworkIdentifier("", ""), new Uri("http://localhost:3000")) +{ + PhoneNumber = "", + HashedPhoneNumber = "", +}; +Response response = await client.VerifyWithoutCodeAsync("", body); +]]> + + + +This sample shows how to call VerifyWithoutCode. +"); +TokenCredential credential = new DefaultAzureCredential(); +NumberVerification client = new ProgrammableConnectivityClient(endpoint, credential).GetNumberVerificationClient(apiVersion: "2024-02-09-preview"); + +NumberVerificationWithoutCodeContent body = new NumberVerificationWithoutCodeContent(new NetworkIdentifier("", ""), new Uri("http://localhost:3000")); +Response response = client.VerifyWithoutCode("", body); +]]> +This sample shows how to call VerifyWithoutCode with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +NumberVerification client = new ProgrammableConnectivityClient(endpoint, credential).GetNumberVerificationClient(apiVersion: "2024-02-09-preview"); + +NumberVerificationWithoutCodeContent body = new NumberVerificationWithoutCodeContent(new NetworkIdentifier("", ""), new Uri("http://localhost:3000")) +{ + PhoneNumber = "", + HashedPhoneNumber = "", +}; +Response response = client.VerifyWithoutCode("", body); +]]> + + + +This sample shows how to call VerifyWithoutCodeAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +NumberVerification client = new ProgrammableConnectivityClient(endpoint, credential).GetNumberVerificationClient(apiVersion: "2024-02-09-preview"); + +using RequestContent content = RequestContent.Create(new +{ + networkIdentifier = new + { + identifierType = "", + identifier = "", + }, + redirectUri = "http://localhost:3000", +}); +Response response = await client.VerifyWithoutCodeAsync("", content); + +Console.WriteLine(response.Status); +]]> +This sample shows how to call VerifyWithoutCodeAsync with all parameters and request content. +"); +TokenCredential credential = new DefaultAzureCredential(); +NumberVerification client = new ProgrammableConnectivityClient(endpoint, credential).GetNumberVerificationClient(apiVersion: "2024-02-09-preview"); + +using RequestContent content = RequestContent.Create(new +{ + networkIdentifier = new + { + identifierType = "", + identifier = "", + }, + phoneNumber = "", + hashedPhoneNumber = "", + redirectUri = "http://localhost:3000", +}); +Response response = await client.VerifyWithoutCodeAsync("", content); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call VerifyWithoutCode. +"); +TokenCredential credential = new DefaultAzureCredential(); +NumberVerification client = new ProgrammableConnectivityClient(endpoint, credential).GetNumberVerificationClient(apiVersion: "2024-02-09-preview"); + +using RequestContent content = RequestContent.Create(new +{ + networkIdentifier = new + { + identifierType = "", + identifier = "", + }, + redirectUri = "http://localhost:3000", +}); +Response response = client.VerifyWithoutCode("", content); + +Console.WriteLine(response.Status); +]]> +This sample shows how to call VerifyWithoutCode with all parameters and request content. +"); +TokenCredential credential = new DefaultAzureCredential(); +NumberVerification client = new ProgrammableConnectivityClient(endpoint, credential).GetNumberVerificationClient(apiVersion: "2024-02-09-preview"); + +using RequestContent content = RequestContent.Create(new +{ + networkIdentifier = new + { + identifierType = "", + identifier = "", + }, + phoneNumber = "", + hashedPhoneNumber = "", + redirectUri = "http://localhost:3000", +}); +Response response = client.VerifyWithoutCode("", content); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call VerifyWithCodeAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +NumberVerification client = new ProgrammableConnectivityClient(endpoint, credential).GetNumberVerificationClient(apiVersion: "2024-02-09-preview"); + +NumberVerificationWithCodeContent body = new NumberVerificationWithCodeContent(""); +Response response = await client.VerifyWithCodeAsync("", body); +]]> +This sample shows how to call VerifyWithCodeAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +NumberVerification client = new ProgrammableConnectivityClient(endpoint, credential).GetNumberVerificationClient(apiVersion: "2024-02-09-preview"); + +NumberVerificationWithCodeContent body = new NumberVerificationWithCodeContent(""); +Response response = await client.VerifyWithCodeAsync("", body); +]]> + + + +This sample shows how to call VerifyWithCode. +"); +TokenCredential credential = new DefaultAzureCredential(); +NumberVerification client = new ProgrammableConnectivityClient(endpoint, credential).GetNumberVerificationClient(apiVersion: "2024-02-09-preview"); + +NumberVerificationWithCodeContent body = new NumberVerificationWithCodeContent(""); +Response response = client.VerifyWithCode("", body); +]]> +This sample shows how to call VerifyWithCode with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +NumberVerification client = new ProgrammableConnectivityClient(endpoint, credential).GetNumberVerificationClient(apiVersion: "2024-02-09-preview"); + +NumberVerificationWithCodeContent body = new NumberVerificationWithCodeContent(""); +Response response = client.VerifyWithCode("", body); +]]> + + + +This sample shows how to call VerifyWithCodeAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +NumberVerification client = new ProgrammableConnectivityClient(endpoint, credential).GetNumberVerificationClient(apiVersion: "2024-02-09-preview"); + +using RequestContent content = RequestContent.Create(new +{ + apcCode = "", +}); +Response response = await client.VerifyWithCodeAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("verificationResult").ToString()); +]]> +This sample shows how to call VerifyWithCodeAsync with all parameters and request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +NumberVerification client = new ProgrammableConnectivityClient(endpoint, credential).GetNumberVerificationClient(apiVersion: "2024-02-09-preview"); + +using RequestContent content = RequestContent.Create(new +{ + apcCode = "", +}); +Response response = await client.VerifyWithCodeAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("verificationResult").ToString()); +]]> + + + +This sample shows how to call VerifyWithCode and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +NumberVerification client = new ProgrammableConnectivityClient(endpoint, credential).GetNumberVerificationClient(apiVersion: "2024-02-09-preview"); + +using RequestContent content = RequestContent.Create(new +{ + apcCode = "", +}); +Response response = client.VerifyWithCode("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("verificationResult").ToString()); +]]> +This sample shows how to call VerifyWithCode with all parameters and request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +NumberVerification client = new ProgrammableConnectivityClient(endpoint, credential).GetNumberVerificationClient(apiVersion: "2024-02-09-preview"); + +using RequestContent content = RequestContent.Create(new +{ + apcCode = "", +}); +Response response = client.VerifyWithCode("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("verificationResult").ToString()); +]]> + + + \ No newline at end of file diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Docs/SimSwap.xml b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Docs/SimSwap.xml new file mode 100644 index 000000000000..83bbc5ad2cc1 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Docs/SimSwap.xml @@ -0,0 +1,273 @@ + + + + + +This sample shows how to call RetrieveAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +SimSwap client = new ProgrammableConnectivityClient(endpoint, credential).GetSimSwapClient(apiVersion: "2024-02-09-preview"); + +SimSwapRetrievalContent body = new SimSwapRetrievalContent(new NetworkIdentifier("", "")); +Response response = await client.RetrieveAsync("", body); +]]> +This sample shows how to call RetrieveAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +SimSwap client = new ProgrammableConnectivityClient(endpoint, credential).GetSimSwapClient(apiVersion: "2024-02-09-preview"); + +SimSwapRetrievalContent body = new SimSwapRetrievalContent(new NetworkIdentifier("", "")) +{ + PhoneNumber = "", +}; +Response response = await client.RetrieveAsync("", body); +]]> + + + +This sample shows how to call Retrieve. +"); +TokenCredential credential = new DefaultAzureCredential(); +SimSwap client = new ProgrammableConnectivityClient(endpoint, credential).GetSimSwapClient(apiVersion: "2024-02-09-preview"); + +SimSwapRetrievalContent body = new SimSwapRetrievalContent(new NetworkIdentifier("", "")); +Response response = client.Retrieve("", body); +]]> +This sample shows how to call Retrieve with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +SimSwap client = new ProgrammableConnectivityClient(endpoint, credential).GetSimSwapClient(apiVersion: "2024-02-09-preview"); + +SimSwapRetrievalContent body = new SimSwapRetrievalContent(new NetworkIdentifier("", "")) +{ + PhoneNumber = "", +}; +Response response = client.Retrieve("", body); +]]> + + + +This sample shows how to call RetrieveAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +SimSwap client = new ProgrammableConnectivityClient(endpoint, credential).GetSimSwapClient(apiVersion: "2024-02-09-preview"); + +using RequestContent content = RequestContent.Create(new +{ + networkIdentifier = new + { + identifierType = "", + identifier = "", + }, +}); +Response response = await client.RetrieveAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> +This sample shows how to call RetrieveAsync with all parameters and request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +SimSwap client = new ProgrammableConnectivityClient(endpoint, credential).GetSimSwapClient(apiVersion: "2024-02-09-preview"); + +using RequestContent content = RequestContent.Create(new +{ + phoneNumber = "", + networkIdentifier = new + { + identifierType = "", + identifier = "", + }, +}); +Response response = await client.RetrieveAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("date").ToString()); +]]> + + + +This sample shows how to call Retrieve and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +SimSwap client = new ProgrammableConnectivityClient(endpoint, credential).GetSimSwapClient(apiVersion: "2024-02-09-preview"); + +using RequestContent content = RequestContent.Create(new +{ + networkIdentifier = new + { + identifierType = "", + identifier = "", + }, +}); +Response response = client.Retrieve("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> +This sample shows how to call Retrieve with all parameters and request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +SimSwap client = new ProgrammableConnectivityClient(endpoint, credential).GetSimSwapClient(apiVersion: "2024-02-09-preview"); + +using RequestContent content = RequestContent.Create(new +{ + phoneNumber = "", + networkIdentifier = new + { + identifierType = "", + identifier = "", + }, +}); +Response response = client.Retrieve("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("date").ToString()); +]]> + + + +This sample shows how to call VerifyAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +SimSwap client = new ProgrammableConnectivityClient(endpoint, credential).GetSimSwapClient(apiVersion: "2024-02-09-preview"); + +SimSwapVerificationContent body = new SimSwapVerificationContent(new NetworkIdentifier("", "")); +Response response = await client.VerifyAsync("", body); +]]> +This sample shows how to call VerifyAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +SimSwap client = new ProgrammableConnectivityClient(endpoint, credential).GetSimSwapClient(apiVersion: "2024-02-09-preview"); + +SimSwapVerificationContent body = new SimSwapVerificationContent(new NetworkIdentifier("", "")) +{ + PhoneNumber = "", + MaxAgeHours = 1234, +}; +Response response = await client.VerifyAsync("", body); +]]> + + + +This sample shows how to call Verify. +"); +TokenCredential credential = new DefaultAzureCredential(); +SimSwap client = new ProgrammableConnectivityClient(endpoint, credential).GetSimSwapClient(apiVersion: "2024-02-09-preview"); + +SimSwapVerificationContent body = new SimSwapVerificationContent(new NetworkIdentifier("", "")); +Response response = client.Verify("", body); +]]> +This sample shows how to call Verify with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +SimSwap client = new ProgrammableConnectivityClient(endpoint, credential).GetSimSwapClient(apiVersion: "2024-02-09-preview"); + +SimSwapVerificationContent body = new SimSwapVerificationContent(new NetworkIdentifier("", "")) +{ + PhoneNumber = "", + MaxAgeHours = 1234, +}; +Response response = client.Verify("", body); +]]> + + + +This sample shows how to call VerifyAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +SimSwap client = new ProgrammableConnectivityClient(endpoint, credential).GetSimSwapClient(apiVersion: "2024-02-09-preview"); + +using RequestContent content = RequestContent.Create(new +{ + networkIdentifier = new + { + identifierType = "", + identifier = "", + }, +}); +Response response = await client.VerifyAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("verificationResult").ToString()); +]]> +This sample shows how to call VerifyAsync with all parameters and request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +SimSwap client = new ProgrammableConnectivityClient(endpoint, credential).GetSimSwapClient(apiVersion: "2024-02-09-preview"); + +using RequestContent content = RequestContent.Create(new +{ + phoneNumber = "", + maxAgeHours = 1234, + networkIdentifier = new + { + identifierType = "", + identifier = "", + }, +}); +Response response = await client.VerifyAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("verificationResult").ToString()); +]]> + + + +This sample shows how to call Verify and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +SimSwap client = new ProgrammableConnectivityClient(endpoint, credential).GetSimSwapClient(apiVersion: "2024-02-09-preview"); + +using RequestContent content = RequestContent.Create(new +{ + networkIdentifier = new + { + identifierType = "", + identifier = "", + }, +}); +Response response = client.Verify("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("verificationResult").ToString()); +]]> +This sample shows how to call Verify with all parameters and request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +SimSwap client = new ProgrammableConnectivityClient(endpoint, credential).GetSimSwapClient(apiVersion: "2024-02-09-preview"); + +using RequestContent content = RequestContent.Create(new +{ + phoneNumber = "", + maxAgeHours = 1234, + networkIdentifier = new + { + identifierType = "", + identifier = "", + }, +}); +Response response = client.Verify("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("verificationResult").ToString()); +]]> + + + \ No newline at end of file diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Internal/Argument.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..8a8fa316d538 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Internal/Argument.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.Communication.ProgrammableConnectivity +{ + internal static class Argument + { + public static void AssertNotNull(T value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNull(T? value, string name) + where T : struct + { + if (!value.HasValue) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNullOrEmpty(IEnumerable value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value is ICollection collectionOfT && collectionOfT.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + if (value is ICollection collection && collection.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + using IEnumerator e = value.GetEnumerator(); + if (!e.MoveNext()) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + } + + public static void AssertNotNullOrEmpty(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value.Length == 0) + { + throw new ArgumentException("Value cannot be an empty string.", name); + } + } + + public static void AssertNotNullOrWhiteSpace(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (string.IsNullOrWhiteSpace(value)) + { + throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name); + } + } + + public static void AssertNotDefault(ref T value, string name) + where T : struct, IEquatable + { + if (value.Equals(default)) + { + throw new ArgumentException("Value cannot be empty.", name); + } + } + + public static void AssertInRange(T value, T minimum, T maximum, string name) + where T : notnull, IComparable + { + if (minimum.CompareTo(value) > 0) + { + throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed."); + } + if (maximum.CompareTo(value) < 0) + { + throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed."); + } + } + + public static void AssertEnumDefined(Type enumType, object value, string name) + { + if (!Enum.IsDefined(enumType, value)) + { + throw new ArgumentException($"Value not defined for {enumType.FullName}.", name); + } + } + + public static T CheckNotNull(T value, string name) + where T : class + { + AssertNotNull(value, name); + return value; + } + + public static string CheckNotNullOrEmpty(string value, string name) + { + AssertNotNullOrEmpty(value, name); + return value; + } + + public static void AssertNull(T value, string name, string message = null) + { + if (value != null) + { + throw new ArgumentException(message ?? "Value must be null.", name); + } + } + } +} diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..4e2b60ef6c3c --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.Communication.ProgrammableConnectivity +{ + internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull + { + private IDictionary _innerDictionary; + + public ChangeTrackingDictionary() + { + } + + public ChangeTrackingDictionary(IDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(dictionary); + } + + public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(); + foreach (var pair in dictionary) + { + _innerDictionary.Add(pair); + } + } + + public bool IsUndefined => _innerDictionary == null; + + public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + + public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + + public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + + public TValue this[TKey key] + { + get + { + if (IsUndefined) + { + throw new KeyNotFoundException(nameof(key)); + } + return EnsureDictionary()[key]; + } + set + { + EnsureDictionary()[key] = value; + } + } + + IEnumerable IReadOnlyDictionary.Keys => Keys; + + IEnumerable IReadOnlyDictionary.Values => Values; + + public IEnumerator> GetEnumerator() + { + if (IsUndefined) + { + IEnumerator> enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureDictionary().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(KeyValuePair item) + { + EnsureDictionary().Add(item); + } + + public void Clear() + { + EnsureDictionary().Clear(); + } + + public bool Contains(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Contains(item); + } + + public void CopyTo(KeyValuePair[] array, int index) + { + if (IsUndefined) + { + return; + } + EnsureDictionary().CopyTo(array, index); + } + + public bool Remove(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(item); + } + + public void Add(TKey key, TValue value) + { + EnsureDictionary().Add(key, value); + } + + public bool ContainsKey(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().ContainsKey(key); + } + + public bool Remove(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(key); + } + + public bool TryGetValue(TKey key, out TValue value) + { + if (IsUndefined) + { + value = default; + return false; + } + return EnsureDictionary().TryGetValue(key, out value); + } + + public IDictionary EnsureDictionary() + { + return _innerDictionary ??= new Dictionary(); + } + } +} diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Internal/ChangeTrackingList.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..3c705fe0d23e --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Internal/ChangeTrackingList.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Communication.ProgrammableConnectivity +{ + internal class ChangeTrackingList : IList, IReadOnlyList + { + private IList _innerList; + + public ChangeTrackingList() + { + } + + public ChangeTrackingList(IList innerList) + { + if (innerList != null) + { + _innerList = innerList; + } + } + + public ChangeTrackingList(IReadOnlyList innerList) + { + if (innerList != null) + { + _innerList = innerList.ToList(); + } + } + + public bool IsUndefined => _innerList == null; + + public int Count => IsUndefined ? 0 : EnsureList().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + + public T this[int index] + { + get + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + return EnsureList()[index]; + } + set + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList()[index] = value; + } + } + + public void Reset() + { + _innerList = null; + } + + public IEnumerator GetEnumerator() + { + if (IsUndefined) + { + IEnumerator enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureList().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(T item) + { + EnsureList().Add(item); + } + + public void Clear() + { + EnsureList().Clear(); + } + + public bool Contains(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Contains(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + if (IsUndefined) + { + return; + } + EnsureList().CopyTo(array, arrayIndex); + } + + public bool Remove(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Remove(item); + } + + public int IndexOf(T item) + { + if (IsUndefined) + { + return -1; + } + return EnsureList().IndexOf(item); + } + + public void Insert(int index, T item) + { + EnsureList().Insert(index, item); + } + + public void RemoveAt(int index) + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList().RemoveAt(index); + } + + public IList EnsureList() + { + return _innerList ??= new List(); + } + } +} diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..52068c35e990 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,398 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.Text.Json; +using System.Xml; +using Azure.Core; + +namespace Azure.Communication.ProgrammableConnectivity +{ + internal static class ModelSerializationExtensions + { + internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + + public static object GetObject(this JsonElement element) + { + switch (element.ValueKind) + { + case JsonValueKind.String: + return element.GetString(); + case JsonValueKind.Number: + if (element.TryGetInt32(out int intValue)) + { + return intValue; + } + if (element.TryGetInt64(out long longValue)) + { + return longValue; + } + return element.GetDouble(); + case JsonValueKind.True: + return true; + case JsonValueKind.False: + return false; + case JsonValueKind.Undefined: + case JsonValueKind.Null: + return null; + case JsonValueKind.Object: + var dictionary = new Dictionary(); + foreach (var jsonProperty in element.EnumerateObject()) + { + dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject()); + } + return dictionary; + case JsonValueKind.Array: + var list = new List(); + foreach (var item in element.EnumerateArray()) + { + list.Add(item.GetObject()); + } + return list.ToArray(); + default: + throw new NotSupportedException($"Not supported value kind {element.ValueKind}"); + } + } + + public static byte[] GetBytesFromBase64(this JsonElement element, string format) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + + return format switch + { + "U" => TypeFormatters.FromBase64UrlString(element.GetRequiredString()), + "D" => element.GetBytesFromBase64(), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + } + + public static DateTimeOffset GetDateTimeOffset(this JsonElement element, string format) => format switch + { + "U" when element.ValueKind == JsonValueKind.Number => DateTimeOffset.FromUnixTimeSeconds(element.GetInt64()), + _ => TypeFormatters.ParseDateTimeOffset(element.GetString(), format) + }; + + public static TimeSpan GetTimeSpan(this JsonElement element, string format) => TypeFormatters.ParseTimeSpan(element.GetString(), format); + + public static char GetChar(this JsonElement element) + { + if (element.ValueKind == JsonValueKind.String) + { + var text = element.GetString(); + if (text == null || text.Length != 1) + { + throw new NotSupportedException($"Cannot convert \"{text}\" to a char"); + } + return text[0]; + } + else + { + throw new NotSupportedException($"Cannot convert {element.ValueKind} to a char"); + } + } + + [Conditional("DEBUG")] + public static void ThrowNonNullablePropertyIsNull(this JsonProperty property) + { + throw new JsonException($"A property '{property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); + } + + public static string GetRequiredString(this JsonElement element) + { + var value = element.GetString(); + if (value == null) + { + throw new InvalidOperationException($"The requested operation requires an element of type 'String', but the target element has type '{element.ValueKind}'."); + } + return value; + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTime value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, TimeSpan value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, char value) + { + writer.WriteStringValue(value.ToString(CultureInfo.InvariantCulture)); + } + + public static void WriteBase64StringValue(this Utf8JsonWriter writer, byte[] value, string format) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + switch (format) + { + case "U": + writer.WriteStringValue(TypeFormatters.ToBase64UrlString(value)); + break; + case "D": + writer.WriteBase64StringValue(value); + break; + default: + throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)); + } + } + + public static void WriteNumberValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + if (format != "U") + { + throw new ArgumentOutOfRangeException(nameof(format), "Only 'U' format is supported when writing a DateTimeOffset as a Number."); + } + writer.WriteNumberValue(value.ToUnixTimeSeconds()); + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, T value, ModelReaderWriterOptions options = null) + { + switch (value) + { + case null: + writer.WriteNullValue(); + break; + case IJsonModel jsonModel: + jsonModel.Write(writer, options ?? WireOptions); + break; + case IUtf8JsonSerializable serializable: + serializable.Write(writer); + break; + case byte[] bytes: + writer.WriteBase64StringValue(bytes); + break; + case BinaryData bytes0: + writer.WriteBase64StringValue(bytes0); + break; + case JsonElement json: + json.WriteTo(writer); + break; + case int i: + writer.WriteNumberValue(i); + break; + case decimal d: + writer.WriteNumberValue(d); + break; + case double d0: + if (double.IsNaN(d0)) + { + writer.WriteStringValue("NaN"); + } + else + { + writer.WriteNumberValue(d0); + } + break; + case float f: + writer.WriteNumberValue(f); + break; + case long l: + writer.WriteNumberValue(l); + break; + case string s: + writer.WriteStringValue(s); + break; + case bool b: + writer.WriteBooleanValue(b); + break; + case Guid g: + writer.WriteStringValue(g); + break; + case DateTimeOffset dateTimeOffset: + writer.WriteStringValue(dateTimeOffset, "O"); + break; + case DateTime dateTime: + writer.WriteStringValue(dateTime, "O"); + break; + case IEnumerable> enumerable: + writer.WriteStartObject(); + foreach (var pair in enumerable) + { + writer.WritePropertyName(pair.Key); + writer.WriteObjectValue(pair.Value, options); + } + writer.WriteEndObject(); + break; + case IEnumerable objectEnumerable: + writer.WriteStartArray(); + foreach (var item in objectEnumerable) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + break; + case TimeSpan timeSpan: + writer.WriteStringValue(timeSpan, "P"); + break; + default: + throw new NotSupportedException($"Not supported type {value.GetType()}"); + } + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, object value, ModelReaderWriterOptions options = null) + { + writer.WriteObjectValue(value, options); + } + + internal static class TypeFormatters + { + private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; + public const string DefaultNumberFormat = "G"; + + public static string ToString(bool value) => value ? "true" : "false"; + + public static string ToString(DateTime value, string format) => value.Kind switch + { + DateTimeKind.Utc => ToString((DateTimeOffset)value, format), + _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Azure SDK requires it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") + }; + + public static string ToString(DateTimeOffset value, string format) => format switch + { + "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), + "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), + "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "R" => value.ToString("r", CultureInfo.InvariantCulture), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(TimeSpan value, string format) => format switch + { + "P" => XmlConvert.ToString(value), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(byte[] value, string format) => format switch + { + "U" => ToBase64UrlString(value), + "D" => Convert.ToBase64String(value), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + + public static string ToBase64UrlString(byte[] value) + { + int numWholeOrPartialInputBlocks = checked(value.Length + 2) / 3; + int size = checked(numWholeOrPartialInputBlocks * 4); + char[] output = new char[size]; + + int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); + + int i = 0; + for (; i < numBase64Chars; i++) + { + char ch = output[i]; + if (ch == '+') + { + output[i] = '-'; + } + else + { + if (ch == '/') + { + output[i] = '_'; + } + else + { + if (ch == '=') + { + break; + } + } + } + } + + return new string(output, 0, i); + } + + public static byte[] FromBase64UrlString(string value) + { + int paddingCharsToAdd = (value.Length % 4) switch + { + 0 => 0, + 2 => 2, + 3 => 1, + _ => throw new InvalidOperationException("Malformed input") + }; + char[] output = new char[(value.Length + paddingCharsToAdd)]; + int i = 0; + for (; i < value.Length; i++) + { + char ch = value[i]; + if (ch == '-') + { + output[i] = '+'; + } + else + { + if (ch == '_') + { + output[i] = '/'; + } + else + { + output[i] = ch; + } + } + } + + for (; i < output.Length; i++) + { + output[i] = '='; + } + + return Convert.FromBase64CharArray(output, 0, output.Length); + } + + public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch + { + "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), + _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) + }; + + public static TimeSpan ParseTimeSpan(string value, string format) => format switch + { + "P" => XmlConvert.ToTimeSpan(value), + _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) + }; + + public static string ConvertToString(object value, string format = null) => value switch + { + null => "null", + string s => s, + bool b => ToString(b), + int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), + byte[] b0 when format != null => ToString(b0, format), + IEnumerable s0 => string.Join(",", s0), + DateTimeOffset dateTime when format != null => ToString(dateTime, format), + TimeSpan timeSpan when format != null => ToString(timeSpan, format), + TimeSpan timeSpan0 => XmlConvert.ToString(timeSpan0), + Guid guid => guid.ToString(), + BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), + _ => value.ToString() + }; + } + } +} diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Internal/Optional.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..86bcb20f00fa --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Internal/Optional.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.Communication.ProgrammableConnectivity +{ + internal static class Optional + { + public static bool IsCollectionDefined(IEnumerable collection) + { + return !(collection is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined); + } + + public static bool IsCollectionDefined(IDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsCollectionDefined(IReadOnlyDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsDefined(T? value) + where T : struct + { + return value.HasValue; + } + + public static bool IsDefined(object value) + { + return value != null; + } + + public static bool IsDefined(JsonElement value) + { + return value.ValueKind != JsonValueKind.Undefined; + } + + public static bool IsDefined(string value) + { + return value != null; + } + } +} diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..35b5d8cb1785 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Internal/Utf8JsonRequestContent.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.IO; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.Communication.ProgrammableConnectivity +{ + internal class Utf8JsonRequestContent : RequestContent + { + private readonly MemoryStream _stream; + private readonly RequestContent _content; + + public Utf8JsonRequestContent() + { + _stream = new MemoryStream(); + _content = Create(_stream); + JsonWriter = new Utf8JsonWriter(_stream); + } + + public Utf8JsonWriter JsonWriter { get; } + + public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) + { + await JsonWriter.FlushAsync().ConfigureAwait(false); + await _content.WriteToAsync(stream, cancellationToken).ConfigureAwait(false); + } + + public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) + { + JsonWriter.Flush(); + _content.WriteTo(stream, cancellationToken); + } + + public override bool TryComputeLength(out long length) + { + length = JsonWriter.BytesCommitted + JsonWriter.BytesPending; + return true; + } + + public override void Dispose() + { + JsonWriter.Dispose(); + _content.Dispose(); + _stream.Dispose(); + } + } +} diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Ipv4Address.Serialization.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Ipv4Address.Serialization.cs new file mode 100644 index 000000000000..468473975439 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Ipv4Address.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.ProgrammableConnectivity +{ + public partial class Ipv4Address : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Ipv4Address)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("ipv4"u8); + writer.WriteStringValue(Ipv4); + writer.WritePropertyName("port"u8); + writer.WriteNumberValue(Port); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + Ipv4Address IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Ipv4Address)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIpv4Address(document.RootElement, options); + } + + internal static Ipv4Address DeserializeIpv4Address(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string ipv4 = default; + int port = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ipv4"u8)) + { + ipv4 = property.Value.GetString(); + continue; + } + if (property.NameEquals("port"u8)) + { + port = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Ipv4Address(ipv4, port, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(Ipv4Address)} does not support writing '{options.Format}' format."); + } + } + + Ipv4Address IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeIpv4Address(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Ipv4Address)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static Ipv4Address FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeIpv4Address(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResource.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Ipv4Address.cs similarity index 56% rename from sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResource.cs rename to sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Ipv4Address.cs index 966c4d6682bb..8ec205ddbc0e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResource.cs +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Ipv4Address.cs @@ -8,10 +8,10 @@ using System; using System.Collections.Generic; -namespace Azure.ResourceManager.CosmosDB.Models +namespace Azure.Communication.ProgrammableConnectivity { - /// PhysicalPartitionThroughputInfo object. - public partial class PhysicalPartitionThroughputInfoResource + /// IPv4 device indicator. + public partial class Ipv4Address { /// /// Keeps track of any properties unknown to the library. @@ -45,37 +45,37 @@ public partial class PhysicalPartitionThroughputInfoResource /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// Id of a physical partition. - /// is null. - public PhysicalPartitionThroughputInfoResource(string id) + /// Initializes a new instance of . + /// An IPv4 address. This may be specified as an exact address, or as a subnet in CIDR notation. + /// User equipment port. + /// is null. + public Ipv4Address(string ipv4, int port) { - Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(ipv4, nameof(ipv4)); - Id = id; + Ipv4 = ipv4; + Port = port; } - /// Initializes a new instance of . - /// Id of a physical partition. - /// Throughput of a physical partition. + /// Initializes a new instance of . + /// An IPv4 address. This may be specified as an exact address, or as a subnet in CIDR notation. + /// User equipment port. /// Keeps track of any properties unknown to the library. - internal PhysicalPartitionThroughputInfoResource(string id, double? throughput, IDictionary serializedAdditionalRawData) + internal Ipv4Address(string ipv4, int port, IDictionary serializedAdditionalRawData) { - Id = id; - Throughput = throughput; + Ipv4 = ipv4; + Port = port; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal PhysicalPartitionThroughputInfoResource() + /// Initializes a new instance of for deserialization. + internal Ipv4Address() { } - /// Id of a physical partition. - [WirePath("id")] - public string Id { get; set; } - /// Throughput of a physical partition. - [WirePath("throughput")] - public double? Throughput { get; set; } + /// An IPv4 address. This may be specified as an exact address, or as a subnet in CIDR notation. + public string Ipv4 { get; } + /// User equipment port. + public int Port { get; } } } diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Ipv6Address.Serialization.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Ipv6Address.Serialization.cs new file mode 100644 index 000000000000..79f98e0efb27 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Ipv6Address.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.ProgrammableConnectivity +{ + public partial class Ipv6Address : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Ipv6Address)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("ipv6"u8); + writer.WriteStringValue(Ipv6); + writer.WritePropertyName("port"u8); + writer.WriteNumberValue(Port); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + Ipv6Address IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Ipv6Address)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIpv6Address(document.RootElement, options); + } + + internal static Ipv6Address DeserializeIpv6Address(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string ipv6 = default; + int port = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ipv6"u8)) + { + ipv6 = property.Value.GetString(); + continue; + } + if (property.NameEquals("port"u8)) + { + port = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Ipv6Address(ipv6, port, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(Ipv6Address)} does not support writing '{options.Format}' format."); + } + } + + Ipv6Address IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeIpv6Address(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Ipv6Address)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static Ipv6Address FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeIpv6Address(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Ipv6Address.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Ipv6Address.cs new file mode 100644 index 000000000000..633f96886041 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/Ipv6Address.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.ProgrammableConnectivity +{ + /// IPv6 device indicator. + public partial class Ipv6Address + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// An IPv6 address. This may be specified as an exact address, or as a subnet in CIDR notation. + /// User equipment port. + /// is null. + public Ipv6Address(string ipv6, int port) + { + Argument.AssertNotNull(ipv6, nameof(ipv6)); + + Ipv6 = ipv6; + Port = port; + } + + /// Initializes a new instance of . + /// An IPv6 address. This may be specified as an exact address, or as a subnet in CIDR notation. + /// User equipment port. + /// Keeps track of any properties unknown to the library. + internal Ipv6Address(string ipv6, int port, IDictionary serializedAdditionalRawData) + { + Ipv6 = ipv6; + Port = port; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal Ipv6Address() + { + } + + /// An IPv6 address. This may be specified as an exact address, or as a subnet in CIDR notation. + public string Ipv6 { get; } + /// User equipment port. + public int Port { get; } + } +} diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/LocationDevice.Serialization.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/LocationDevice.Serialization.cs new file mode 100644 index 000000000000..74b728af681f --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/LocationDevice.Serialization.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.ProgrammableConnectivity +{ + public partial class LocationDevice : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LocationDevice)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(NetworkAccessIdentifier)) + { + writer.WritePropertyName("networkAccessIdentifier"u8); + writer.WriteStringValue(NetworkAccessIdentifier); + } + if (Optional.IsDefined(PhoneNumber)) + { + writer.WritePropertyName("phoneNumber"u8); + writer.WriteStringValue(PhoneNumber); + } + if (Optional.IsDefined(Ipv4Address)) + { + writer.WritePropertyName("ipv4Address"u8); + writer.WriteObjectValue(Ipv4Address, options); + } + if (Optional.IsDefined(Ipv6Address)) + { + writer.WritePropertyName("ipv6Address"u8); + writer.WriteObjectValue(Ipv6Address, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + LocationDevice IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LocationDevice)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLocationDevice(document.RootElement, options); + } + + internal static LocationDevice DeserializeLocationDevice(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string networkAccessIdentifier = default; + string phoneNumber = default; + Ipv4Address ipv4Address = default; + Ipv6Address ipv6Address = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("networkAccessIdentifier"u8)) + { + networkAccessIdentifier = property.Value.GetString(); + continue; + } + if (property.NameEquals("phoneNumber"u8)) + { + phoneNumber = property.Value.GetString(); + continue; + } + if (property.NameEquals("ipv4Address"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ipv4Address = Ipv4Address.DeserializeIpv4Address(property.Value, options); + continue; + } + if (property.NameEquals("ipv6Address"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ipv6Address = Ipv6Address.DeserializeIpv6Address(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LocationDevice(networkAccessIdentifier, phoneNumber, ipv4Address, ipv6Address, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(LocationDevice)} does not support writing '{options.Format}' format."); + } + } + + LocationDevice IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeLocationDevice(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LocationDevice)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static LocationDevice FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeLocationDevice(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/LocationDevice.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/LocationDevice.cs new file mode 100644 index 000000000000..6748649f211b --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/LocationDevice.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.ProgrammableConnectivity +{ + /// Device information needed by operator to provide location information. Include exactly one of these properties to identify your device. + public partial class LocationDevice + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public LocationDevice() + { + } + + /// Initializes a new instance of . + /// External identifier or network access identifier of the device. + /// Phone number in E.164 format (starting with country code), and optionally prefixed with '+'. + /// The Ipv4 address. + /// The Ipv6 address. + /// Keeps track of any properties unknown to the library. + internal LocationDevice(string networkAccessIdentifier, string phoneNumber, Ipv4Address ipv4Address, Ipv6Address ipv6Address, IDictionary serializedAdditionalRawData) + { + NetworkAccessIdentifier = networkAccessIdentifier; + PhoneNumber = phoneNumber; + Ipv4Address = ipv4Address; + Ipv6Address = ipv6Address; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// External identifier or network access identifier of the device. + public string NetworkAccessIdentifier { get; set; } + /// Phone number in E.164 format (starting with country code), and optionally prefixed with '+'. + public string PhoneNumber { get; set; } + /// The Ipv4 address. + public Ipv4Address Ipv4Address { get; set; } + /// The Ipv6 address. + public Ipv6Address Ipv6Address { get; set; } + } +} diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NetworkIdentifier.Serialization.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NetworkIdentifier.Serialization.cs new file mode 100644 index 000000000000..6107cdb8441f --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NetworkIdentifier.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.ProgrammableConnectivity +{ + public partial class NetworkIdentifier : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkIdentifier)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("identifierType"u8); + writer.WriteStringValue(IdentifierType); + writer.WritePropertyName("identifier"u8); + writer.WriteStringValue(Identifier); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + NetworkIdentifier IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkIdentifier)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNetworkIdentifier(document.RootElement, options); + } + + internal static NetworkIdentifier DeserializeNetworkIdentifier(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string identifierType = default; + string identifier = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("identifierType"u8)) + { + identifierType = property.Value.GetString(); + continue; + } + if (property.NameEquals("identifier"u8)) + { + identifier = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NetworkIdentifier(identifierType, identifier, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(NetworkIdentifier)} does not support writing '{options.Format}' format."); + } + } + + NetworkIdentifier IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeNetworkIdentifier(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NetworkIdentifier)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static NetworkIdentifier FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeNetworkIdentifier(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NetworkIdentifier.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NetworkIdentifier.cs new file mode 100644 index 000000000000..daa37ff741a6 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NetworkIdentifier.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.ProgrammableConnectivity +{ + /// Identifier for the network to be queried. + public partial class NetworkIdentifier + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The type of identifier for the network. one of: 'IPv4', 'IPv6', 'NetworkCode'. + /// + /// The network identifier, based on the identifierType: an IPv4 address, and IPv6 address, or a Network Code. + /// A Network Code may be obtained from APC documentation or from the APC /Network:retrieve endpoint. + /// + /// or is null. + public NetworkIdentifier(string identifierType, string identifier) + { + Argument.AssertNotNull(identifierType, nameof(identifierType)); + Argument.AssertNotNull(identifier, nameof(identifier)); + + IdentifierType = identifierType; + Identifier = identifier; + } + + /// Initializes a new instance of . + /// The type of identifier for the network. one of: 'IPv4', 'IPv6', 'NetworkCode'. + /// + /// The network identifier, based on the identifierType: an IPv4 address, and IPv6 address, or a Network Code. + /// A Network Code may be obtained from APC documentation or from the APC /Network:retrieve endpoint. + /// + /// Keeps track of any properties unknown to the library. + internal NetworkIdentifier(string identifierType, string identifier, IDictionary serializedAdditionalRawData) + { + IdentifierType = identifierType; + Identifier = identifier; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal NetworkIdentifier() + { + } + + /// The type of identifier for the network. one of: 'IPv4', 'IPv6', 'NetworkCode'. + public string IdentifierType { get; } + /// + /// The network identifier, based on the identifierType: an IPv4 address, and IPv6 address, or a Network Code. + /// A Network Code may be obtained from APC documentation or from the APC /Network:retrieve endpoint. + /// + public string Identifier { get; } + } +} diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NetworkRetrievalResult.Serialization.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NetworkRetrievalResult.Serialization.cs new file mode 100644 index 000000000000..864d764a58e6 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NetworkRetrievalResult.Serialization.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.ProgrammableConnectivity +{ + public partial class NetworkRetrievalResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkRetrievalResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("networkCode"u8); + writer.WriteStringValue(NetworkCode); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + NetworkRetrievalResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkRetrievalResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNetworkRetrievalResult(document.RootElement, options); + } + + internal static NetworkRetrievalResult DeserializeNetworkRetrievalResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string networkCode = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("networkCode"u8)) + { + networkCode = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NetworkRetrievalResult(networkCode, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(NetworkRetrievalResult)} does not support writing '{options.Format}' format."); + } + } + + NetworkRetrievalResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeNetworkRetrievalResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NetworkRetrievalResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static NetworkRetrievalResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeNetworkRetrievalResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationData.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NetworkRetrievalResult.cs similarity index 57% rename from sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationData.cs rename to sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NetworkRetrievalResult.cs index 930f80e24c35..5c6e83c30533 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationData.cs +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NetworkRetrievalResult.cs @@ -7,17 +7,11 @@ using System; using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Models; -namespace Azure.ResourceManager.CosmosDB +namespace Azure.Communication.ProgrammableConnectivity { - /// - /// A class representing the NetworkSecurityPerimeterConfiguration data model. - /// Network security perimeter (NSP) configuration resource - /// - public partial class NetworkSecurityPerimeterConfigurationData : ResourceData + /// The network that the device is on. + public partial class NetworkRetrievalResult { /// /// Keeps track of any properties unknown to the library. @@ -51,26 +45,31 @@ public partial class NetworkSecurityPerimeterConfigurationData : ResourceData /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public NetworkSecurityPerimeterConfigurationData() + /// Initializes a new instance of . + /// The identifier for the network. This can be used as the networkIdentifier for the service APIs. + /// is null. + internal NetworkRetrievalResult(string networkCode) { + Argument.AssertNotNull(networkCode, nameof(networkCode)); + + NetworkCode = networkCode; } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Network security configuration properties. + /// Initializes a new instance of . + /// The identifier for the network. This can be used as the networkIdentifier for the service APIs. /// Keeps track of any properties unknown to the library. - internal NetworkSecurityPerimeterConfigurationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, NetworkSecurityPerimeterConfigurationProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal NetworkRetrievalResult(string networkCode, IDictionary serializedAdditionalRawData) { - Properties = properties; + NetworkCode = networkCode; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Network security configuration properties. - [WirePath("properties")] - public NetworkSecurityPerimeterConfigurationProperties Properties { get; set; } + /// Initializes a new instance of for deserialization. + internal NetworkRetrievalResult() + { + } + + /// The identifier for the network. This can be used as the networkIdentifier for the service APIs. + public string NetworkCode { get; } } } diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NumberVerification.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NumberVerification.cs new file mode 100644 index 000000000000..19e87e8c27f6 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NumberVerification.cs @@ -0,0 +1,347 @@ +// 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.Core; +using Azure.Core.Pipeline; + +namespace Azure.Communication.ProgrammableConnectivity +{ + // Data plane generated sub-client. + /// + /// Number operations include Frontend Authentication. + /// + /// Users first make a call to the endpoint /Number:verify, which returns a redirect to the device's + /// Network. This is followed by the device to authenticate directly with the Network. The Network + /// responds with a token and a redirect. This token can be exchanged with APC for a code. + /// + /// Users make a second call to the endpoint /Number:verify including the code. The code is used + /// to verify the device number. The second response is a 200 containing the result of the query. + /// + /// For more information on the steps required to use Number Verificaiton, see the APC documentation. + /// + public partial class NumberVerification + { + private static readonly string[] AuthorizationScopes = new string[] { "https://management.azure.com//.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of NumberVerification for mocking. + protected NumberVerification() + { + } + + /// Initializes a new instance of NumberVerification. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The token credential to copy. + /// An Azure Programmable Connectivity Endpoint providing access to Network APIs, for example https://{region}.apcgatewayapi.azure.com. + /// The API version to use for this operation. + internal NumberVerification(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, TokenCredential tokenCredential, Uri endpoint, string apiVersion) + { + ClientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + _tokenCredential = tokenCredential; + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + /// Verifies the phone number (MSISDN) associated with a device. As part of the frontend authorization flow, the device is redirected to the operator network to authenticate directly. + /// The identifier of the APC Gateway resource which should handle this request. + /// Body parameter. + /// The cancellation token to use. + /// or is null. + /// + public virtual async Task VerifyWithoutCodeAsync(string apcGatewayId, NumberVerificationWithoutCodeContent body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(apcGatewayId, nameof(apcGatewayId)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await VerifyWithoutCodeAsync(apcGatewayId, content, context).ConfigureAwait(false); + return response; + } + + /// Verifies the phone number (MSISDN) associated with a device. As part of the frontend authorization flow, the device is redirected to the operator network to authenticate directly. + /// The identifier of the APC Gateway resource which should handle this request. + /// Body parameter. + /// The cancellation token to use. + /// or is null. + /// + public virtual Response VerifyWithoutCode(string apcGatewayId, NumberVerificationWithoutCodeContent body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(apcGatewayId, nameof(apcGatewayId)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = VerifyWithoutCode(apcGatewayId, content, context); + return response; + } + + /// + /// [Protocol Method] Verifies the phone number (MSISDN) associated with a device. As part of the frontend authorization flow, the device is redirected to the operator network to authenticate directly. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The identifier of the APC Gateway resource which should handle this request. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task VerifyWithoutCodeAsync(string apcGatewayId, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(apcGatewayId, nameof(apcGatewayId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("NumberVerification.VerifyWithoutCode"); + scope.Start(); + try + { + using HttpMessage message = CreateVerifyWithoutCodeRequest(apcGatewayId, content, context); + RedirectPolicy.SetAllowAutoRedirect(message, true); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Verifies the phone number (MSISDN) associated with a device. As part of the frontend authorization flow, the device is redirected to the operator network to authenticate directly. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The identifier of the APC Gateway resource which should handle this request. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response VerifyWithoutCode(string apcGatewayId, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(apcGatewayId, nameof(apcGatewayId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("NumberVerification.VerifyWithoutCode"); + scope.Start(); + try + { + using HttpMessage message = CreateVerifyWithoutCodeRequest(apcGatewayId, content, context); + RedirectPolicy.SetAllowAutoRedirect(message, true); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Verifies the phone number (MSISDN) associated with a device. + /// The identifier of the APC Gateway resource which should handle this request. + /// Body parameter. + /// The cancellation token to use. + /// or is null. + /// + public virtual async Task> VerifyWithCodeAsync(string apcGatewayId, NumberVerificationWithCodeContent body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(apcGatewayId, nameof(apcGatewayId)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await VerifyWithCodeAsync(apcGatewayId, content, context).ConfigureAwait(false); + return Response.FromValue(NumberVerificationResult.FromResponse(response), response); + } + + /// Verifies the phone number (MSISDN) associated with a device. + /// The identifier of the APC Gateway resource which should handle this request. + /// Body parameter. + /// The cancellation token to use. + /// or is null. + /// + public virtual Response VerifyWithCode(string apcGatewayId, NumberVerificationWithCodeContent body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(apcGatewayId, nameof(apcGatewayId)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = VerifyWithCode(apcGatewayId, content, context); + return Response.FromValue(NumberVerificationResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Verifies the phone number (MSISDN) associated with a device. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The identifier of the APC Gateway resource which should handle this request. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task VerifyWithCodeAsync(string apcGatewayId, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(apcGatewayId, nameof(apcGatewayId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("NumberVerification.VerifyWithCode"); + scope.Start(); + try + { + using HttpMessage message = CreateVerifyWithCodeRequest(apcGatewayId, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Verifies the phone number (MSISDN) associated with a device. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The identifier of the APC Gateway resource which should handle this request. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response VerifyWithCode(string apcGatewayId, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(apcGatewayId, nameof(apcGatewayId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("NumberVerification.VerifyWithCode"); + scope.Start(); + try + { + using HttpMessage message = CreateVerifyWithCodeRequest(apcGatewayId, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + internal HttpMessage CreateVerifyWithoutCodeRequest(string apcGatewayId, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier302); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/number-verification/number:verify", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("apc-gateway-id", apcGatewayId); + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateVerifyWithCodeRequest(string apcGatewayId, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/number-verification/number:verify", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("apc-gateway-id", apcGatewayId); + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier302; + private static ResponseClassifier ResponseClassifier302 => _responseClassifier302 ??= new StatusCodeClassifier(stackalloc ushort[] { 302 }); + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + } +} diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NumberVerificationResult.Serialization.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NumberVerificationResult.Serialization.cs new file mode 100644 index 000000000000..bc908ec65cc4 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NumberVerificationResult.Serialization.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.ProgrammableConnectivity +{ + public partial class NumberVerificationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NumberVerificationResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("verificationResult"u8); + writer.WriteBooleanValue(VerificationResult); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + NumberVerificationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NumberVerificationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNumberVerificationResult(document.RootElement, options); + } + + internal static NumberVerificationResult DeserializeNumberVerificationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool verificationResult = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("verificationResult"u8)) + { + verificationResult = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NumberVerificationResult(verificationResult, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(NumberVerificationResult)} does not support writing '{options.Format}' format."); + } + } + + NumberVerificationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeNumberVerificationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NumberVerificationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static NumberVerificationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeNumberVerificationResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfo.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NumberVerificationResult.cs similarity index 58% rename from sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfo.cs rename to sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NumberVerificationResult.cs index a2d430ffe7a2..eb64683bbfcf 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfo.cs +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NumberVerificationResult.cs @@ -8,10 +8,10 @@ using System; using System.Collections.Generic; -namespace Azure.ResourceManager.CosmosDB.Models +namespace Azure.Communication.ProgrammableConnectivity { - /// The storage of a physical partition. - public partial class PhysicalPartitionStorageInfo + /// Response verifying number of device. + public partial class NumberVerificationResult { /// /// Keeps track of any properties unknown to the library. @@ -45,27 +45,28 @@ public partial class PhysicalPartitionStorageInfo /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal PhysicalPartitionStorageInfo() + /// Initializes a new instance of . + /// True if number if the phone number matches the device, False otherwise. + internal NumberVerificationResult(bool verificationResult) { + VerificationResult = verificationResult; } - /// Initializes a new instance of . - /// The unique identifier of the partition. - /// The storage in KB for the physical partition. + /// Initializes a new instance of . + /// True if number if the phone number matches the device, False otherwise. /// Keeps track of any properties unknown to the library. - internal PhysicalPartitionStorageInfo(string id, double? storageInKB, IDictionary serializedAdditionalRawData) + internal NumberVerificationResult(bool verificationResult, IDictionary serializedAdditionalRawData) { - Id = id; - StorageInKB = storageInKB; + VerificationResult = verificationResult; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The unique identifier of the partition. - [WirePath("id")] - public string Id { get; } - /// The storage in KB for the physical partition. - [WirePath("storageInKB")] - public double? StorageInKB { get; } + /// Initializes a new instance of for deserialization. + internal NumberVerificationResult() + { + } + + /// True if number if the phone number matches the device, False otherwise. + public bool VerificationResult { get; } } } diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NumberVerificationWithCodeContent.Serialization.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NumberVerificationWithCodeContent.Serialization.cs new file mode 100644 index 000000000000..5a701c48ad5b --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NumberVerificationWithCodeContent.Serialization.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.ProgrammableConnectivity +{ + public partial class NumberVerificationWithCodeContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NumberVerificationWithCodeContent)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("apcCode"u8); + writer.WriteStringValue(ApcCode); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + NumberVerificationWithCodeContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NumberVerificationWithCodeContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNumberVerificationWithCodeContent(document.RootElement, options); + } + + internal static NumberVerificationWithCodeContent DeserializeNumberVerificationWithCodeContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string apcCode = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("apcCode"u8)) + { + apcCode = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NumberVerificationWithCodeContent(apcCode, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(NumberVerificationWithCodeContent)} does not support writing '{options.Format}' format."); + } + } + + NumberVerificationWithCodeContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeNumberVerificationWithCodeContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NumberVerificationWithCodeContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static NumberVerificationWithCodeContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeNumberVerificationWithCodeContent(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NumberVerificationWithCodeContent.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NumberVerificationWithCodeContent.cs new file mode 100644 index 000000000000..14409d3fc5c0 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NumberVerificationWithCodeContent.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.ProgrammableConnectivity +{ + /// Request to verify number of device - second call. + public partial class NumberVerificationWithCodeContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The code provided by APC in exchange for the operator code. + /// is null. + public NumberVerificationWithCodeContent(string apcCode) + { + Argument.AssertNotNull(apcCode, nameof(apcCode)); + + ApcCode = apcCode; + } + + /// Initializes a new instance of . + /// The code provided by APC in exchange for the operator code. + /// Keeps track of any properties unknown to the library. + internal NumberVerificationWithCodeContent(string apcCode, IDictionary serializedAdditionalRawData) + { + ApcCode = apcCode; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal NumberVerificationWithCodeContent() + { + } + + /// The code provided by APC in exchange for the operator code. + public string ApcCode { get; } + } +} diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NumberVerificationWithoutCodeContent.Serialization.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NumberVerificationWithoutCodeContent.Serialization.cs new file mode 100644 index 000000000000..e973d287b424 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NumberVerificationWithoutCodeContent.Serialization.cs @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.ProgrammableConnectivity +{ + public partial class NumberVerificationWithoutCodeContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NumberVerificationWithoutCodeContent)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("networkIdentifier"u8); + writer.WriteObjectValue(NetworkIdentifier, options); + if (Optional.IsDefined(PhoneNumber)) + { + writer.WritePropertyName("phoneNumber"u8); + writer.WriteStringValue(PhoneNumber); + } + if (Optional.IsDefined(HashedPhoneNumber)) + { + writer.WritePropertyName("hashedPhoneNumber"u8); + writer.WriteStringValue(HashedPhoneNumber); + } + writer.WritePropertyName("redirectUri"u8); + writer.WriteStringValue(RedirectUri.AbsoluteUri); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + NumberVerificationWithoutCodeContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NumberVerificationWithoutCodeContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNumberVerificationWithoutCodeContent(document.RootElement, options); + } + + internal static NumberVerificationWithoutCodeContent DeserializeNumberVerificationWithoutCodeContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NetworkIdentifier networkIdentifier = default; + string phoneNumber = default; + string hashedPhoneNumber = default; + Uri redirectUri = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("networkIdentifier"u8)) + { + networkIdentifier = NetworkIdentifier.DeserializeNetworkIdentifier(property.Value, options); + continue; + } + if (property.NameEquals("phoneNumber"u8)) + { + phoneNumber = property.Value.GetString(); + continue; + } + if (property.NameEquals("hashedPhoneNumber"u8)) + { + hashedPhoneNumber = property.Value.GetString(); + continue; + } + if (property.NameEquals("redirectUri"u8)) + { + redirectUri = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NumberVerificationWithoutCodeContent(networkIdentifier, phoneNumber, hashedPhoneNumber, redirectUri, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(NumberVerificationWithoutCodeContent)} does not support writing '{options.Format}' format."); + } + } + + NumberVerificationWithoutCodeContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeNumberVerificationWithoutCodeContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NumberVerificationWithoutCodeContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static NumberVerificationWithoutCodeContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeNumberVerificationWithoutCodeContent(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NumberVerificationWithoutCodeContent.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NumberVerificationWithoutCodeContent.cs new file mode 100644 index 000000000000..28dfa4af54fb --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/NumberVerificationWithoutCodeContent.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.ProgrammableConnectivity +{ + /// Request to verify number of device - first call. + public partial class NumberVerificationWithoutCodeContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Identifier for the network to query for this device. + /// Redirect URI to backend application. + /// or is null. + public NumberVerificationWithoutCodeContent(NetworkIdentifier networkIdentifier, Uri redirectUri) + { + Argument.AssertNotNull(networkIdentifier, nameof(networkIdentifier)); + Argument.AssertNotNull(redirectUri, nameof(redirectUri)); + + NetworkIdentifier = networkIdentifier; + RedirectUri = redirectUri; + } + + /// Initializes a new instance of . + /// Identifier for the network to query for this device. + /// Phone number in E.164 format (starting with country code), and optionally prefixed with '+'. + /// Hashed phone number. SHA-256 (in hexadecimal representation) of the mobile phone number in **E.164 format (starting with country code)**. Optionally prefixed with '+'. + /// Redirect URI to backend application. + /// Keeps track of any properties unknown to the library. + internal NumberVerificationWithoutCodeContent(NetworkIdentifier networkIdentifier, string phoneNumber, string hashedPhoneNumber, Uri redirectUri, IDictionary serializedAdditionalRawData) + { + NetworkIdentifier = networkIdentifier; + PhoneNumber = phoneNumber; + HashedPhoneNumber = hashedPhoneNumber; + RedirectUri = redirectUri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal NumberVerificationWithoutCodeContent() + { + } + + /// Identifier for the network to query for this device. + public NetworkIdentifier NetworkIdentifier { get; } + /// Phone number in E.164 format (starting with country code), and optionally prefixed with '+'. + public string PhoneNumber { get; set; } + /// Hashed phone number. SHA-256 (in hexadecimal representation) of the mobile phone number in **E.164 format (starting with country code)**. Optionally prefixed with '+'. + public string HashedPhoneNumber { get; set; } + /// Redirect URI to backend application. + public Uri RedirectUri { get; } + } +} diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/ProgrammableConnectivityClient.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/ProgrammableConnectivityClient.cs new file mode 100644 index 000000000000..78178e8158db --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/ProgrammableConnectivityClient.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Communication.ProgrammableConnectivity +{ + // Data plane generated client. + /// Azure Programmable Connectivity (APC) provides a unified interface to the Network APIs of multiple Telecom Operators. Note that Operators may deprecate a Network API with less advance notice than the Azure standard, in which case APC will also deprecate that Network API. + public partial class ProgrammableConnectivityClient + { + private static readonly string[] AuthorizationScopes = new string[] { "https://management.azure.com//.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of ProgrammableConnectivityClient for mocking. + protected ProgrammableConnectivityClient() + { + } + + /// Initializes a new instance of ProgrammableConnectivityClient. + /// An Azure Programmable Connectivity Endpoint providing access to Network APIs, for example https://{region}.apcgatewayapi.azure.com. + /// A credential used to authenticate to an Azure Service. + /// or is null. + public ProgrammableConnectivityClient(Uri endpoint, TokenCredential credential) : this(endpoint, credential, new ProgrammableConnectivityClientOptions()) + { + } + + /// Initializes a new instance of ProgrammableConnectivityClient. + /// An Azure Programmable Connectivity Endpoint providing access to Network APIs, for example https://{region}.apcgatewayapi.azure.com. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public ProgrammableConnectivityClient(Uri endpoint, TokenCredential credential, ProgrammableConnectivityClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new ProgrammableConnectivityClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _tokenCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); + _endpoint = endpoint; + } + + /// Initializes a new instance of DeviceLocation. + /// The API version to use for this operation. + /// is null. + public virtual DeviceLocation GetDeviceLocationClient(string apiVersion = "2024-02-09-preview") + { + Argument.AssertNotNull(apiVersion, nameof(apiVersion)); + + return new DeviceLocation(ClientDiagnostics, _pipeline, _tokenCredential, _endpoint, apiVersion); + } + + /// Initializes a new instance of DeviceNetwork. + /// The API version to use for this operation. + /// is null. + public virtual DeviceNetwork GetDeviceNetworkClient(string apiVersion = "2024-02-09-preview") + { + Argument.AssertNotNull(apiVersion, nameof(apiVersion)); + + return new DeviceNetwork(ClientDiagnostics, _pipeline, _tokenCredential, _endpoint, apiVersion); + } + + /// Initializes a new instance of NumberVerification. + /// The API version to use for this operation. + /// is null. + public virtual NumberVerification GetNumberVerificationClient(string apiVersion = "2024-02-09-preview") + { + Argument.AssertNotNull(apiVersion, nameof(apiVersion)); + + return new NumberVerification(ClientDiagnostics, _pipeline, _tokenCredential, _endpoint, apiVersion); + } + + /// Initializes a new instance of SimSwap. + /// The API version to use for this operation. + /// is null. + public virtual SimSwap GetSimSwapClient(string apiVersion = "2024-02-09-preview") + { + Argument.AssertNotNull(apiVersion, nameof(apiVersion)); + + return new SimSwap(ClientDiagnostics, _pipeline, _tokenCredential, _endpoint, apiVersion); + } + } +} diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/ProgrammableConnectivityClientOptions.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/ProgrammableConnectivityClientOptions.cs new file mode 100644 index 000000000000..f502d00b4e97 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/ProgrammableConnectivityClientOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Communication.ProgrammableConnectivity +{ + /// Client options for ProgrammableConnectivityClient. + public partial class ProgrammableConnectivityClientOptions : ClientOptions + { + private const ServiceVersion LatestVersion = ServiceVersion.V2024_02_09_Preview; + + /// The version of the service to use. + public enum ServiceVersion + { + /// Service version "2024-02-09-preview". + V2024_02_09_Preview = 1, + } + + internal string Version { get; } + + /// Initializes new instance of ProgrammableConnectivityClientOptions. + public ProgrammableConnectivityClientOptions(ServiceVersion version = LatestVersion) + { + Version = version switch + { + ServiceVersion.V2024_02_09_Preview => "2024-02-09-preview", + _ => throw new NotSupportedException() + }; + } + } +} diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/SimSwap.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/SimSwap.cs new file mode 100644 index 000000000000..c8696bdccb13 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/SimSwap.cs @@ -0,0 +1,332 @@ +// 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.Core; +using Azure.Core.Pipeline; + +namespace Azure.Communication.ProgrammableConnectivity +{ + // Data plane generated sub-client. + /// SIM Swap API provides the customer the ability to obtain information on any recent SIM pairing change related to the User's mobile account. + public partial class SimSwap + { + private static readonly string[] AuthorizationScopes = new string[] { "https://management.azure.com//.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of SimSwap for mocking. + protected SimSwap() + { + } + + /// Initializes a new instance of SimSwap. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The token credential to copy. + /// An Azure Programmable Connectivity Endpoint providing access to Network APIs, for example https://{region}.apcgatewayapi.azure.com. + /// The API version to use for this operation. + internal SimSwap(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, TokenCredential tokenCredential, Uri endpoint, string apiVersion) + { + ClientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + _tokenCredential = tokenCredential; + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + /// Provides timestamp of latest SIM swap. + /// The identifier of the APC Gateway resource which should handle this request. + /// Body parameter. + /// The cancellation token to use. + /// or is null. + /// + public virtual async Task> RetrieveAsync(string apcGatewayId, SimSwapRetrievalContent body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(apcGatewayId, nameof(apcGatewayId)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await RetrieveAsync(apcGatewayId, content, context).ConfigureAwait(false); + return Response.FromValue(SimSwapRetrievalResult.FromResponse(response), response); + } + + /// Provides timestamp of latest SIM swap. + /// The identifier of the APC Gateway resource which should handle this request. + /// Body parameter. + /// The cancellation token to use. + /// or is null. + /// + public virtual Response Retrieve(string apcGatewayId, SimSwapRetrievalContent body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(apcGatewayId, nameof(apcGatewayId)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = Retrieve(apcGatewayId, content, context); + return Response.FromValue(SimSwapRetrievalResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Provides timestamp of latest SIM swap + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The identifier of the APC Gateway resource which should handle this request. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task RetrieveAsync(string apcGatewayId, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(apcGatewayId, nameof(apcGatewayId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("SimSwap.Retrieve"); + scope.Start(); + try + { + using HttpMessage message = CreateRetrieveRequest(apcGatewayId, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Provides timestamp of latest SIM swap + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The identifier of the APC Gateway resource which should handle this request. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Retrieve(string apcGatewayId, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(apcGatewayId, nameof(apcGatewayId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("SimSwap.Retrieve"); + scope.Start(); + try + { + using HttpMessage message = CreateRetrieveRequest(apcGatewayId, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Verifies if a SIM swap has been performed during a past period (defined in the request with 'maxAgeHours' attribute). Returns 'True' if a SIM swap has occured. + /// The identifier of the APC Gateway resource which should handle this request. + /// Body parameter. + /// The cancellation token to use. + /// or is null. + /// + public virtual async Task> VerifyAsync(string apcGatewayId, SimSwapVerificationContent body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(apcGatewayId, nameof(apcGatewayId)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await VerifyAsync(apcGatewayId, content, context).ConfigureAwait(false); + return Response.FromValue(SimSwapVerificationResult.FromResponse(response), response); + } + + /// Verifies if a SIM swap has been performed during a past period (defined in the request with 'maxAgeHours' attribute). Returns 'True' if a SIM swap has occured. + /// The identifier of the APC Gateway resource which should handle this request. + /// Body parameter. + /// The cancellation token to use. + /// or is null. + /// + public virtual Response Verify(string apcGatewayId, SimSwapVerificationContent body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(apcGatewayId, nameof(apcGatewayId)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = Verify(apcGatewayId, content, context); + return Response.FromValue(SimSwapVerificationResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Verifies if a SIM swap has been performed during a past period (defined in the request with 'maxAgeHours' attribute). Returns 'True' if a SIM swap has occured. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The identifier of the APC Gateway resource which should handle this request. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task VerifyAsync(string apcGatewayId, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(apcGatewayId, nameof(apcGatewayId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("SimSwap.Verify"); + scope.Start(); + try + { + using HttpMessage message = CreateVerifyRequest(apcGatewayId, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Verifies if a SIM swap has been performed during a past period (defined in the request with 'maxAgeHours' attribute). Returns 'True' if a SIM swap has occured. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The identifier of the APC Gateway resource which should handle this request. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Verify(string apcGatewayId, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(apcGatewayId, nameof(apcGatewayId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("SimSwap.Verify"); + scope.Start(); + try + { + using HttpMessage message = CreateVerifyRequest(apcGatewayId, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + internal HttpMessage CreateRetrieveRequest(string apcGatewayId, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/sim-swap/sim-swap:retrieve", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("apc-gateway-id", apcGatewayId); + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateVerifyRequest(string apcGatewayId, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/sim-swap/sim-swap:verify", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("apc-gateway-id", apcGatewayId); + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + } +} diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/SimSwapRetrievalContent.Serialization.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/SimSwapRetrievalContent.Serialization.cs new file mode 100644 index 000000000000..ea698cbf4c3f --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/SimSwapRetrievalContent.Serialization.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.ProgrammableConnectivity +{ + public partial class SimSwapRetrievalContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SimSwapRetrievalContent)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(PhoneNumber)) + { + writer.WritePropertyName("phoneNumber"u8); + writer.WriteStringValue(PhoneNumber); + } + writer.WritePropertyName("networkIdentifier"u8); + writer.WriteObjectValue(NetworkIdentifier, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + SimSwapRetrievalContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SimSwapRetrievalContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSimSwapRetrievalContent(document.RootElement, options); + } + + internal static SimSwapRetrievalContent DeserializeSimSwapRetrievalContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string phoneNumber = default; + NetworkIdentifier networkIdentifier = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("phoneNumber"u8)) + { + phoneNumber = property.Value.GetString(); + continue; + } + if (property.NameEquals("networkIdentifier"u8)) + { + networkIdentifier = NetworkIdentifier.DeserializeNetworkIdentifier(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SimSwapRetrievalContent(phoneNumber, networkIdentifier, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SimSwapRetrievalContent)} does not support writing '{options.Format}' format."); + } + } + + SimSwapRetrievalContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSimSwapRetrievalContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SimSwapRetrievalContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SimSwapRetrievalContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeSimSwapRetrievalContent(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/SimSwapRetrievalContent.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/SimSwapRetrievalContent.cs new file mode 100644 index 000000000000..7a2b28d912fa --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/SimSwapRetrievalContent.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.ProgrammableConnectivity +{ + /// Request to retrieve SimSwap date. + public partial class SimSwapRetrievalContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Network to query for this device. + /// is null. + public SimSwapRetrievalContent(NetworkIdentifier networkIdentifier) + { + Argument.AssertNotNull(networkIdentifier, nameof(networkIdentifier)); + + NetworkIdentifier = networkIdentifier; + } + + /// Initializes a new instance of . + /// Phone number in E.164 format (starting with country code), and optionally prefixed with '+'. + /// Network to query for this device. + /// Keeps track of any properties unknown to the library. + internal SimSwapRetrievalContent(string phoneNumber, NetworkIdentifier networkIdentifier, IDictionary serializedAdditionalRawData) + { + PhoneNumber = phoneNumber; + NetworkIdentifier = networkIdentifier; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SimSwapRetrievalContent() + { + } + + /// Phone number in E.164 format (starting with country code), and optionally prefixed with '+'. + public string PhoneNumber { get; set; } + /// Network to query for this device. + public NetworkIdentifier NetworkIdentifier { get; } + } +} diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/SimSwapRetrievalResult.Serialization.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/SimSwapRetrievalResult.Serialization.cs new file mode 100644 index 000000000000..c016e98edecb --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/SimSwapRetrievalResult.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.ProgrammableConnectivity +{ + public partial class SimSwapRetrievalResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SimSwapRetrievalResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Date)) + { + writer.WritePropertyName("date"u8); + writer.WriteStringValue(Date.Value, "O"); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + SimSwapRetrievalResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SimSwapRetrievalResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSimSwapRetrievalResult(document.RootElement, options); + } + + internal static SimSwapRetrievalResult DeserializeSimSwapRetrievalResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset? date = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("date"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + date = property.Value.GetDateTimeOffset("O"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SimSwapRetrievalResult(date, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SimSwapRetrievalResult)} does not support writing '{options.Format}' format."); + } + } + + SimSwapRetrievalResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSimSwapRetrievalResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SimSwapRetrievalResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SimSwapRetrievalResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeSimSwapRetrievalResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MergeParameters.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/SimSwapRetrievalResult.cs similarity index 68% rename from sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MergeParameters.cs rename to sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/SimSwapRetrievalResult.cs index 86efed3e5857..696048ae6a51 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MergeParameters.cs +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/SimSwapRetrievalResult.cs @@ -8,10 +8,10 @@ using System; using System.Collections.Generic; -namespace Azure.ResourceManager.CosmosDB.Models +namespace Azure.Communication.ProgrammableConnectivity { - /// The properties of an Azure Cosmos DB merge operations. - public partial class MergeParameters + /// Response with SimSwap date. + public partial class SimSwapRetrievalResult { /// /// Keeps track of any properties unknown to the library. @@ -45,22 +45,21 @@ public partial class MergeParameters /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public MergeParameters() + /// Initializes a new instance of . + internal SimSwapRetrievalResult() { } - /// Initializes a new instance of . - /// Specifies whether the operation is a real merge operation or a simulation. + /// Initializes a new instance of . + /// Datetime of most recent swap for SIM. /// Keeps track of any properties unknown to the library. - internal MergeParameters(bool? isDryRun, IDictionary serializedAdditionalRawData) + internal SimSwapRetrievalResult(DateTimeOffset? date, IDictionary serializedAdditionalRawData) { - IsDryRun = isDryRun; + Date = date; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Specifies whether the operation is a real merge operation or a simulation. - [WirePath("isDryRun")] - public bool? IsDryRun { get; set; } + /// Datetime of most recent swap for SIM. + public DateTimeOffset? Date { get; } } } diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/SimSwapVerificationContent.Serialization.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/SimSwapVerificationContent.Serialization.cs new file mode 100644 index 000000000000..78a8b2f7a839 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/SimSwapVerificationContent.Serialization.cs @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.ProgrammableConnectivity +{ + public partial class SimSwapVerificationContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SimSwapVerificationContent)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(PhoneNumber)) + { + writer.WritePropertyName("phoneNumber"u8); + writer.WriteStringValue(PhoneNumber); + } + if (Optional.IsDefined(MaxAgeHours)) + { + writer.WritePropertyName("maxAgeHours"u8); + writer.WriteNumberValue(MaxAgeHours.Value); + } + writer.WritePropertyName("networkIdentifier"u8); + writer.WriteObjectValue(NetworkIdentifier, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + SimSwapVerificationContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SimSwapVerificationContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSimSwapVerificationContent(document.RootElement, options); + } + + internal static SimSwapVerificationContent DeserializeSimSwapVerificationContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string phoneNumber = default; + int? maxAgeHours = default; + NetworkIdentifier networkIdentifier = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("phoneNumber"u8)) + { + phoneNumber = property.Value.GetString(); + continue; + } + if (property.NameEquals("maxAgeHours"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxAgeHours = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("networkIdentifier"u8)) + { + networkIdentifier = NetworkIdentifier.DeserializeNetworkIdentifier(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SimSwapVerificationContent(phoneNumber, maxAgeHours, networkIdentifier, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SimSwapVerificationContent)} does not support writing '{options.Format}' format."); + } + } + + SimSwapVerificationContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSimSwapVerificationContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SimSwapVerificationContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SimSwapVerificationContent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeSimSwapVerificationContent(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/SimSwapVerificationContent.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/SimSwapVerificationContent.cs new file mode 100644 index 000000000000..d3bb25dee1c4 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/SimSwapVerificationContent.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.ProgrammableConnectivity +{ + /// Request to verify SimSwap in period. + public partial class SimSwapVerificationContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Identifier for the network to query for this device. + /// is null. + public SimSwapVerificationContent(NetworkIdentifier networkIdentifier) + { + Argument.AssertNotNull(networkIdentifier, nameof(networkIdentifier)); + + NetworkIdentifier = networkIdentifier; + } + + /// Initializes a new instance of . + /// Phone number in E.164 format (starting with country code), and optionally prefixed with '+'. + /// Maximum lookback for SimSwap verification. + /// Identifier for the network to query for this device. + /// Keeps track of any properties unknown to the library. + internal SimSwapVerificationContent(string phoneNumber, int? maxAgeHours, NetworkIdentifier networkIdentifier, IDictionary serializedAdditionalRawData) + { + PhoneNumber = phoneNumber; + MaxAgeHours = maxAgeHours; + NetworkIdentifier = networkIdentifier; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SimSwapVerificationContent() + { + } + + /// Phone number in E.164 format (starting with country code), and optionally prefixed with '+'. + public string PhoneNumber { get; set; } + /// Maximum lookback for SimSwap verification. + public int? MaxAgeHours { get; set; } + /// Identifier for the network to query for this device. + public NetworkIdentifier NetworkIdentifier { get; } + } +} diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/SimSwapVerificationResult.Serialization.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/SimSwapVerificationResult.Serialization.cs new file mode 100644 index 000000000000..2d5d224bc4c5 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/SimSwapVerificationResult.Serialization.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Communication.ProgrammableConnectivity +{ + public partial class SimSwapVerificationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SimSwapVerificationResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("verificationResult"u8); + writer.WriteBooleanValue(VerificationResult); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + SimSwapVerificationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SimSwapVerificationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSimSwapVerificationResult(document.RootElement, options); + } + + internal static SimSwapVerificationResult DeserializeSimSwapVerificationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool verificationResult = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("verificationResult"u8)) + { + verificationResult = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SimSwapVerificationResult(verificationResult, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SimSwapVerificationResult)} does not support writing '{options.Format}' format."); + } + } + + SimSwapVerificationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSimSwapVerificationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SimSwapVerificationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SimSwapVerificationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeSimSwapVerificationResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/SimSwapVerificationResult.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/SimSwapVerificationResult.cs new file mode 100644 index 000000000000..b10fbb9d29f4 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Generated/SimSwapVerificationResult.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Communication.ProgrammableConnectivity +{ + /// Response verifying SimSwap in period. + public partial class SimSwapVerificationResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// True if the SIM has swapped in the specified period, False otherwise. + internal SimSwapVerificationResult(bool verificationResult) + { + VerificationResult = verificationResult; + } + + /// Initializes a new instance of . + /// True if the SIM has swapped in the specified period, False otherwise. + /// Keeps track of any properties unknown to the library. + internal SimSwapVerificationResult(bool verificationResult, IDictionary serializedAdditionalRawData) + { + VerificationResult = verificationResult; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SimSwapVerificationResult() + { + } + + /// True if the SIM has swapped in the specified period, False otherwise. + public bool VerificationResult { get; } + } +} diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Properties/AssemblyInfo.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..98d4b07ed794 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/src/Properties/AssemblyInfo.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Azure.Communication.ProgrammableConnectivity.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] + +// Replace Microsoft.Test with the correct resource provider namepace for your service and uncomment. +// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers +// for the list of possible values. +[assembly: Azure.Core.AzureResourceProviderNamespace("Microsoft.Template")] diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/tests/Azure.Communication.ProgrammableConnectivity.Tests.csproj b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/tests/Azure.Communication.ProgrammableConnectivity.Tests.csproj new file mode 100644 index 000000000000..4f7e5f50fc34 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/tests/Azure.Communication.ProgrammableConnectivity.Tests.csproj @@ -0,0 +1,20 @@ + + + $(RequiredTargetFrameworks) + + $(NoWarn);CS1591 + + + + + + + + + + + + + + + diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/tests/Generated/Samples/Samples_DeviceLocation.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/tests/Generated/Samples/Samples_DeviceLocation.cs new file mode 100644 index 000000000000..36d8d907213a --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/tests/Generated/Samples/Samples_DeviceLocation.cs @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.Communication.ProgrammableConnectivity.Samples +{ + public partial class Samples_DeviceLocation + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_DeviceLocation_Verify_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + DeviceLocation client = new ProgrammableConnectivityClient(endpoint, credential).GetDeviceLocationClient(apiVersion: "2024-02-09-preview"); + + using RequestContent content = RequestContent.Create(new + { + networkIdentifier = new + { + identifierType = "", + identifier = "", + }, + latitude = 123.45, + longitude = 123.45, + accuracy = 1234, + device = new object(), + }); + Response response = client.Verify("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("verificationResult").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_DeviceLocation_Verify_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + DeviceLocation client = new ProgrammableConnectivityClient(endpoint, credential).GetDeviceLocationClient(apiVersion: "2024-02-09-preview"); + + using RequestContent content = RequestContent.Create(new + { + networkIdentifier = new + { + identifierType = "", + identifier = "", + }, + latitude = 123.45, + longitude = 123.45, + accuracy = 1234, + device = new object(), + }); + Response response = await client.VerifyAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("verificationResult").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_DeviceLocation_Verify_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + DeviceLocation client = new ProgrammableConnectivityClient(endpoint, credential).GetDeviceLocationClient(apiVersion: "2024-02-09-preview"); + + DeviceLocationVerificationContent body = new DeviceLocationVerificationContent(new NetworkIdentifier("", ""), 123.45, 123.45, 1234, new LocationDevice()); + Response response = client.Verify("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_DeviceLocation_Verify_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + DeviceLocation client = new ProgrammableConnectivityClient(endpoint, credential).GetDeviceLocationClient(apiVersion: "2024-02-09-preview"); + + DeviceLocationVerificationContent body = new DeviceLocationVerificationContent(new NetworkIdentifier("", ""), 123.45, 123.45, 1234, new LocationDevice()); + Response response = await client.VerifyAsync("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_DeviceLocation_Verify_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + DeviceLocation client = new ProgrammableConnectivityClient(endpoint, credential).GetDeviceLocationClient(apiVersion: "2024-02-09-preview"); + + using RequestContent content = RequestContent.Create(new + { + networkIdentifier = new + { + identifierType = "", + identifier = "", + }, + latitude = 123.45, + longitude = 123.45, + accuracy = 1234, + device = new + { + networkAccessIdentifier = "", + phoneNumber = "", + ipv4Address = new + { + ipv4 = "", + port = 1234, + }, + ipv6Address = new + { + ipv6 = "", + port = 1234, + }, + }, + }); + Response response = client.Verify("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("verificationResult").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_DeviceLocation_Verify_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + DeviceLocation client = new ProgrammableConnectivityClient(endpoint, credential).GetDeviceLocationClient(apiVersion: "2024-02-09-preview"); + + using RequestContent content = RequestContent.Create(new + { + networkIdentifier = new + { + identifierType = "", + identifier = "", + }, + latitude = 123.45, + longitude = 123.45, + accuracy = 1234, + device = new + { + networkAccessIdentifier = "", + phoneNumber = "", + ipv4Address = new + { + ipv4 = "", + port = 1234, + }, + ipv6Address = new + { + ipv6 = "", + port = 1234, + }, + }, + }); + Response response = await client.VerifyAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("verificationResult").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_DeviceLocation_Verify_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + DeviceLocation client = new ProgrammableConnectivityClient(endpoint, credential).GetDeviceLocationClient(apiVersion: "2024-02-09-preview"); + + DeviceLocationVerificationContent body = new DeviceLocationVerificationContent(new NetworkIdentifier("", ""), 123.45, 123.45, 1234, new LocationDevice + { + NetworkAccessIdentifier = "", + PhoneNumber = "", + Ipv4Address = new Ipv4Address("", 1234), + Ipv6Address = new Ipv6Address("", 1234), + }); + Response response = client.Verify("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_DeviceLocation_Verify_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + DeviceLocation client = new ProgrammableConnectivityClient(endpoint, credential).GetDeviceLocationClient(apiVersion: "2024-02-09-preview"); + + DeviceLocationVerificationContent body = new DeviceLocationVerificationContent(new NetworkIdentifier("", ""), 123.45, 123.45, 1234, new LocationDevice + { + NetworkAccessIdentifier = "", + PhoneNumber = "", + Ipv4Address = new Ipv4Address("", 1234), + Ipv6Address = new Ipv6Address("", 1234), + }); + Response response = await client.VerifyAsync("", body); + } + } +} diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/tests/Generated/Samples/Samples_DeviceNetwork.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/tests/Generated/Samples/Samples_DeviceNetwork.cs new file mode 100644 index 000000000000..e034a64c0be7 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/tests/Generated/Samples/Samples_DeviceNetwork.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.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.Communication.ProgrammableConnectivity.Samples +{ + public partial class Samples_DeviceNetwork + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_DeviceNetwork_Retrieve_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + DeviceNetwork client = new ProgrammableConnectivityClient(endpoint, credential).GetDeviceNetworkClient(apiVersion: "2024-02-09-preview"); + + using RequestContent content = RequestContent.Create(new + { + identifierType = "", + identifier = "", + }); + Response response = client.Retrieve("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("networkCode").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_DeviceNetwork_Retrieve_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + DeviceNetwork client = new ProgrammableConnectivityClient(endpoint, credential).GetDeviceNetworkClient(apiVersion: "2024-02-09-preview"); + + using RequestContent content = RequestContent.Create(new + { + identifierType = "", + identifier = "", + }); + Response response = await client.RetrieveAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("networkCode").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_DeviceNetwork_Retrieve_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + DeviceNetwork client = new ProgrammableConnectivityClient(endpoint, credential).GetDeviceNetworkClient(apiVersion: "2024-02-09-preview"); + + NetworkIdentifier body = new NetworkIdentifier("", ""); + Response response = client.Retrieve("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_DeviceNetwork_Retrieve_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + DeviceNetwork client = new ProgrammableConnectivityClient(endpoint, credential).GetDeviceNetworkClient(apiVersion: "2024-02-09-preview"); + + NetworkIdentifier body = new NetworkIdentifier("", ""); + Response response = await client.RetrieveAsync("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_DeviceNetwork_Retrieve_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + DeviceNetwork client = new ProgrammableConnectivityClient(endpoint, credential).GetDeviceNetworkClient(apiVersion: "2024-02-09-preview"); + + using RequestContent content = RequestContent.Create(new + { + identifierType = "", + identifier = "", + }); + Response response = client.Retrieve("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("networkCode").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_DeviceNetwork_Retrieve_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + DeviceNetwork client = new ProgrammableConnectivityClient(endpoint, credential).GetDeviceNetworkClient(apiVersion: "2024-02-09-preview"); + + using RequestContent content = RequestContent.Create(new + { + identifierType = "", + identifier = "", + }); + Response response = await client.RetrieveAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("networkCode").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_DeviceNetwork_Retrieve_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + DeviceNetwork client = new ProgrammableConnectivityClient(endpoint, credential).GetDeviceNetworkClient(apiVersion: "2024-02-09-preview"); + + NetworkIdentifier body = new NetworkIdentifier("", ""); + Response response = client.Retrieve("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_DeviceNetwork_Retrieve_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + DeviceNetwork client = new ProgrammableConnectivityClient(endpoint, credential).GetDeviceNetworkClient(apiVersion: "2024-02-09-preview"); + + NetworkIdentifier body = new NetworkIdentifier("", ""); + Response response = await client.RetrieveAsync("", body); + } + } +} diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/tests/Generated/Samples/Samples_NumberVerification.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/tests/Generated/Samples/Samples_NumberVerification.cs new file mode 100644 index 000000000000..8f0abc9e94dc --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/tests/Generated/Samples/Samples_NumberVerification.cs @@ -0,0 +1,287 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.Communication.ProgrammableConnectivity.Samples +{ + public partial class Samples_NumberVerification + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberVerification_VerifyWithoutCode_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + NumberVerification client = new ProgrammableConnectivityClient(endpoint, credential).GetNumberVerificationClient(apiVersion: "2024-02-09-preview"); + + using RequestContent content = RequestContent.Create(new + { + networkIdentifier = new + { + identifierType = "", + identifier = "", + }, + redirectUri = "http://localhost:3000", + }); + Response response = client.VerifyWithoutCode("", content); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberVerification_VerifyWithoutCode_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + NumberVerification client = new ProgrammableConnectivityClient(endpoint, credential).GetNumberVerificationClient(apiVersion: "2024-02-09-preview"); + + using RequestContent content = RequestContent.Create(new + { + networkIdentifier = new + { + identifierType = "", + identifier = "", + }, + redirectUri = "http://localhost:3000", + }); + Response response = await client.VerifyWithoutCodeAsync("", content); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberVerification_VerifyWithoutCode_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + NumberVerification client = new ProgrammableConnectivityClient(endpoint, credential).GetNumberVerificationClient(apiVersion: "2024-02-09-preview"); + + NumberVerificationWithoutCodeContent body = new NumberVerificationWithoutCodeContent(new NetworkIdentifier("", ""), new Uri("http://localhost:3000")); + Response response = client.VerifyWithoutCode("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberVerification_VerifyWithoutCode_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + NumberVerification client = new ProgrammableConnectivityClient(endpoint, credential).GetNumberVerificationClient(apiVersion: "2024-02-09-preview"); + + NumberVerificationWithoutCodeContent body = new NumberVerificationWithoutCodeContent(new NetworkIdentifier("", ""), new Uri("http://localhost:3000")); + Response response = await client.VerifyWithoutCodeAsync("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberVerification_VerifyWithoutCode_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + NumberVerification client = new ProgrammableConnectivityClient(endpoint, credential).GetNumberVerificationClient(apiVersion: "2024-02-09-preview"); + + using RequestContent content = RequestContent.Create(new + { + networkIdentifier = new + { + identifierType = "", + identifier = "", + }, + phoneNumber = "", + hashedPhoneNumber = "", + redirectUri = "http://localhost:3000", + }); + Response response = client.VerifyWithoutCode("", content); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberVerification_VerifyWithoutCode_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + NumberVerification client = new ProgrammableConnectivityClient(endpoint, credential).GetNumberVerificationClient(apiVersion: "2024-02-09-preview"); + + using RequestContent content = RequestContent.Create(new + { + networkIdentifier = new + { + identifierType = "", + identifier = "", + }, + phoneNumber = "", + hashedPhoneNumber = "", + redirectUri = "http://localhost:3000", + }); + Response response = await client.VerifyWithoutCodeAsync("", content); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberVerification_VerifyWithoutCode_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + NumberVerification client = new ProgrammableConnectivityClient(endpoint, credential).GetNumberVerificationClient(apiVersion: "2024-02-09-preview"); + + NumberVerificationWithoutCodeContent body = new NumberVerificationWithoutCodeContent(new NetworkIdentifier("", ""), new Uri("http://localhost:3000")) + { + PhoneNumber = "", + HashedPhoneNumber = "", + }; + Response response = client.VerifyWithoutCode("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberVerification_VerifyWithoutCode_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + NumberVerification client = new ProgrammableConnectivityClient(endpoint, credential).GetNumberVerificationClient(apiVersion: "2024-02-09-preview"); + + NumberVerificationWithoutCodeContent body = new NumberVerificationWithoutCodeContent(new NetworkIdentifier("", ""), new Uri("http://localhost:3000")) + { + PhoneNumber = "", + HashedPhoneNumber = "", + }; + Response response = await client.VerifyWithoutCodeAsync("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberVerification_VerifyWithCode_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + NumberVerification client = new ProgrammableConnectivityClient(endpoint, credential).GetNumberVerificationClient(apiVersion: "2024-02-09-preview"); + + using RequestContent content = RequestContent.Create(new + { + apcCode = "", + }); + Response response = client.VerifyWithCode("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("verificationResult").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberVerification_VerifyWithCode_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + NumberVerification client = new ProgrammableConnectivityClient(endpoint, credential).GetNumberVerificationClient(apiVersion: "2024-02-09-preview"); + + using RequestContent content = RequestContent.Create(new + { + apcCode = "", + }); + Response response = await client.VerifyWithCodeAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("verificationResult").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberVerification_VerifyWithCode_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + NumberVerification client = new ProgrammableConnectivityClient(endpoint, credential).GetNumberVerificationClient(apiVersion: "2024-02-09-preview"); + + NumberVerificationWithCodeContent body = new NumberVerificationWithCodeContent(""); + Response response = client.VerifyWithCode("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberVerification_VerifyWithCode_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + NumberVerification client = new ProgrammableConnectivityClient(endpoint, credential).GetNumberVerificationClient(apiVersion: "2024-02-09-preview"); + + NumberVerificationWithCodeContent body = new NumberVerificationWithCodeContent(""); + Response response = await client.VerifyWithCodeAsync("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberVerification_VerifyWithCode_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + NumberVerification client = new ProgrammableConnectivityClient(endpoint, credential).GetNumberVerificationClient(apiVersion: "2024-02-09-preview"); + + using RequestContent content = RequestContent.Create(new + { + apcCode = "", + }); + Response response = client.VerifyWithCode("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("verificationResult").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberVerification_VerifyWithCode_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + NumberVerification client = new ProgrammableConnectivityClient(endpoint, credential).GetNumberVerificationClient(apiVersion: "2024-02-09-preview"); + + using RequestContent content = RequestContent.Create(new + { + apcCode = "", + }); + Response response = await client.VerifyWithCodeAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("verificationResult").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_NumberVerification_VerifyWithCode_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + NumberVerification client = new ProgrammableConnectivityClient(endpoint, credential).GetNumberVerificationClient(apiVersion: "2024-02-09-preview"); + + NumberVerificationWithCodeContent body = new NumberVerificationWithCodeContent(""); + Response response = client.VerifyWithCode("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_NumberVerification_VerifyWithCode_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + NumberVerification client = new ProgrammableConnectivityClient(endpoint, credential).GetNumberVerificationClient(apiVersion: "2024-02-09-preview"); + + NumberVerificationWithCodeContent body = new NumberVerificationWithCodeContent(""); + Response response = await client.VerifyWithCodeAsync("", body); + } + } +} diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/tests/Generated/Samples/Samples_SimSwap.cs b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/tests/Generated/Samples/Samples_SimSwap.cs new file mode 100644 index 000000000000..d43346eac1ac --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/tests/Generated/Samples/Samples_SimSwap.cs @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.Communication.ProgrammableConnectivity.Samples +{ + public partial class Samples_SimSwap + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_SimSwap_Retrieve_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + SimSwap client = new ProgrammableConnectivityClient(endpoint, credential).GetSimSwapClient(apiVersion: "2024-02-09-preview"); + + using RequestContent content = RequestContent.Create(new + { + networkIdentifier = new + { + identifierType = "", + identifier = "", + }, + }); + Response response = client.Retrieve("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_SimSwap_Retrieve_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + SimSwap client = new ProgrammableConnectivityClient(endpoint, credential).GetSimSwapClient(apiVersion: "2024-02-09-preview"); + + using RequestContent content = RequestContent.Create(new + { + networkIdentifier = new + { + identifierType = "", + identifier = "", + }, + }); + Response response = await client.RetrieveAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_SimSwap_Retrieve_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + SimSwap client = new ProgrammableConnectivityClient(endpoint, credential).GetSimSwapClient(apiVersion: "2024-02-09-preview"); + + SimSwapRetrievalContent body = new SimSwapRetrievalContent(new NetworkIdentifier("", "")); + Response response = client.Retrieve("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_SimSwap_Retrieve_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + SimSwap client = new ProgrammableConnectivityClient(endpoint, credential).GetSimSwapClient(apiVersion: "2024-02-09-preview"); + + SimSwapRetrievalContent body = new SimSwapRetrievalContent(new NetworkIdentifier("", "")); + Response response = await client.RetrieveAsync("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_SimSwap_Retrieve_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + SimSwap client = new ProgrammableConnectivityClient(endpoint, credential).GetSimSwapClient(apiVersion: "2024-02-09-preview"); + + using RequestContent content = RequestContent.Create(new + { + phoneNumber = "", + networkIdentifier = new + { + identifierType = "", + identifier = "", + }, + }); + Response response = client.Retrieve("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("date").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_SimSwap_Retrieve_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + SimSwap client = new ProgrammableConnectivityClient(endpoint, credential).GetSimSwapClient(apiVersion: "2024-02-09-preview"); + + using RequestContent content = RequestContent.Create(new + { + phoneNumber = "", + networkIdentifier = new + { + identifierType = "", + identifier = "", + }, + }); + Response response = await client.RetrieveAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("date").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_SimSwap_Retrieve_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + SimSwap client = new ProgrammableConnectivityClient(endpoint, credential).GetSimSwapClient(apiVersion: "2024-02-09-preview"); + + SimSwapRetrievalContent body = new SimSwapRetrievalContent(new NetworkIdentifier("", "")) + { + PhoneNumber = "", + }; + Response response = client.Retrieve("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_SimSwap_Retrieve_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + SimSwap client = new ProgrammableConnectivityClient(endpoint, credential).GetSimSwapClient(apiVersion: "2024-02-09-preview"); + + SimSwapRetrievalContent body = new SimSwapRetrievalContent(new NetworkIdentifier("", "")) + { + PhoneNumber = "", + }; + Response response = await client.RetrieveAsync("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_SimSwap_Verify_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + SimSwap client = new ProgrammableConnectivityClient(endpoint, credential).GetSimSwapClient(apiVersion: "2024-02-09-preview"); + + using RequestContent content = RequestContent.Create(new + { + networkIdentifier = new + { + identifierType = "", + identifier = "", + }, + }); + Response response = client.Verify("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("verificationResult").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_SimSwap_Verify_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + SimSwap client = new ProgrammableConnectivityClient(endpoint, credential).GetSimSwapClient(apiVersion: "2024-02-09-preview"); + + using RequestContent content = RequestContent.Create(new + { + networkIdentifier = new + { + identifierType = "", + identifier = "", + }, + }); + Response response = await client.VerifyAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("verificationResult").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_SimSwap_Verify_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + SimSwap client = new ProgrammableConnectivityClient(endpoint, credential).GetSimSwapClient(apiVersion: "2024-02-09-preview"); + + SimSwapVerificationContent body = new SimSwapVerificationContent(new NetworkIdentifier("", "")); + Response response = client.Verify("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_SimSwap_Verify_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + SimSwap client = new ProgrammableConnectivityClient(endpoint, credential).GetSimSwapClient(apiVersion: "2024-02-09-preview"); + + SimSwapVerificationContent body = new SimSwapVerificationContent(new NetworkIdentifier("", "")); + Response response = await client.VerifyAsync("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_SimSwap_Verify_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + SimSwap client = new ProgrammableConnectivityClient(endpoint, credential).GetSimSwapClient(apiVersion: "2024-02-09-preview"); + + using RequestContent content = RequestContent.Create(new + { + phoneNumber = "", + maxAgeHours = 1234, + networkIdentifier = new + { + identifierType = "", + identifier = "", + }, + }); + Response response = client.Verify("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("verificationResult").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_SimSwap_Verify_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + SimSwap client = new ProgrammableConnectivityClient(endpoint, credential).GetSimSwapClient(apiVersion: "2024-02-09-preview"); + + using RequestContent content = RequestContent.Create(new + { + phoneNumber = "", + maxAgeHours = 1234, + networkIdentifier = new + { + identifierType = "", + identifier = "", + }, + }); + Response response = await client.VerifyAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("verificationResult").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_SimSwap_Verify_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + SimSwap client = new ProgrammableConnectivityClient(endpoint, credential).GetSimSwapClient(apiVersion: "2024-02-09-preview"); + + SimSwapVerificationContent body = new SimSwapVerificationContent(new NetworkIdentifier("", "")) + { + PhoneNumber = "", + MaxAgeHours = 1234, + }; + Response response = client.Verify("", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_SimSwap_Verify_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + SimSwap client = new ProgrammableConnectivityClient(endpoint, credential).GetSimSwapClient(apiVersion: "2024-02-09-preview"); + + SimSwapVerificationContent body = new SimSwapVerificationContent(new NetworkIdentifier("", "")) + { + PhoneNumber = "", + MaxAgeHours = 1234, + }; + Response response = await client.VerifyAsync("", body); + } + } +} diff --git a/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/tsp-location.yaml b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/tsp-location.yaml new file mode 100644 index 000000000000..11c1f93f5a7b --- /dev/null +++ b/sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/programmableconnectivity/Azure.ProgrammableConnectivity +commit: 75af203a2e61f012df7acb36ecc7c5febe878a2d +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/programmableconnectivity/ci.yml b/sdk/programmableconnectivity/ci.yml new file mode 100644 index 000000000000..aeb7233b0c5f --- /dev/null +++ b/sdk/programmableconnectivity/ci.yml @@ -0,0 +1,35 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/programmableconnectivity + - sdk/programmableconnectivity/ci.yml + - sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/programmableconnectivity + - sdk/programmableconnectivity/ci.yml + - sdk/programmableconnectivity/Azure.Communication.ProgrammableConnectivity + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: programmableconnectivity + ArtifactName: packages + Artifacts: + - name: Azure.Communication.ProgrammableConnectivity + safeName: AzureCommunicationProgrammableConnectivity