diff --git a/sdk/resourcemanager/cosmos/armcosmos/CHANGELOG.md b/sdk/resourcemanager/cosmos/armcosmos/CHANGELOG.md index fc76db8a8a3a..e7e05155be59 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/CHANGELOG.md +++ b/sdk/resourcemanager/cosmos/armcosmos/CHANGELOG.md @@ -1,176 +1,26 @@ # Release History -## 2.1.0-beta.1 (2022-07-22) +## 2.1.0 (2022-08-31) ### Features Added -- New const `ThroughputPolicyTypeEqual` -- New const `EnableFullTextQueryTrue` -- New const `ThroughputPolicyTypeNone` -- New const `ContinuousTierContinuous7Days` -- New const `ThroughputPolicyTypeCustom` -- New const `DataTransferComponentAzureBlobStorage` -- New const `EnableFullTextQueryNone` -- New const `AuthenticationMethodLdap` - New const `MongoRoleDefinitionTypeBuiltInRole` -- New const `DataTransferComponentCosmosDBCassandra` -- New const `EnableFullTextQueryFalse` - New const `MongoRoleDefinitionTypeCustomRole` -- New const `DataTransferComponentCosmosDBSQL` -- New const `ContinuousTierContinuous30Days` -- New function `*MongoDBResourcesClient.BeginMongoDBContainerRedistributeThroughput(context.Context, string, string, string, string, RedistributeThroughputParameters, *MongoDBResourcesClientBeginMongoDBContainerRedistributeThroughputOptions) (*runtime.Poller[MongoDBResourcesClientMongoDBContainerRedistributeThroughputResponse], error)` -- New function `NewRestorableGremlinDatabasesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*RestorableGremlinDatabasesClient, error)` -- New function `*SQLResourcesClient.BeginSQLContainerRedistributeThroughput(context.Context, string, string, string, string, RedistributeThroughputParameters, *SQLResourcesClientBeginSQLContainerRedistributeThroughputOptions) (*runtime.Poller[SQLResourcesClientSQLContainerRedistributeThroughputResponse], error)` -- New function `*DataTransferJobsClient.Cancel(context.Context, string, string, string, *DataTransferJobsClientCancelOptions) (DataTransferJobsClientCancelResponse, error)` +- New type alias `MongoRoleDefinitionType` - New function `*MongoDBResourcesClient.NewListMongoRoleDefinitionsPager(string, string, *MongoDBResourcesClientListMongoRoleDefinitionsOptions) *runtime.Pager[MongoDBResourcesClientListMongoRoleDefinitionsResponse]` -- New function `*CassandraResourcesClient.GetCassandraViewThroughput(context.Context, string, string, string, string, *CassandraResourcesClientGetCassandraViewThroughputOptions) (CassandraResourcesClientGetCassandraViewThroughputResponse, error)` -- New function `NewRestorableTablesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*RestorableTablesClient, error)` -- New function `*CassandraResourcesClient.GetCassandraView(context.Context, string, string, string, string, *CassandraResourcesClientGetCassandraViewOptions) (CassandraResourcesClientGetCassandraViewResponse, error)` -- New function `*CassandraResourcesClient.BeginMigrateCassandraViewToAutoscale(context.Context, string, string, string, string, *CassandraResourcesClientBeginMigrateCassandraViewToAutoscaleOptions) (*runtime.Poller[CassandraResourcesClientMigrateCassandraViewToAutoscaleResponse], error)` -- New function `*AzureBlobDataTransferDataSourceSink.GetDataTransferDataSourceSink() *DataTransferDataSourceSink` -- New function `NewRestorableTableResourcesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*RestorableTableResourcesClient, error)` -- New function `*CassandraClustersClient.GetBackup(context.Context, string, string, string, *CassandraClustersClientGetBackupOptions) (CassandraClustersClientGetBackupResponse, error)` -- New function `*CassandraResourcesClient.NewListCassandraViewsPager(string, string, string, *CassandraResourcesClientListCassandraViewsOptions) *runtime.Pager[CassandraResourcesClientListCassandraViewsResponse]` -- New function `*RestorableGremlinDatabasesClient.NewListPager(string, string, *RestorableGremlinDatabasesClientListOptions) *runtime.Pager[RestorableGremlinDatabasesClientListResponse]` -- New function `*SQLResourcesClient.GetClientEncryptionKey(context.Context, string, string, string, string, *SQLResourcesClientGetClientEncryptionKeyOptions) (SQLResourcesClientGetClientEncryptionKeyResponse, error)` -- New function `*SQLDataTransferDataSourceSink.GetDataTransferDataSourceSink() *DataTransferDataSourceSink` -- New function `*DataTransferJobsClient.Pause(context.Context, string, string, string, *DataTransferJobsClientPauseOptions) (DataTransferJobsClientPauseResponse, error)` -- New function `*CassandraResourcesClient.BeginUpdateCassandraViewThroughput(context.Context, string, string, string, string, ThroughputSettingsUpdateParameters, *CassandraResourcesClientBeginUpdateCassandraViewThroughputOptions) (*runtime.Poller[CassandraResourcesClientUpdateCassandraViewThroughputResponse], error)` -- New function `NewGraphResourcesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*GraphResourcesClient, error)` -- New function `*SQLResourcesClient.BeginListSQLContainerPartitionMerge(context.Context, string, string, string, string, MergeParameters, *SQLResourcesClientBeginListSQLContainerPartitionMergeOptions) (*runtime.Poller[SQLResourcesClientListSQLContainerPartitionMergeResponse], error)` -- New function `*CassandraResourcesClient.BeginMigrateCassandraViewToManualThroughput(context.Context, string, string, string, string, *CassandraResourcesClientBeginMigrateCassandraViewToManualThroughputOptions) (*runtime.Poller[CassandraResourcesClientMigrateCassandraViewToManualThroughputResponse], error)` -- New function `*GraphResourcesClient.BeginDeleteGraphResource(context.Context, string, string, string, *GraphResourcesClientBeginDeleteGraphResourceOptions) (*runtime.Poller[GraphResourcesClientDeleteGraphResourceResponse], error)` -- New function `PossibleEnableFullTextQueryValues() []EnableFullTextQuery` -- New function `*CassandraDataTransferDataSourceSink.GetDataTransferDataSourceSink() *DataTransferDataSourceSink` -- New function `*DataTransferJobsClient.Create(context.Context, string, string, string, CreateJobRequest, *DataTransferJobsClientCreateOptions) (DataTransferJobsClientCreateResponse, error)` -- New function `*GraphResourcesClient.GetGraph(context.Context, string, string, string, *GraphResourcesClientGetGraphOptions) (GraphResourcesClientGetGraphResponse, error)` -- New function `*DataTransferJobsClient.Resume(context.Context, string, string, string, *DataTransferJobsClientResumeOptions) (DataTransferJobsClientResumeResponse, error)` -- New function `*RestorableTablesClient.NewListPager(string, string, *RestorableTablesClientListOptions) *runtime.Pager[RestorableTablesClientListResponse]` -- New function `*CassandraResourcesClient.BeginDeleteCassandraView(context.Context, string, string, string, string, *CassandraResourcesClientBeginDeleteCassandraViewOptions) (*runtime.Poller[CassandraResourcesClientDeleteCassandraViewResponse], error)` -- New function `PossibleThroughputPolicyTypeValues() []ThroughputPolicyType` -- New function `NewDataTransferJobsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*DataTransferJobsClient, error)` -- New function `*SQLResourcesClient.BeginSQLContainerRetrieveThroughputDistribution(context.Context, string, string, string, string, RetrieveThroughputParameters, *SQLResourcesClientBeginSQLContainerRetrieveThroughputDistributionOptions) (*runtime.Poller[SQLResourcesClientSQLContainerRetrieveThroughputDistributionResponse], error)` -- New function `PossibleMongoRoleDefinitionTypeValues() []MongoRoleDefinitionType` +- New function `*MongoDBResourcesClient.GetMongoUserDefinition(context.Context, string, string, string, *MongoDBResourcesClientGetMongoUserDefinitionOptions) (MongoDBResourcesClientGetMongoUserDefinitionResponse, error)` +- New function `*MongoDBResourcesClient.BeginDeleteMongoUserDefinition(context.Context, string, string, string, *MongoDBResourcesClientBeginDeleteMongoUserDefinitionOptions) (*runtime.Poller[MongoDBResourcesClientDeleteMongoUserDefinitionResponse], error)` - New function `*MongoDBResourcesClient.NewListMongoUserDefinitionsPager(string, string, *MongoDBResourcesClientListMongoUserDefinitionsOptions) *runtime.Pager[MongoDBResourcesClientListMongoUserDefinitionsResponse]` -- New function `*DataTransferJobsClient.Get(context.Context, string, string, string, *DataTransferJobsClientGetOptions) (DataTransferJobsClientGetResponse, error)` -- New function `*RestorableTableResourcesClient.NewListPager(string, string, *RestorableTableResourcesClientListOptions) *runtime.Pager[RestorableTableResourcesClientListResponse]` -- New function `*MongoDBResourcesClient.BeginMongoDBContainerRetrieveThroughputDistribution(context.Context, string, string, string, string, RetrieveThroughputParameters, *MongoDBResourcesClientBeginMongoDBContainerRetrieveThroughputDistributionOptions) (*runtime.Poller[MongoDBResourcesClientMongoDBContainerRetrieveThroughputDistributionResponse], error)` -- New function `*MongoDBResourcesClient.BeginCreateUpdateMongoUserDefinition(context.Context, string, string, string, MongoUserDefinitionCreateUpdateParameters, *MongoDBResourcesClientBeginCreateUpdateMongoUserDefinitionOptions) (*runtime.Poller[MongoDBResourcesClientCreateUpdateMongoUserDefinitionResponse], error)` -- New function `*GremlinResourcesClient.BeginRetrieveContinuousBackupInformation(context.Context, string, string, string, string, ContinuousBackupRestoreLocation, *GremlinResourcesClientBeginRetrieveContinuousBackupInformationOptions) (*runtime.Poller[GremlinResourcesClientRetrieveContinuousBackupInformationResponse], error)` -- New function `NewRestorableGremlinResourcesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*RestorableGremlinResourcesClient, error)` -- New function `NewRestorableGremlinGraphsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*RestorableGremlinGraphsClient, error)` -- New function `*SQLResourcesClient.BeginCreateUpdateClientEncryptionKey(context.Context, string, string, string, string, ClientEncryptionKeyCreateUpdateParameters, *SQLResourcesClientBeginCreateUpdateClientEncryptionKeyOptions) (*runtime.Poller[SQLResourcesClientCreateUpdateClientEncryptionKeyResponse], error)` -- New function `PossibleContinuousTierValues() []ContinuousTier` -- New function `*SQLResourcesClient.NewListClientEncryptionKeysPager(string, string, string, *SQLResourcesClientListClientEncryptionKeysOptions) *runtime.Pager[SQLResourcesClientListClientEncryptionKeysResponse]` - New function `*MongoDBResourcesClient.BeginDeleteMongoRoleDefinition(context.Context, string, string, string, *MongoDBResourcesClientBeginDeleteMongoRoleDefinitionOptions) (*runtime.Poller[MongoDBResourcesClientDeleteMongoRoleDefinitionResponse], error)` -- New function `*MongoDBResourcesClient.BeginDeleteMongoUserDefinition(context.Context, string, string, string, *MongoDBResourcesClientBeginDeleteMongoUserDefinitionOptions) (*runtime.Poller[MongoDBResourcesClientDeleteMongoUserDefinitionResponse], error)` -- New function `*MongoDBResourcesClient.GetMongoUserDefinition(context.Context, string, string, string, *MongoDBResourcesClientGetMongoUserDefinitionOptions) (MongoDBResourcesClientGetMongoUserDefinitionResponse, error)` -- New function `*GraphResourcesClient.NewListGraphsPager(string, string, *GraphResourcesClientListGraphsOptions) *runtime.Pager[GraphResourcesClientListGraphsResponse]` - New function `*MongoDBResourcesClient.BeginCreateUpdateMongoRoleDefinition(context.Context, string, string, string, MongoRoleDefinitionCreateUpdateParameters, *MongoDBResourcesClientBeginCreateUpdateMongoRoleDefinitionOptions) (*runtime.Poller[MongoDBResourcesClientCreateUpdateMongoRoleDefinitionResponse], error)` -- New function `*GraphResourcesClient.BeginCreateUpdateGraph(context.Context, string, string, string, GraphResourceCreateUpdateParameters, *GraphResourcesClientBeginCreateUpdateGraphOptions) (*runtime.Poller[GraphResourcesClientCreateUpdateGraphResponse], error)` -- New function `*CassandraClustersClient.NewListBackupsPager(string, string, *CassandraClustersClientListBackupsOptions) *runtime.Pager[CassandraClustersClientListBackupsResponse]` -- New function `*DataTransferDataSourceSink.GetDataTransferDataSourceSink() *DataTransferDataSourceSink` -- New function `*CassandraResourcesClient.BeginCreateUpdateCassandraView(context.Context, string, string, string, string, CassandraViewCreateUpdateParameters, *CassandraResourcesClientBeginCreateUpdateCassandraViewOptions) (*runtime.Poller[CassandraResourcesClientCreateUpdateCassandraViewResponse], error)` -- New function `*MongoDBResourcesClient.BeginListMongoDBCollectionPartitionMerge(context.Context, string, string, string, string, MergeParameters, *MongoDBResourcesClientBeginListMongoDBCollectionPartitionMergeOptions) (*runtime.Poller[MongoDBResourcesClientListMongoDBCollectionPartitionMergeResponse], error)` -- New function `*TableResourcesClient.BeginRetrieveContinuousBackupInformation(context.Context, string, string, string, ContinuousBackupRestoreLocation, *TableResourcesClientBeginRetrieveContinuousBackupInformationOptions) (*runtime.Poller[TableResourcesClientRetrieveContinuousBackupInformationResponse], error)` -- New function `*RestorableGremlinResourcesClient.NewListPager(string, string, *RestorableGremlinResourcesClientListOptions) *runtime.Pager[RestorableGremlinResourcesClientListResponse]` -- New function `*RestorableGremlinGraphsClient.NewListPager(string, string, *RestorableGremlinGraphsClientListOptions) *runtime.Pager[RestorableGremlinGraphsClientListResponse]` +- New function `PossibleMongoRoleDefinitionTypeValues() []MongoRoleDefinitionType` +- New function `*MongoDBResourcesClient.BeginCreateUpdateMongoUserDefinition(context.Context, string, string, string, MongoUserDefinitionCreateUpdateParameters, *MongoDBResourcesClientBeginCreateUpdateMongoUserDefinitionOptions) (*runtime.Poller[MongoDBResourcesClientCreateUpdateMongoUserDefinitionResponse], error)` - New function `*MongoDBResourcesClient.GetMongoRoleDefinition(context.Context, string, string, string, *MongoDBResourcesClientGetMongoRoleDefinitionOptions) (MongoDBResourcesClientGetMongoRoleDefinitionResponse, error)` -- New function `PossibleDataTransferComponentValues() []DataTransferComponent` -- New function `*DataTransferJobsClient.NewListByDatabaseAccountPager(string, string, *DataTransferJobsClientListByDatabaseAccountOptions) *runtime.Pager[DataTransferJobsClientListByDatabaseAccountResponse]` - New struct `AccountKeyMetadata` -- New struct `AuthenticationMethodLdapProperties` -- New struct `AzureBlobDataTransferDataSourceSink` -- New struct `BackupResource` -- New struct `BackupResourceProperties` -- New struct `CassandraClustersClientGetBackupOptions` -- New struct `CassandraClustersClientGetBackupResponse` -- New struct `CassandraClustersClientListBackupsOptions` -- New struct `CassandraClustersClientListBackupsResponse` -- New struct `CassandraDataTransferDataSourceSink` -- New struct `CassandraResourcesClientBeginCreateUpdateCassandraViewOptions` -- New struct `CassandraResourcesClientBeginDeleteCassandraViewOptions` -- New struct `CassandraResourcesClientBeginMigrateCassandraViewToAutoscaleOptions` -- New struct `CassandraResourcesClientBeginMigrateCassandraViewToManualThroughputOptions` -- New struct `CassandraResourcesClientBeginUpdateCassandraViewThroughputOptions` -- New struct `CassandraResourcesClientCreateUpdateCassandraViewResponse` -- New struct `CassandraResourcesClientDeleteCassandraViewResponse` -- New struct `CassandraResourcesClientGetCassandraViewOptions` -- New struct `CassandraResourcesClientGetCassandraViewResponse` -- New struct `CassandraResourcesClientGetCassandraViewThroughputOptions` -- New struct `CassandraResourcesClientGetCassandraViewThroughputResponse` -- New struct `CassandraResourcesClientListCassandraViewsOptions` -- New struct `CassandraResourcesClientListCassandraViewsResponse` -- New struct `CassandraResourcesClientMigrateCassandraViewToAutoscaleResponse` -- New struct `CassandraResourcesClientMigrateCassandraViewToManualThroughputResponse` -- New struct `CassandraResourcesClientUpdateCassandraViewThroughputResponse` -- New struct `CassandraViewCreateUpdateParameters` -- New struct `CassandraViewCreateUpdateProperties` -- New struct `CassandraViewGetProperties` -- New struct `CassandraViewGetPropertiesOptions` -- New struct `CassandraViewGetPropertiesResource` -- New struct `CassandraViewGetResults` -- New struct `CassandraViewListResult` -- New struct `CassandraViewResource` -- New struct `ClientEncryptionIncludedPath` -- New struct `ClientEncryptionKeyCreateUpdateParameters` -- New struct `ClientEncryptionKeyCreateUpdateProperties` -- New struct `ClientEncryptionKeyGetProperties` -- New struct `ClientEncryptionKeyGetPropertiesResource` -- New struct `ClientEncryptionKeyGetResults` -- New struct `ClientEncryptionKeyResource` -- New struct `ClientEncryptionKeysListResult` -- New struct `ClientEncryptionPolicy` -- New struct `ContinuousModeProperties` -- New struct `CreateJobRequest` -- New struct `DataTransferDataSourceSink` -- New struct `DataTransferJobFeedResults` -- New struct `DataTransferJobGetResults` -- New struct `DataTransferJobProperties` -- New struct `DataTransferJobsClient` -- New struct `DataTransferJobsClientCancelOptions` -- New struct `DataTransferJobsClientCancelResponse` -- New struct `DataTransferJobsClientCreateOptions` -- New struct `DataTransferJobsClientCreateResponse` -- New struct `DataTransferJobsClientGetOptions` -- New struct `DataTransferJobsClientGetResponse` -- New struct `DataTransferJobsClientListByDatabaseAccountOptions` -- New struct `DataTransferJobsClientListByDatabaseAccountResponse` -- New struct `DataTransferJobsClientPauseOptions` -- New struct `DataTransferJobsClientPauseResponse` -- New struct `DataTransferJobsClientResumeOptions` -- New struct `DataTransferJobsClientResumeResponse` - New struct `DatabaseAccountKeysMetadata` -- New struct `DiagnosticLogSettings` -- New struct `GraphResource` -- New struct `GraphResourceCreateUpdateParameters` -- New struct `GraphResourceCreateUpdateProperties` -- New struct `GraphResourceGetProperties` -- New struct `GraphResourceGetPropertiesOptions` -- New struct `GraphResourceGetPropertiesResource` -- New struct `GraphResourceGetResults` -- New struct `GraphResourcesClient` -- New struct `GraphResourcesClientBeginCreateUpdateGraphOptions` -- New struct `GraphResourcesClientBeginDeleteGraphResourceOptions` -- New struct `GraphResourcesClientCreateUpdateGraphResponse` -- New struct `GraphResourcesClientDeleteGraphResourceResponse` -- New struct `GraphResourcesClientGetGraphOptions` -- New struct `GraphResourcesClientGetGraphResponse` -- New struct `GraphResourcesClientListGraphsOptions` -- New struct `GraphResourcesClientListGraphsResponse` -- New struct `GraphResourcesListResult` -- New struct `GremlinDatabaseRestoreResource` -- New struct `GremlinResourcesClientBeginRetrieveContinuousBackupInformationOptions` -- New struct `GremlinResourcesClientRetrieveContinuousBackupInformationResponse` -- New struct `KeyWrapMetadata` -- New struct `ListBackups` -- New struct `MergeParameters` - New struct `MongoDBResourcesClientBeginCreateUpdateMongoRoleDefinitionOptions` - New struct `MongoDBResourcesClientBeginCreateUpdateMongoUserDefinitionOptions` - New struct `MongoDBResourcesClientBeginDeleteMongoRoleDefinitionOptions` - New struct `MongoDBResourcesClientBeginDeleteMongoUserDefinitionOptions` -- New struct `MongoDBResourcesClientBeginListMongoDBCollectionPartitionMergeOptions` -- New struct `MongoDBResourcesClientBeginMongoDBContainerRedistributeThroughputOptions` -- New struct `MongoDBResourcesClientBeginMongoDBContainerRetrieveThroughputDistributionOptions` - New struct `MongoDBResourcesClientCreateUpdateMongoRoleDefinitionResponse` - New struct `MongoDBResourcesClientCreateUpdateMongoUserDefinitionResponse` - New struct `MongoDBResourcesClientDeleteMongoRoleDefinitionResponse` @@ -179,13 +29,10 @@ - New struct `MongoDBResourcesClientGetMongoRoleDefinitionResponse` - New struct `MongoDBResourcesClientGetMongoUserDefinitionOptions` - New struct `MongoDBResourcesClientGetMongoUserDefinitionResponse` -- New struct `MongoDBResourcesClientListMongoDBCollectionPartitionMergeResponse` - New struct `MongoDBResourcesClientListMongoRoleDefinitionsOptions` - New struct `MongoDBResourcesClientListMongoRoleDefinitionsResponse` - New struct `MongoDBResourcesClientListMongoUserDefinitionsOptions` - New struct `MongoDBResourcesClientListMongoUserDefinitionsResponse` -- New struct `MongoDBResourcesClientMongoDBContainerRedistributeThroughputResponse` -- New struct `MongoDBResourcesClientMongoDBContainerRetrieveThroughputDistributionResponse` - New struct `MongoRoleDefinitionCreateUpdateParameters` - New struct `MongoRoleDefinitionGetResults` - New struct `MongoRoleDefinitionListResult` @@ -194,116 +41,15 @@ - New struct `MongoUserDefinitionGetResults` - New struct `MongoUserDefinitionListResult` - New struct `MongoUserDefinitionResource` -- New struct `PhysicalPartitionID` -- New struct `PhysicalPartitionStorageInfo` -- New struct `PhysicalPartitionStorageInfoCollection` -- New struct `PhysicalPartitionThroughputInfoProperties` -- New struct `PhysicalPartitionThroughputInfoResource` -- New struct `PhysicalPartitionThroughputInfoResult` -- New struct `PhysicalPartitionThroughputInfoResultProperties` -- New struct `PhysicalPartitionThroughputInfoResultPropertiesResource` - New struct `Privilege` - New struct `PrivilegeResource` -- New struct `RedistributeThroughputParameters` -- New struct `RedistributeThroughputProperties` -- New struct `RedistributeThroughputPropertiesResource` -- New struct `RestorableGremlinDatabaseGetResult` -- New struct `RestorableGremlinDatabaseProperties` -- New struct `RestorableGremlinDatabasePropertiesResource` -- New struct `RestorableGremlinDatabasesClient` -- New struct `RestorableGremlinDatabasesClientListOptions` -- New struct `RestorableGremlinDatabasesClientListResponse` -- New struct `RestorableGremlinDatabasesListResult` -- New struct `RestorableGremlinGraphGetResult` -- New struct `RestorableGremlinGraphProperties` -- New struct `RestorableGremlinGraphPropertiesResource` -- New struct `RestorableGremlinGraphsClient` -- New struct `RestorableGremlinGraphsClientListOptions` -- New struct `RestorableGremlinGraphsClientListResponse` -- New struct `RestorableGremlinGraphsListResult` -- New struct `RestorableGremlinResourcesClient` -- New struct `RestorableGremlinResourcesClientListOptions` -- New struct `RestorableGremlinResourcesClientListResponse` -- New struct `RestorableGremlinResourcesGetResult` -- New struct `RestorableGremlinResourcesListResult` -- New struct `RestorableTableGetResult` -- New struct `RestorableTableProperties` -- New struct `RestorableTablePropertiesResource` -- New struct `RestorableTableResourcesClient` -- New struct `RestorableTableResourcesClientListOptions` -- New struct `RestorableTableResourcesClientListResponse` -- New struct `RestorableTableResourcesGetResult` -- New struct `RestorableTableResourcesListResult` -- New struct `RestorableTablesClient` -- New struct `RestorableTablesClientListOptions` -- New struct `RestorableTablesClientListResponse` -- New struct `RestorableTablesListResult` -- New struct `RetrieveThroughputParameters` -- New struct `RetrieveThroughputProperties` -- New struct `RetrieveThroughputPropertiesResource` - New struct `Role` -- New struct `SQLDataTransferDataSourceSink` -- New struct `SQLResourcesClientBeginCreateUpdateClientEncryptionKeyOptions` -- New struct `SQLResourcesClientBeginListSQLContainerPartitionMergeOptions` -- New struct `SQLResourcesClientBeginSQLContainerRedistributeThroughputOptions` -- New struct `SQLResourcesClientBeginSQLContainerRetrieveThroughputDistributionOptions` -- New struct `SQLResourcesClientCreateUpdateClientEncryptionKeyResponse` -- New struct `SQLResourcesClientGetClientEncryptionKeyOptions` -- New struct `SQLResourcesClientGetClientEncryptionKeyResponse` -- New struct `SQLResourcesClientListClientEncryptionKeysOptions` -- New struct `SQLResourcesClientListClientEncryptionKeysResponse` -- New struct `SQLResourcesClientListSQLContainerPartitionMergeResponse` -- New struct `SQLResourcesClientSQLContainerRedistributeThroughputResponse` -- New struct `SQLResourcesClientSQLContainerRetrieveThroughputDistributionResponse` -- New struct `TableResourcesClientBeginRetrieveContinuousBackupInformationOptions` -- New struct `TableResourcesClientRetrieveContinuousBackupInformationResponse` -- New field `Identity` in struct `SQLDatabaseGetResults` -- New field `Identity` in struct `SQLStoredProcedureGetResults` -- New field `Identity` in struct `SQLTriggerGetResults` -- New field `ContinuousModeProperties` in struct `ContinuousModeBackupPolicy` -- New field `Identity` in struct `MongoDBCollectionGetResults` -- New field `Identity` in struct `CassandraKeyspaceGetResults` -- New field `Identity` in struct `MongoDBDatabaseGetResults` -- New field `Identity` in struct `ThroughputSettingsGetResults` -- New field `Identity` in struct `MongoDBDatabaseCreateUpdateParameters` -- New field `DiagnosticLogSettings` in struct `DatabaseAccountCreateUpdateProperties` -- New field `EnableMaterializedViews` in struct `DatabaseAccountCreateUpdateProperties` -- New field `KeysMetadata` in struct `DatabaseAccountCreateUpdateProperties` -- New field `Identity` in struct `SQLTriggerCreateUpdateParameters` -- New field `Identity` in struct `SQLStoredProcedureCreateUpdateParameters` -- New field `Identity` in struct `MongoDBCollectionCreateUpdateParameters` -- New field `Identity` in struct `SQLDatabaseCreateUpdateParameters` -- New field `DiagnosticLogSettings` in struct `DatabaseAccountUpdateProperties` +- New field `EnablePartitionMerge` in struct `DatabaseAccountUpdateProperties` - New field `KeysMetadata` in struct `DatabaseAccountUpdateProperties` -- New field `EnableMaterializedViews` in struct `DatabaseAccountUpdateProperties` -- New field `Identity` in struct `ARMResourceProperties` -- New field `Identity` in struct `SQLUserDefinedFunctionGetResults` -- New field `GremlinDatabasesToRestore` in struct `RestoreParameters` -- New field `TablesToRestore` in struct `RestoreParameters` -- New field `ClientEncryptionPolicy` in struct `SQLContainerGetPropertiesResource` -- New field `Identity` in struct `CassandraTableGetResults` -- New field `Identity` in struct `CassandraTableCreateUpdateParameters` -- New field `Identity` in struct `SQLContainerCreateUpdateParameters` -- New field `Identity` in struct `CassandraKeyspaceCreateUpdateParameters` -- New field `Identity` in struct `GremlinGraphGetResults` -- New field `Identity` in struct `GremlinDatabaseGetResults` -- New field `Identity` in struct `GremlinGraphCreateUpdateParameters` -- New field `Identity` in struct `SQLContainerGetResults` -- New field `AuthenticationMethodLdapProperties` in struct `DataCenterResourceProperties` -- New field `Identity` in struct `SQLUserDefinedFunctionCreateUpdateParameters` -- New field `Identity` in struct `GremlinDatabaseCreateUpdateParameters` -- New field `DiagnosticLogSettings` in struct `DatabaseAccountGetProperties` - New field `KeysMetadata` in struct `DatabaseAccountGetProperties` -- New field `EnableMaterializedViews` in struct `DatabaseAccountGetProperties` -- New field `ClientEncryptionPolicy` in struct `RestorableSQLContainerPropertiesResourceContainer` -- New field `EndTime` in struct `RestorableMongodbCollectionsClientListOptions` -- New field `StartTime` in struct `RestorableMongodbCollectionsClientListOptions` -- New field `ClientEncryptionPolicy` in struct `SQLContainerResource` -- New field `Identity` in struct `TableGetResults` -- New field `Status` in struct `LocationProperties` -- New field `Identity` in struct `ThroughputSettingsUpdateParameters` -- New field `OldestRestorableTime` in struct `RestorableDatabaseAccountProperties` -- New field `Identity` in struct `TableCreateUpdateParameters` +- New field `EnablePartitionMerge` in struct `DatabaseAccountGetProperties` +- New field `KeysMetadata` in struct `DatabaseAccountCreateUpdateProperties` +- New field `EnablePartitionMerge` in struct `DatabaseAccountCreateUpdateProperties` ## 2.0.0 (2022-07-18) diff --git a/sdk/resourcemanager/cosmos/armcosmos/autorest.md b/sdk/resourcemanager/cosmos/armcosmos/autorest.md index 3658fb4481d3..59a9a2ef62f8 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/autorest.md +++ b/sdk/resourcemanager/cosmos/armcosmos/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/36ac14c46828ae36365ca9d68c26d75d9ade48f0/specification/cosmos-db/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/36ac14c46828ae36365ca9d68c26d75d9ade48f0/specification/cosmos-db/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/cosmos-db/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/cosmos-db/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 2.1.0-beta.1 +module-version: 2.1.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/cosmos/armcosmos/cassandraclusters_client.go b/sdk/resourcemanager/cosmos/armcosmos/cassandraclusters_client.go index 8f5f152557b9..406fbb2104c7 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/cassandraclusters_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/cassandraclusters_client.go @@ -58,7 +58,7 @@ func NewCassandraClustersClient(subscriptionID string, credential azcore.TokenCr // BeginCreateUpdate - Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. // To update only some properties, use PATCH. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // clusterName - Managed Cassandra cluster name. // body - The properties specifying the desired state of the managed Cassandra cluster. @@ -79,7 +79,7 @@ func (client *CassandraClustersClient) BeginCreateUpdate(ctx context.Context, re // CreateUpdate - Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To // update only some properties, use PATCH. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *CassandraClustersClient) createUpdate(ctx context.Context, resourceGroupName string, clusterName string, body ClusterResource, options *CassandraClustersClientBeginCreateUpdateOptions) (*http.Response, error) { req, err := client.createUpdateCreateRequest(ctx, resourceGroupName, clusterName, body, options) if err != nil { @@ -115,7 +115,7 @@ func (client *CassandraClustersClient) createUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) @@ -125,7 +125,7 @@ func (client *CassandraClustersClient) createUpdateCreateRequest(ctx context.Con // 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. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // clusterName - Managed Cassandra cluster name. // options - CassandraClustersClientBeginDeallocateOptions contains the optional parameters for the CassandraClustersClient.BeginDeallocate @@ -146,7 +146,7 @@ func (client *CassandraClustersClient) BeginDeallocate(ctx context.Context, reso // 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. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *CassandraClustersClient) deallocate(ctx context.Context, resourceGroupName string, clusterName string, options *CassandraClustersClientBeginDeallocateOptions) (*http.Response, error) { req, err := client.deallocateCreateRequest(ctx, resourceGroupName, clusterName, options) if err != nil { @@ -182,7 +182,7 @@ func (client *CassandraClustersClient) deallocateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -190,7 +190,7 @@ func (client *CassandraClustersClient) deallocateCreateRequest(ctx context.Conte // BeginDelete - Deletes a managed Cassandra cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // clusterName - Managed Cassandra cluster name. // options - CassandraClustersClientBeginDeleteOptions contains the optional parameters for the CassandraClustersClient.BeginDelete @@ -209,7 +209,7 @@ func (client *CassandraClustersClient) BeginDelete(ctx context.Context, resource // Delete - Deletes a managed Cassandra cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *CassandraClustersClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, options *CassandraClustersClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, options) if err != nil { @@ -245,7 +245,7 @@ func (client *CassandraClustersClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -253,7 +253,7 @@ func (client *CassandraClustersClient) deleteCreateRequest(ctx context.Context, // Get - Get the properties of a managed Cassandra cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // clusterName - Managed Cassandra cluster name. // options - CassandraClustersClientGetOptions contains the optional parameters for the CassandraClustersClient.Get method. @@ -292,7 +292,7 @@ func (client *CassandraClustersClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -307,71 +307,9 @@ func (client *CassandraClustersClient) getHandleResponse(resp *http.Response) (C return result, nil } -// GetBackup - Get the properties of an individual backup of this cluster that is available to restore. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// clusterName - Managed Cassandra cluster name. -// backupID - Id of a restorable backup of a Cassandra cluster. -// options - CassandraClustersClientGetBackupOptions contains the optional parameters for the CassandraClustersClient.GetBackup -// method. -func (client *CassandraClustersClient) GetBackup(ctx context.Context, resourceGroupName string, clusterName string, backupID string, options *CassandraClustersClientGetBackupOptions) (CassandraClustersClientGetBackupResponse, error) { - req, err := client.getBackupCreateRequest(ctx, resourceGroupName, clusterName, backupID, options) - if err != nil { - return CassandraClustersClientGetBackupResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return CassandraClustersClientGetBackupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CassandraClustersClientGetBackupResponse{}, runtime.NewResponseError(resp) - } - return client.getBackupHandleResponse(resp) -} - -// getBackupCreateRequest creates the GetBackup request. -func (client *CassandraClustersClient) getBackupCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, backupID string, options *CassandraClustersClientGetBackupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/backups/{backupId}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if clusterName == "" { - return nil, errors.New("parameter clusterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) - if backupID == "" { - return nil, errors.New("parameter backupID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{backupId}", url.PathEscape(backupID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getBackupHandleResponse handles the GetBackup response. -func (client *CassandraClustersClient) getBackupHandleResponse(resp *http.Response) (CassandraClustersClientGetBackupResponse, error) { - result := CassandraClustersClientGetBackupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.BackupResource); err != nil { - return CassandraClustersClientGetBackupResponse{}, err - } - return result, nil -} - // BeginInvokeCommand - Invoke a command like nodetool for cassandra maintenance // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // clusterName - Managed Cassandra cluster name. // body - Specification which command to run where @@ -391,7 +329,7 @@ func (client *CassandraClustersClient) BeginInvokeCommand(ctx context.Context, r // InvokeCommand - Invoke a command like nodetool for cassandra maintenance // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *CassandraClustersClient) invokeCommand(ctx context.Context, resourceGroupName string, clusterName string, body CommandPostBody, options *CassandraClustersClientBeginInvokeCommandOptions) (*http.Response, error) { req, err := client.invokeCommandCreateRequest(ctx, resourceGroupName, clusterName, body, options) if err != nil { @@ -427,79 +365,15 @@ func (client *CassandraClustersClient) invokeCommandCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) } -// NewListBackupsPager - List the backups of this cluster that are available to restore. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// clusterName - Managed Cassandra cluster name. -// options - CassandraClustersClientListBackupsOptions contains the optional parameters for the CassandraClustersClient.ListBackups -// method. -func (client *CassandraClustersClient) NewListBackupsPager(resourceGroupName string, clusterName string, options *CassandraClustersClientListBackupsOptions) *runtime.Pager[CassandraClustersClientListBackupsResponse] { - return runtime.NewPager(runtime.PagingHandler[CassandraClustersClientListBackupsResponse]{ - More: func(page CassandraClustersClientListBackupsResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *CassandraClustersClientListBackupsResponse) (CassandraClustersClientListBackupsResponse, error) { - req, err := client.listBackupsCreateRequest(ctx, resourceGroupName, clusterName, options) - if err != nil { - return CassandraClustersClientListBackupsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return CassandraClustersClientListBackupsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CassandraClustersClientListBackupsResponse{}, runtime.NewResponseError(resp) - } - return client.listBackupsHandleResponse(resp) - }, - }) -} - -// listBackupsCreateRequest creates the ListBackups request. -func (client *CassandraClustersClient) listBackupsCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, options *CassandraClustersClientListBackupsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/backups" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if clusterName == "" { - return nil, errors.New("parameter clusterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listBackupsHandleResponse handles the ListBackups response. -func (client *CassandraClustersClient) listBackupsHandleResponse(resp *http.Response) (CassandraClustersClientListBackupsResponse, error) { - result := CassandraClustersClientListBackupsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ListBackups); err != nil { - return CassandraClustersClientListBackupsResponse{}, err - } - return result, nil -} - // NewListByResourceGroupPager - List all managed Cassandra clusters in this resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // options - CassandraClustersClientListByResourceGroupOptions contains the optional parameters for the CassandraClustersClient.ListByResourceGroup // method. @@ -541,7 +415,7 @@ func (client *CassandraClustersClient) listByResourceGroupCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -558,7 +432,7 @@ func (client *CassandraClustersClient) listByResourceGroupHandleResponse(resp *h // NewListBySubscriptionPager - List all managed Cassandra clusters in this subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // options - CassandraClustersClientListBySubscriptionOptions contains the optional parameters for the CassandraClustersClient.ListBySubscription // method. func (client *CassandraClustersClient) NewListBySubscriptionPager(options *CassandraClustersClientListBySubscriptionOptions) *runtime.Pager[CassandraClustersClientListBySubscriptionResponse] { @@ -595,7 +469,7 @@ func (client *CassandraClustersClient) listBySubscriptionCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -614,7 +488,7 @@ func (client *CassandraClustersClient) listBySubscriptionHandleResponse(resp *ht // of this cluster with reserved data disk. This won't do anything on an already running // cluster. Use Deallocate to deallocate the cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // clusterName - Managed Cassandra cluster name. // options - CassandraClustersClientBeginStartOptions contains the optional parameters for the CassandraClustersClient.BeginStart @@ -635,7 +509,7 @@ func (client *CassandraClustersClient) BeginStart(ctx context.Context, resourceG // cluster with reserved data disk. This won't do anything on an already running // cluster. Use Deallocate to deallocate the cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *CassandraClustersClient) start(ctx context.Context, resourceGroupName string, clusterName string, options *CassandraClustersClientBeginStartOptions) (*http.Response, error) { req, err := client.startCreateRequest(ctx, resourceGroupName, clusterName, options) if err != nil { @@ -671,7 +545,7 @@ func (client *CassandraClustersClient) startCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -679,7 +553,7 @@ func (client *CassandraClustersClient) startCreateRequest(ctx context.Context, r // Status - Gets the CPU, memory, and disk usage statistics for each Cassandra node in a cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // clusterName - Managed Cassandra cluster name. // options - CassandraClustersClientStatusOptions contains the optional parameters for the CassandraClustersClient.Status @@ -719,7 +593,7 @@ func (client *CassandraClustersClient) statusCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -736,7 +610,7 @@ func (client *CassandraClustersClient) statusHandleResponse(resp *http.Response) // BeginUpdate - Updates some of the properties of a managed Cassandra cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // clusterName - Managed Cassandra cluster name. // body - Parameters to provide for specifying the managed Cassandra cluster. @@ -756,7 +630,7 @@ func (client *CassandraClustersClient) BeginUpdate(ctx context.Context, resource // Update - Updates some of the properties of a managed Cassandra cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *CassandraClustersClient) update(ctx context.Context, resourceGroupName string, clusterName string, body ClusterResource, options *CassandraClustersClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, clusterName, body, options) if err != nil { @@ -792,7 +666,7 @@ func (client *CassandraClustersClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) diff --git a/sdk/resourcemanager/cosmos/armcosmos/cassandraclusters_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/cassandraclusters_client_example_test.go deleted file mode 100644 index d4c9a1ab0f40..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/cassandraclusters_client_example_test.go +++ /dev/null @@ -1,368 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBManagedCassandraClusterListBySubscription.json -func ExampleCassandraClustersClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCassandraClustersClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBManagedCassandraClusterListByResourceGroup.json -func ExampleCassandraClustersClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCassandraClustersClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("cassandra-prod-rg", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBManagedCassandraClusterGet.json -func ExampleCassandraClustersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCassandraClustersClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "cassandra-prod-rg", - "cassandra-prod", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBManagedCassandraClusterDelete.json -func ExampleCassandraClustersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCassandraClustersClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "cassandra-prod-rg", - "cassandra-prod", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBManagedCassandraClusterCreate.json -func ExampleCassandraClustersClient_BeginCreateUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCassandraClustersClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateUpdate(ctx, - "cassandra-prod-rg", - "cassandra-prod", - armcosmos.ClusterResource{ - Location: to.Ptr("West US"), - Tags: map[string]*string{}, - Properties: &armcosmos.ClusterResourceProperties{ - AuthenticationMethod: to.Ptr(armcosmos.AuthenticationMethodCassandra), - CassandraVersion: to.Ptr("3.11"), - ClientCertificates: []*armcosmos.Certificate{ - { - Pem: to.Ptr("-----BEGIN CERTIFICATE-----\n...Base64 encoded certificate...\n-----END CERTIFICATE-----"), - }}, - ClusterNameOverride: to.Ptr("ClusterNameIllegalForAzureResource"), - DelegatedManagementSubnetID: to.Ptr("/subscriptions/536e130b-d7d6-4ac7-98a5-de20d69588d2/resourceGroups/customer-vnet-rg/providers/Microsoft.Network/virtualNetworks/customer-vnet/subnets/management"), - ExternalGossipCertificates: []*armcosmos.Certificate{ - { - Pem: to.Ptr("-----BEGIN CERTIFICATE-----\n...Base64 encoded certificate...\n-----END CERTIFICATE-----"), - }}, - ExternalSeedNodes: []*armcosmos.SeedNode{ - { - IPAddress: to.Ptr("10.52.221.2"), - }, - { - IPAddress: to.Ptr("10.52.221.3"), - }, - { - IPAddress: to.Ptr("10.52.221.4"), - }}, - HoursBetweenBackups: to.Ptr[int32](24), - InitialCassandraAdminPassword: to.Ptr("mypassword"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBManagedCassandraClusterPatch.json -func ExampleCassandraClustersClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCassandraClustersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "cassandra-prod-rg", - "cassandra-prod", - armcosmos.ClusterResource{ - Tags: map[string]*string{ - "owner": to.Ptr("mike"), - }, - Properties: &armcosmos.ClusterResourceProperties{ - AuthenticationMethod: to.Ptr(armcosmos.AuthenticationMethodNone), - ExternalGossipCertificates: []*armcosmos.Certificate{ - { - Pem: to.Ptr("-----BEGIN CERTIFICATE-----\n...Base64 encoded certificate...\n-----END CERTIFICATE-----"), - }}, - ExternalSeedNodes: []*armcosmos.SeedNode{ - { - IPAddress: to.Ptr("10.52.221.2"), - }, - { - IPAddress: to.Ptr("10.52.221.3"), - }, - { - IPAddress: to.Ptr("10.52.221.4"), - }}, - HoursBetweenBackups: to.Ptr[int32](12), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBManagedCassandraCommand.json -func ExampleCassandraClustersClient_BeginInvokeCommand() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCassandraClustersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginInvokeCommand(ctx, - "cassandra-prod-rg", - "cassandra-prod", - armcosmos.CommandPostBody{ - Arguments: map[string]*string{ - "status": to.Ptr(""), - }, - Command: to.Ptr("nodetool"), - Host: to.Ptr("10.0.1.12"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBManagedCassandraBackupsList.json -func ExampleCassandraClustersClient_NewListBackupsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCassandraClustersClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBackupsPager("cassandra-prod-rg", - "cassandra-prod", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBManagedCassandraBackup.json -func ExampleCassandraClustersClient_GetBackup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCassandraClustersClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetBackup(ctx, - "cassandra-prod-rg", - "cassandra-prod", - "1611250348", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBManagedCassandraClusterDeallocate.json -func ExampleCassandraClustersClient_BeginDeallocate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCassandraClustersClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDeallocate(ctx, - "cassandra-prod-rg", - "cassandra-prod", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBManagedCassandraClusterStart.json -func ExampleCassandraClustersClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCassandraClustersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStart(ctx, - "cassandra-prod-rg", - "cassandra-prod", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBManagedCassandraStatus.json -func ExampleCassandraClustersClient_Status() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCassandraClustersClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Status(ctx, - "cassandra-prod-rg", - "cassandra-prod", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/cassandradatacenters_client.go b/sdk/resourcemanager/cosmos/armcosmos/cassandradatacenters_client.go index a41ec4d43fd8..2573516787bf 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/cassandradatacenters_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/cassandradatacenters_client.go @@ -58,7 +58,7 @@ func NewCassandraDataCentersClient(subscriptionID string, credential azcore.Toke // BeginCreateUpdate - Create or update a managed Cassandra data center. When updating, overwrite all properties. To update // only some properties, use PATCH. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // clusterName - Managed Cassandra cluster name. // dataCenterName - Data center name in a managed Cassandra cluster. @@ -80,7 +80,7 @@ func (client *CassandraDataCentersClient) BeginCreateUpdate(ctx context.Context, // CreateUpdate - Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only // some properties, use PATCH. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *CassandraDataCentersClient) createUpdate(ctx context.Context, resourceGroupName string, clusterName string, dataCenterName string, body DataCenterResource, options *CassandraDataCentersClientBeginCreateUpdateOptions) (*http.Response, error) { req, err := client.createUpdateCreateRequest(ctx, resourceGroupName, clusterName, dataCenterName, body, options) if err != nil { @@ -120,7 +120,7 @@ func (client *CassandraDataCentersClient) createUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) @@ -128,7 +128,7 @@ func (client *CassandraDataCentersClient) createUpdateCreateRequest(ctx context. // BeginDelete - Delete a managed Cassandra data center. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // clusterName - Managed Cassandra cluster name. // dataCenterName - Data center name in a managed Cassandra cluster. @@ -148,7 +148,7 @@ func (client *CassandraDataCentersClient) BeginDelete(ctx context.Context, resou // Delete - Delete a managed Cassandra data center. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *CassandraDataCentersClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, dataCenterName string, options *CassandraDataCentersClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, dataCenterName, options) if err != nil { @@ -188,7 +188,7 @@ func (client *CassandraDataCentersClient) deleteCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -196,7 +196,7 @@ func (client *CassandraDataCentersClient) deleteCreateRequest(ctx context.Contex // Get - Get the properties of a managed Cassandra data center. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // clusterName - Managed Cassandra cluster name. // dataCenterName - Data center name in a managed Cassandra cluster. @@ -241,7 +241,7 @@ func (client *CassandraDataCentersClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -258,7 +258,7 @@ func (client *CassandraDataCentersClient) getHandleResponse(resp *http.Response) // NewListPager - List all data centers in a particular managed Cassandra cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // clusterName - Managed Cassandra cluster name. // options - CassandraDataCentersClientListOptions contains the optional parameters for the CassandraDataCentersClient.List @@ -305,7 +305,7 @@ func (client *CassandraDataCentersClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -322,7 +322,7 @@ func (client *CassandraDataCentersClient) listHandleResponse(resp *http.Response // BeginUpdate - Update some of the properties of a managed Cassandra data center. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // clusterName - Managed Cassandra cluster name. // dataCenterName - Data center name in a managed Cassandra cluster. @@ -343,7 +343,7 @@ func (client *CassandraDataCentersClient) BeginUpdate(ctx context.Context, resou // Update - Update some of the properties of a managed Cassandra data center. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *CassandraDataCentersClient) update(ctx context.Context, resourceGroupName string, clusterName string, dataCenterName string, body DataCenterResource, options *CassandraDataCentersClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, clusterName, dataCenterName, body, options) if err != nil { @@ -383,7 +383,7 @@ func (client *CassandraDataCentersClient) updateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) diff --git a/sdk/resourcemanager/cosmos/armcosmos/cassandradatacenters_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/cassandradatacenters_client_example_test.go deleted file mode 100644 index 9022c0953c28..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/cassandradatacenters_client_example_test.go +++ /dev/null @@ -1,162 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBManagedCassandraDataCenterList.json -func ExampleCassandraDataCentersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCassandraDataCentersClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("cassandra-prod-rg", - "cassandra-prod", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBManagedCassandraDataCenterGet.json -func ExampleCassandraDataCentersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCassandraDataCentersClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "cassandra-prod-rg", - "cassandra-prod", - "dc1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBManagedCassandraDataCenterDelete.json -func ExampleCassandraDataCentersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCassandraDataCentersClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "cassandra-prod-rg", - "cassandra-prod", - "dc1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBManagedCassandraDataCenterCreate.json -func ExampleCassandraDataCentersClient_BeginCreateUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCassandraDataCentersClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateUpdate(ctx, - "cassandra-prod-rg", - "cassandra-prod", - "dc1", - armcosmos.DataCenterResource{ - Properties: &armcosmos.DataCenterResourceProperties{ - Base64EncodedCassandraYamlFragment: to.Ptr("Y29tcGFjdGlvbl90aHJvdWdocHV0X21iX3Blcl9zZWM6IDMyCmNvbXBhY3Rpb25fbGFyZ2VfcGFydGl0aW9uX3dhcm5pbmdfdGhyZXNob2xkX21iOiAxMDA="), - DataCenterLocation: to.Ptr("West US 2"), - DelegatedSubnetID: to.Ptr("/subscriptions/536e130b-d7d6-4ac7-98a5-de20d69588d2/resourceGroups/customer-vnet-rg/providers/Microsoft.Network/virtualNetworks/customer-vnet/subnets/dc1-subnet"), - NodeCount: to.Ptr[int32](9), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBManagedCassandraDataCenterPatch.json -func ExampleCassandraDataCentersClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCassandraDataCentersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "cassandra-prod-rg", - "cassandra-prod", - "dc1", - armcosmos.DataCenterResource{ - Properties: &armcosmos.DataCenterResourceProperties{ - Base64EncodedCassandraYamlFragment: to.Ptr("Y29tcGFjdGlvbl90aHJvdWdocHV0X21iX3Blcl9zZWM6IDMyCmNvbXBhY3Rpb25fbGFyZ2VfcGFydGl0aW9uX3dhcm5pbmdfdGhyZXNob2xkX21iOiAxMDA="), - DataCenterLocation: to.Ptr("West US 2"), - DelegatedSubnetID: to.Ptr("/subscriptions/536e130b-d7d6-4ac7-98a5-de20d69588d2/resourceGroups/customer-vnet-rg/providers/Microsoft.Network/virtualNetworks/customer-vnet/subnets/dc1-subnet"), - NodeCount: to.Ptr[int32](9), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/cassandraresources_client.go b/sdk/resourcemanager/cosmos/armcosmos/cassandraresources_client.go index 4671c1902898..4e0f5253bde1 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/cassandraresources_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/cassandraresources_client.go @@ -57,7 +57,7 @@ func NewCassandraResourcesClient(subscriptionID string, credential azcore.TokenC // BeginCreateUpdateCassandraKeyspace - Create or update an Azure Cosmos DB Cassandra keyspace // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // keyspaceName - Cosmos DB keyspace name. @@ -78,7 +78,7 @@ func (client *CassandraResourcesClient) BeginCreateUpdateCassandraKeyspace(ctx c // CreateUpdateCassandraKeyspace - Create or update an Azure Cosmos DB Cassandra keyspace // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *CassandraResourcesClient) createUpdateCassandraKeyspace(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, createUpdateCassandraKeyspaceParameters CassandraKeyspaceCreateUpdateParameters, options *CassandraResourcesClientBeginCreateUpdateCassandraKeyspaceOptions) (*http.Response, error) { req, err := client.createUpdateCassandraKeyspaceCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, createUpdateCassandraKeyspaceParameters, options) if err != nil { @@ -118,7 +118,7 @@ func (client *CassandraResourcesClient) createUpdateCassandraKeyspaceCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, createUpdateCassandraKeyspaceParameters) @@ -126,7 +126,7 @@ func (client *CassandraResourcesClient) createUpdateCassandraKeyspaceCreateReque // BeginCreateUpdateCassandraTable - Create or update an Azure Cosmos DB Cassandra Table // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // keyspaceName - Cosmos DB keyspace name. @@ -148,7 +148,7 @@ func (client *CassandraResourcesClient) BeginCreateUpdateCassandraTable(ctx cont // CreateUpdateCassandraTable - Create or update an Azure Cosmos DB Cassandra Table // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *CassandraResourcesClient) createUpdateCassandraTable(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, createUpdateCassandraTableParameters CassandraTableCreateUpdateParameters, options *CassandraResourcesClientBeginCreateUpdateCassandraTableOptions) (*http.Response, error) { req, err := client.createUpdateCassandraTableCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, tableName, createUpdateCassandraTableParameters, options) if err != nil { @@ -192,89 +192,15 @@ func (client *CassandraResourcesClient) createUpdateCassandraTableCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, createUpdateCassandraTableParameters) } -// BeginCreateUpdateCassandraView - Create or update an Azure Cosmos DB Cassandra View -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// accountName - Cosmos DB database account name. -// keyspaceName - Cosmos DB keyspace name. -// viewName - Cosmos DB view name. -// createUpdateCassandraViewParameters - The parameters to provide for the current Cassandra View. -// options - CassandraResourcesClientBeginCreateUpdateCassandraViewOptions contains the optional parameters for the CassandraResourcesClient.BeginCreateUpdateCassandraView -// method. -func (client *CassandraResourcesClient) BeginCreateUpdateCassandraView(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, createUpdateCassandraViewParameters CassandraViewCreateUpdateParameters, options *CassandraResourcesClientBeginCreateUpdateCassandraViewOptions) (*runtime.Poller[CassandraResourcesClientCreateUpdateCassandraViewResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createUpdateCassandraView(ctx, resourceGroupName, accountName, keyspaceName, viewName, createUpdateCassandraViewParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[CassandraResourcesClientCreateUpdateCassandraViewResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[CassandraResourcesClientCreateUpdateCassandraViewResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateUpdateCassandraView - Create or update an Azure Cosmos DB Cassandra View -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -func (client *CassandraResourcesClient) createUpdateCassandraView(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, createUpdateCassandraViewParameters CassandraViewCreateUpdateParameters, options *CassandraResourcesClientBeginCreateUpdateCassandraViewOptions) (*http.Response, error) { - req, err := client.createUpdateCassandraViewCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, viewName, createUpdateCassandraViewParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createUpdateCassandraViewCreateRequest creates the CreateUpdateCassandraView request. -func (client *CassandraResourcesClient) createUpdateCassandraViewCreateRequest(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, createUpdateCassandraViewParameters CassandraViewCreateUpdateParameters, options *CassandraResourcesClientBeginCreateUpdateCassandraViewOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - if keyspaceName == "" { - return nil, errors.New("parameter keyspaceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{keyspaceName}", url.PathEscape(keyspaceName)) - if viewName == "" { - return nil, errors.New("parameter viewName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{viewName}", url.PathEscape(viewName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, createUpdateCassandraViewParameters) -} - // BeginDeleteCassandraKeyspace - Deletes an existing Azure Cosmos DB Cassandra keyspace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // keyspaceName - Cosmos DB keyspace name. @@ -294,7 +220,7 @@ func (client *CassandraResourcesClient) BeginDeleteCassandraKeyspace(ctx context // DeleteCassandraKeyspace - Deletes an existing Azure Cosmos DB Cassandra keyspace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *CassandraResourcesClient) deleteCassandraKeyspace(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, options *CassandraResourcesClientBeginDeleteCassandraKeyspaceOptions) (*http.Response, error) { req, err := client.deleteCassandraKeyspaceCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, options) if err != nil { @@ -334,14 +260,14 @@ func (client *CassandraResourcesClient) deleteCassandraKeyspaceCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // BeginDeleteCassandraTable - Deletes an existing Azure Cosmos DB Cassandra table. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // keyspaceName - Cosmos DB keyspace name. @@ -362,7 +288,7 @@ func (client *CassandraResourcesClient) BeginDeleteCassandraTable(ctx context.Co // DeleteCassandraTable - Deletes an existing Azure Cosmos DB Cassandra table. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *CassandraResourcesClient) deleteCassandraTable(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, options *CassandraResourcesClientBeginDeleteCassandraTableOptions) (*http.Response, error) { req, err := client.deleteCassandraTableCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, tableName, options) if err != nil { @@ -406,79 +332,7 @@ func (client *CassandraResourcesClient) deleteCassandraTableCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - return req, nil -} - -// BeginDeleteCassandraView - Deletes an existing Azure Cosmos DB Cassandra view. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// accountName - Cosmos DB database account name. -// keyspaceName - Cosmos DB keyspace name. -// viewName - Cosmos DB view name. -// options - CassandraResourcesClientBeginDeleteCassandraViewOptions contains the optional parameters for the CassandraResourcesClient.BeginDeleteCassandraView -// method. -func (client *CassandraResourcesClient) BeginDeleteCassandraView(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, options *CassandraResourcesClientBeginDeleteCassandraViewOptions) (*runtime.Poller[CassandraResourcesClientDeleteCassandraViewResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteCassandraView(ctx, resourceGroupName, accountName, keyspaceName, viewName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[CassandraResourcesClientDeleteCassandraViewResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[CassandraResourcesClientDeleteCassandraViewResponse](options.ResumeToken, client.pl, nil) - } -} - -// DeleteCassandraView - Deletes an existing Azure Cosmos DB Cassandra view. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -func (client *CassandraResourcesClient) deleteCassandraView(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, options *CassandraResourcesClientBeginDeleteCassandraViewOptions) (*http.Response, error) { - req, err := client.deleteCassandraViewCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, viewName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCassandraViewCreateRequest creates the DeleteCassandraView request. -func (client *CassandraResourcesClient) deleteCassandraViewCreateRequest(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, options *CassandraResourcesClientBeginDeleteCassandraViewOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - if keyspaceName == "" { - return nil, errors.New("parameter keyspaceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{keyspaceName}", url.PathEscape(keyspaceName)) - if viewName == "" { - return nil, errors.New("parameter viewName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{viewName}", url.PathEscape(viewName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -486,7 +340,7 @@ func (client *CassandraResourcesClient) deleteCassandraViewCreateRequest(ctx con // GetCassandraKeyspace - Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided // name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // keyspaceName - Cosmos DB keyspace name. @@ -531,7 +385,7 @@ func (client *CassandraResourcesClient) getCassandraKeyspaceCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -549,7 +403,7 @@ func (client *CassandraResourcesClient) getCassandraKeyspaceHandleResponse(resp // GetCassandraKeyspaceThroughput - Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database // account with the provided name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // keyspaceName - Cosmos DB keyspace name. @@ -594,7 +448,7 @@ func (client *CassandraResourcesClient) getCassandraKeyspaceThroughputCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -611,7 +465,7 @@ func (client *CassandraResourcesClient) getCassandraKeyspaceThroughputHandleResp // GetCassandraTable - Gets the Cassandra table under an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // keyspaceName - Cosmos DB keyspace name. @@ -661,7 +515,7 @@ func (client *CassandraResourcesClient) getCassandraTableCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -679,7 +533,7 @@ func (client *CassandraResourcesClient) getCassandraTableHandleResponse(resp *ht // GetCassandraTableThroughput - Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database // account with the provided name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // keyspaceName - Cosmos DB keyspace name. @@ -729,7 +583,7 @@ func (client *CassandraResourcesClient) getCassandraTableThroughputCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -744,144 +598,9 @@ func (client *CassandraResourcesClient) getCassandraTableThroughputHandleRespons return result, nil } -// GetCassandraView - Gets the Cassandra view under an existing Azure Cosmos DB database account. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// accountName - Cosmos DB database account name. -// keyspaceName - Cosmos DB keyspace name. -// viewName - Cosmos DB view name. -// options - CassandraResourcesClientGetCassandraViewOptions contains the optional parameters for the CassandraResourcesClient.GetCassandraView -// method. -func (client *CassandraResourcesClient) GetCassandraView(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, options *CassandraResourcesClientGetCassandraViewOptions) (CassandraResourcesClientGetCassandraViewResponse, error) { - req, err := client.getCassandraViewCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, viewName, options) - if err != nil { - return CassandraResourcesClientGetCassandraViewResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return CassandraResourcesClientGetCassandraViewResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CassandraResourcesClientGetCassandraViewResponse{}, runtime.NewResponseError(resp) - } - return client.getCassandraViewHandleResponse(resp) -} - -// getCassandraViewCreateRequest creates the GetCassandraView request. -func (client *CassandraResourcesClient) getCassandraViewCreateRequest(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, options *CassandraResourcesClientGetCassandraViewOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - if keyspaceName == "" { - return nil, errors.New("parameter keyspaceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{keyspaceName}", url.PathEscape(keyspaceName)) - if viewName == "" { - return nil, errors.New("parameter viewName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{viewName}", url.PathEscape(viewName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getCassandraViewHandleResponse handles the GetCassandraView response. -func (client *CassandraResourcesClient) getCassandraViewHandleResponse(resp *http.Response) (CassandraResourcesClientGetCassandraViewResponse, error) { - result := CassandraResourcesClientGetCassandraViewResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CassandraViewGetResults); err != nil { - return CassandraResourcesClientGetCassandraViewResponse{}, err - } - return result, nil -} - -// GetCassandraViewThroughput - Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account -// with the provided name. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// accountName - Cosmos DB database account name. -// keyspaceName - Cosmos DB keyspace name. -// viewName - Cosmos DB view name. -// options - CassandraResourcesClientGetCassandraViewThroughputOptions contains the optional parameters for the CassandraResourcesClient.GetCassandraViewThroughput -// method. -func (client *CassandraResourcesClient) GetCassandraViewThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, options *CassandraResourcesClientGetCassandraViewThroughputOptions) (CassandraResourcesClientGetCassandraViewThroughputResponse, error) { - req, err := client.getCassandraViewThroughputCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, viewName, options) - if err != nil { - return CassandraResourcesClientGetCassandraViewThroughputResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return CassandraResourcesClientGetCassandraViewThroughputResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CassandraResourcesClientGetCassandraViewThroughputResponse{}, runtime.NewResponseError(resp) - } - return client.getCassandraViewThroughputHandleResponse(resp) -} - -// getCassandraViewThroughputCreateRequest creates the GetCassandraViewThroughput request. -func (client *CassandraResourcesClient) getCassandraViewThroughputCreateRequest(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, options *CassandraResourcesClientGetCassandraViewThroughputOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - if keyspaceName == "" { - return nil, errors.New("parameter keyspaceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{keyspaceName}", url.PathEscape(keyspaceName)) - if viewName == "" { - return nil, errors.New("parameter viewName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{viewName}", url.PathEscape(viewName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getCassandraViewThroughputHandleResponse handles the GetCassandraViewThroughput response. -func (client *CassandraResourcesClient) getCassandraViewThroughputHandleResponse(resp *http.Response) (CassandraResourcesClientGetCassandraViewThroughputResponse, error) { - result := CassandraResourcesClientGetCassandraViewThroughputResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ThroughputSettingsGetResults); err != nil { - return CassandraResourcesClientGetCassandraViewThroughputResponse{}, err - } - return result, nil -} - // NewListCassandraKeyspacesPager - Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // options - CassandraResourcesClientListCassandraKeyspacesOptions contains the optional parameters for the CassandraResourcesClient.ListCassandraKeyspaces @@ -928,7 +647,7 @@ func (client *CassandraResourcesClient) listCassandraKeyspacesCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -945,7 +664,7 @@ func (client *CassandraResourcesClient) listCassandraKeyspacesHandleResponse(res // NewListCassandraTablesPager - Lists the Cassandra table under an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // keyspaceName - Cosmos DB keyspace name. @@ -997,7 +716,7 @@ func (client *CassandraResourcesClient) listCassandraTablesCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1012,78 +731,9 @@ func (client *CassandraResourcesClient) listCassandraTablesHandleResponse(resp * return result, nil } -// NewListCassandraViewsPager - Lists the Cassandra materialized views under an existing Azure Cosmos DB database account. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// accountName - Cosmos DB database account name. -// keyspaceName - Cosmos DB keyspace name. -// options - CassandraResourcesClientListCassandraViewsOptions contains the optional parameters for the CassandraResourcesClient.ListCassandraViews -// method. -func (client *CassandraResourcesClient) NewListCassandraViewsPager(resourceGroupName string, accountName string, keyspaceName string, options *CassandraResourcesClientListCassandraViewsOptions) *runtime.Pager[CassandraResourcesClientListCassandraViewsResponse] { - return runtime.NewPager(runtime.PagingHandler[CassandraResourcesClientListCassandraViewsResponse]{ - More: func(page CassandraResourcesClientListCassandraViewsResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *CassandraResourcesClientListCassandraViewsResponse) (CassandraResourcesClientListCassandraViewsResponse, error) { - req, err := client.listCassandraViewsCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, options) - if err != nil { - return CassandraResourcesClientListCassandraViewsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return CassandraResourcesClientListCassandraViewsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CassandraResourcesClientListCassandraViewsResponse{}, runtime.NewResponseError(resp) - } - return client.listCassandraViewsHandleResponse(resp) - }, - }) -} - -// listCassandraViewsCreateRequest creates the ListCassandraViews request. -func (client *CassandraResourcesClient) listCassandraViewsCreateRequest(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, options *CassandraResourcesClientListCassandraViewsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - if keyspaceName == "" { - return nil, errors.New("parameter keyspaceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{keyspaceName}", url.PathEscape(keyspaceName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listCassandraViewsHandleResponse handles the ListCassandraViews response. -func (client *CassandraResourcesClient) listCassandraViewsHandleResponse(resp *http.Response) (CassandraResourcesClientListCassandraViewsResponse, error) { - result := CassandraResourcesClientListCassandraViewsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CassandraViewListResult); err != nil { - return CassandraResourcesClientListCassandraViewsResponse{}, err - } - return result, nil -} - // BeginMigrateCassandraKeyspaceToAutoscale - Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // keyspaceName - Cosmos DB keyspace name. @@ -1103,7 +753,7 @@ func (client *CassandraResourcesClient) BeginMigrateCassandraKeyspaceToAutoscale // MigrateCassandraKeyspaceToAutoscale - Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *CassandraResourcesClient) migrateCassandraKeyspaceToAutoscale(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, options *CassandraResourcesClientBeginMigrateCassandraKeyspaceToAutoscaleOptions) (*http.Response, error) { req, err := client.migrateCassandraKeyspaceToAutoscaleCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, options) if err != nil { @@ -1143,7 +793,7 @@ func (client *CassandraResourcesClient) migrateCassandraKeyspaceToAutoscaleCreat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1152,7 +802,7 @@ func (client *CassandraResourcesClient) migrateCassandraKeyspaceToAutoscaleCreat // BeginMigrateCassandraKeyspaceToManualThroughput - Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual // throughput // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // keyspaceName - Cosmos DB keyspace name. @@ -1172,7 +822,7 @@ func (client *CassandraResourcesClient) BeginMigrateCassandraKeyspaceToManualThr // MigrateCassandraKeyspaceToManualThroughput - Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *CassandraResourcesClient) migrateCassandraKeyspaceToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, options *CassandraResourcesClientBeginMigrateCassandraKeyspaceToManualThroughputOptions) (*http.Response, error) { req, err := client.migrateCassandraKeyspaceToManualThroughputCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, options) if err != nil { @@ -1212,7 +862,7 @@ func (client *CassandraResourcesClient) migrateCassandraKeyspaceToManualThroughp return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1220,7 +870,7 @@ func (client *CassandraResourcesClient) migrateCassandraKeyspaceToManualThroughp // BeginMigrateCassandraTableToAutoscale - Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // keyspaceName - Cosmos DB keyspace name. @@ -1241,7 +891,7 @@ func (client *CassandraResourcesClient) BeginMigrateCassandraTableToAutoscale(ct // MigrateCassandraTableToAutoscale - Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *CassandraResourcesClient) migrateCassandraTableToAutoscale(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, options *CassandraResourcesClientBeginMigrateCassandraTableToAutoscaleOptions) (*http.Response, error) { req, err := client.migrateCassandraTableToAutoscaleCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, tableName, options) if err != nil { @@ -1285,7 +935,7 @@ func (client *CassandraResourcesClient) migrateCassandraTableToAutoscaleCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1293,7 +943,7 @@ func (client *CassandraResourcesClient) migrateCassandraTableToAutoscaleCreateRe // BeginMigrateCassandraTableToManualThroughput - Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // keyspaceName - Cosmos DB keyspace name. @@ -1314,7 +964,7 @@ func (client *CassandraResourcesClient) BeginMigrateCassandraTableToManualThroug // MigrateCassandraTableToManualThroughput - Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *CassandraResourcesClient) migrateCassandraTableToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, options *CassandraResourcesClientBeginMigrateCassandraTableToManualThroughputOptions) (*http.Response, error) { req, err := client.migrateCassandraTableToManualThroughputCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, tableName, options) if err != nil { @@ -1358,153 +1008,7 @@ func (client *CassandraResourcesClient) migrateCassandraTableToManualThroughputC return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginMigrateCassandraViewToAutoscale - Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// accountName - Cosmos DB database account name. -// keyspaceName - Cosmos DB keyspace name. -// viewName - Cosmos DB view name. -// options - CassandraResourcesClientBeginMigrateCassandraViewToAutoscaleOptions contains the optional parameters for the -// CassandraResourcesClient.BeginMigrateCassandraViewToAutoscale method. -func (client *CassandraResourcesClient) BeginMigrateCassandraViewToAutoscale(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, options *CassandraResourcesClientBeginMigrateCassandraViewToAutoscaleOptions) (*runtime.Poller[CassandraResourcesClientMigrateCassandraViewToAutoscaleResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.migrateCassandraViewToAutoscale(ctx, resourceGroupName, accountName, keyspaceName, viewName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[CassandraResourcesClientMigrateCassandraViewToAutoscaleResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[CassandraResourcesClientMigrateCassandraViewToAutoscaleResponse](options.ResumeToken, client.pl, nil) - } -} - -// MigrateCassandraViewToAutoscale - Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -func (client *CassandraResourcesClient) migrateCassandraViewToAutoscale(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, options *CassandraResourcesClientBeginMigrateCassandraViewToAutoscaleOptions) (*http.Response, error) { - req, err := client.migrateCassandraViewToAutoscaleCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, viewName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// migrateCassandraViewToAutoscaleCreateRequest creates the MigrateCassandraViewToAutoscale request. -func (client *CassandraResourcesClient) migrateCassandraViewToAutoscaleCreateRequest(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, options *CassandraResourcesClientBeginMigrateCassandraViewToAutoscaleOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToAutoscale" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - if keyspaceName == "" { - return nil, errors.New("parameter keyspaceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{keyspaceName}", url.PathEscape(keyspaceName)) - if viewName == "" { - return nil, errors.New("parameter viewName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{viewName}", url.PathEscape(viewName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginMigrateCassandraViewToManualThroughput - Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// accountName - Cosmos DB database account name. -// keyspaceName - Cosmos DB keyspace name. -// viewName - Cosmos DB view name. -// options - CassandraResourcesClientBeginMigrateCassandraViewToManualThroughputOptions contains the optional parameters for -// the CassandraResourcesClient.BeginMigrateCassandraViewToManualThroughput method. -func (client *CassandraResourcesClient) BeginMigrateCassandraViewToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, options *CassandraResourcesClientBeginMigrateCassandraViewToManualThroughputOptions) (*runtime.Poller[CassandraResourcesClientMigrateCassandraViewToManualThroughputResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.migrateCassandraViewToManualThroughput(ctx, resourceGroupName, accountName, keyspaceName, viewName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[CassandraResourcesClientMigrateCassandraViewToManualThroughputResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[CassandraResourcesClientMigrateCassandraViewToManualThroughputResponse](options.ResumeToken, client.pl, nil) - } -} - -// MigrateCassandraViewToManualThroughput - Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -func (client *CassandraResourcesClient) migrateCassandraViewToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, options *CassandraResourcesClientBeginMigrateCassandraViewToManualThroughputOptions) (*http.Response, error) { - req, err := client.migrateCassandraViewToManualThroughputCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, viewName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// migrateCassandraViewToManualThroughputCreateRequest creates the MigrateCassandraViewToManualThroughput request. -func (client *CassandraResourcesClient) migrateCassandraViewToManualThroughputCreateRequest(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, options *CassandraResourcesClientBeginMigrateCassandraViewToManualThroughputOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToManualThroughput" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - if keyspaceName == "" { - return nil, errors.New("parameter keyspaceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{keyspaceName}", url.PathEscape(keyspaceName)) - if viewName == "" { - return nil, errors.New("parameter viewName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{viewName}", url.PathEscape(viewName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1512,7 +1016,7 @@ func (client *CassandraResourcesClient) migrateCassandraViewToManualThroughputCr // BeginUpdateCassandraKeyspaceThroughput - Update RUs per second of an Azure Cosmos DB Cassandra Keyspace // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // keyspaceName - Cosmos DB keyspace name. @@ -1533,7 +1037,7 @@ func (client *CassandraResourcesClient) BeginUpdateCassandraKeyspaceThroughput(c // UpdateCassandraKeyspaceThroughput - Update RUs per second of an Azure Cosmos DB Cassandra Keyspace // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *CassandraResourcesClient) updateCassandraKeyspaceThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *CassandraResourcesClientBeginUpdateCassandraKeyspaceThroughputOptions) (*http.Response, error) { req, err := client.updateCassandraKeyspaceThroughputCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, updateThroughputParameters, options) if err != nil { @@ -1573,7 +1077,7 @@ func (client *CassandraResourcesClient) updateCassandraKeyspaceThroughputCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, updateThroughputParameters) @@ -1581,7 +1085,7 @@ func (client *CassandraResourcesClient) updateCassandraKeyspaceThroughputCreateR // BeginUpdateCassandraTableThroughput - Update RUs per second of an Azure Cosmos DB Cassandra table // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // keyspaceName - Cosmos DB keyspace name. @@ -1603,7 +1107,7 @@ func (client *CassandraResourcesClient) BeginUpdateCassandraTableThroughput(ctx // UpdateCassandraTableThroughput - Update RUs per second of an Azure Cosmos DB Cassandra table // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *CassandraResourcesClient) updateCassandraTableThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *CassandraResourcesClientBeginUpdateCassandraTableThroughputOptions) (*http.Response, error) { req, err := client.updateCassandraTableThroughputCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, tableName, updateThroughputParameters, options) if err != nil { @@ -1647,81 +1151,7 @@ func (client *CassandraResourcesClient) updateCassandraTableThroughputCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, updateThroughputParameters) -} - -// BeginUpdateCassandraViewThroughput - Update RUs per second of an Azure Cosmos DB Cassandra view -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// accountName - Cosmos DB database account name. -// keyspaceName - Cosmos DB keyspace name. -// viewName - Cosmos DB view name. -// updateThroughputParameters - The RUs per second of the parameters to provide for the current Cassandra view. -// options - CassandraResourcesClientBeginUpdateCassandraViewThroughputOptions contains the optional parameters for the CassandraResourcesClient.BeginUpdateCassandraViewThroughput -// method. -func (client *CassandraResourcesClient) BeginUpdateCassandraViewThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *CassandraResourcesClientBeginUpdateCassandraViewThroughputOptions) (*runtime.Poller[CassandraResourcesClientUpdateCassandraViewThroughputResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.updateCassandraViewThroughput(ctx, resourceGroupName, accountName, keyspaceName, viewName, updateThroughputParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[CassandraResourcesClientUpdateCassandraViewThroughputResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[CassandraResourcesClientUpdateCassandraViewThroughputResponse](options.ResumeToken, client.pl, nil) - } -} - -// UpdateCassandraViewThroughput - Update RUs per second of an Azure Cosmos DB Cassandra view -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -func (client *CassandraResourcesClient) updateCassandraViewThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *CassandraResourcesClientBeginUpdateCassandraViewThroughputOptions) (*http.Response, error) { - req, err := client.updateCassandraViewThroughputCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, viewName, updateThroughputParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// updateCassandraViewThroughputCreateRequest creates the UpdateCassandraViewThroughput request. -func (client *CassandraResourcesClient) updateCassandraViewThroughputCreateRequest(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *CassandraResourcesClientBeginUpdateCassandraViewThroughputOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - if keyspaceName == "" { - return nil, errors.New("parameter keyspaceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{keyspaceName}", url.PathEscape(keyspaceName)) - if viewName == "" { - return nil, errors.New("parameter viewName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{viewName}", url.PathEscape(viewName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, updateThroughputParameters) diff --git a/sdk/resourcemanager/cosmos/armcosmos/cassandraresources_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/cassandraresources_client_example_test.go deleted file mode 100644 index 889384a9eda3..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/cassandraresources_client_example_test.go +++ /dev/null @@ -1,723 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBCassandraKeyspaceList.json -func ExampleCassandraResourcesClient_NewListCassandraKeyspacesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCassandraResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListCassandraKeyspacesPager("rgName", - "ddb1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBCassandraKeyspaceGet.json -func ExampleCassandraResourcesClient_GetCassandraKeyspace() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCassandraResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetCassandraKeyspace(ctx, - "rg1", - "ddb1", - "keyspaceName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBCassandraKeyspaceCreateUpdate.json -func ExampleCassandraResourcesClient_BeginCreateUpdateCassandraKeyspace() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCassandraResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateUpdateCassandraKeyspace(ctx, - "rg1", - "ddb1", - "keyspaceName", - armcosmos.CassandraKeyspaceCreateUpdateParameters{ - Location: to.Ptr("West US"), - Tags: map[string]*string{}, - Properties: &armcosmos.CassandraKeyspaceCreateUpdateProperties{ - Options: &armcosmos.CreateUpdateOptions{}, - Resource: &armcosmos.CassandraKeyspaceResource{ - ID: to.Ptr("keyspaceName"), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBCassandraKeyspaceDelete.json -func ExampleCassandraResourcesClient_BeginDeleteCassandraKeyspace() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCassandraResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDeleteCassandraKeyspace(ctx, - "rg1", - "ddb1", - "keyspaceName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBCassandraKeyspaceThroughputGet.json -func ExampleCassandraResourcesClient_GetCassandraKeyspaceThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCassandraResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetCassandraKeyspaceThroughput(ctx, - "rg1", - "ddb1", - "keyspaceName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBCassandraKeyspaceThroughputUpdate.json -func ExampleCassandraResourcesClient_BeginUpdateCassandraKeyspaceThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCassandraResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdateCassandraKeyspaceThroughput(ctx, - "rg1", - "ddb1", - "keyspaceName", - armcosmos.ThroughputSettingsUpdateParameters{ - Location: to.Ptr("West US"), - Tags: map[string]*string{}, - Properties: &armcosmos.ThroughputSettingsUpdateProperties{ - Resource: &armcosmos.ThroughputSettingsResource{ - Throughput: to.Ptr[int32](400), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBCassandraKeyspaceMigrateToAutoscale.json -func ExampleCassandraResourcesClient_BeginMigrateCassandraKeyspaceToAutoscale() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCassandraResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginMigrateCassandraKeyspaceToAutoscale(ctx, - "rg1", - "ddb1", - "keyspaceName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBCassandraKeyspaceMigrateToManualThroughput.json -func ExampleCassandraResourcesClient_BeginMigrateCassandraKeyspaceToManualThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCassandraResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginMigrateCassandraKeyspaceToManualThroughput(ctx, - "rg1", - "ddb1", - "keyspaceName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBCassandraTableList.json -func ExampleCassandraResourcesClient_NewListCassandraTablesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCassandraResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListCassandraTablesPager("rgName", - "ddb1", - "keyspaceName", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBCassandraTableGet.json -func ExampleCassandraResourcesClient_GetCassandraTable() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCassandraResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetCassandraTable(ctx, - "rg1", - "ddb1", - "keyspaceName", - "tableName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBCassandraTableCreateUpdate.json -func ExampleCassandraResourcesClient_BeginCreateUpdateCassandraTable() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCassandraResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateUpdateCassandraTable(ctx, - "rg1", - "ddb1", - "keyspaceName", - "tableName", - armcosmos.CassandraTableCreateUpdateParameters{ - Location: to.Ptr("West US"), - Tags: map[string]*string{}, - Properties: &armcosmos.CassandraTableCreateUpdateProperties{ - Options: &armcosmos.CreateUpdateOptions{}, - Resource: &armcosmos.CassandraTableResource{ - Schema: &armcosmos.CassandraSchema{ - ClusterKeys: []*armcosmos.ClusterKey{ - { - Name: to.Ptr("columnA"), - OrderBy: to.Ptr("Asc"), - }}, - Columns: []*armcosmos.Column{ - { - Name: to.Ptr("columnA"), - Type: to.Ptr("Ascii"), - }}, - PartitionKeys: []*armcosmos.CassandraPartitionKey{ - { - Name: to.Ptr("columnA"), - }}, - }, - AnalyticalStorageTTL: to.Ptr[int32](500), - DefaultTTL: to.Ptr[int32](100), - ID: to.Ptr("tableName"), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBCassandraTableDelete.json -func ExampleCassandraResourcesClient_BeginDeleteCassandraTable() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCassandraResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDeleteCassandraTable(ctx, - "rg1", - "ddb1", - "keyspaceName", - "tableName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBCassandraTableThroughputGet.json -func ExampleCassandraResourcesClient_GetCassandraTableThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCassandraResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetCassandraTableThroughput(ctx, - "rg1", - "ddb1", - "keyspaceName", - "tableName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBCassandraTableThroughputUpdate.json -func ExampleCassandraResourcesClient_BeginUpdateCassandraTableThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCassandraResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdateCassandraTableThroughput(ctx, - "rg1", - "ddb1", - "keyspaceName", - "tableName", - armcosmos.ThroughputSettingsUpdateParameters{ - Location: to.Ptr("West US"), - Tags: map[string]*string{}, - Properties: &armcosmos.ThroughputSettingsUpdateProperties{ - Resource: &armcosmos.ThroughputSettingsResource{ - Throughput: to.Ptr[int32](400), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBCassandraTableMigrateToAutoscale.json -func ExampleCassandraResourcesClient_BeginMigrateCassandraTableToAutoscale() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCassandraResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginMigrateCassandraTableToAutoscale(ctx, - "rg1", - "ddb1", - "keyspaceName", - "tableName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBCassandraTableMigrateToManualThroughput.json -func ExampleCassandraResourcesClient_BeginMigrateCassandraTableToManualThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCassandraResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginMigrateCassandraTableToManualThroughput(ctx, - "rg1", - "ddb1", - "keyspaceName", - "tableName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBCassandraViewList.json -func ExampleCassandraResourcesClient_NewListCassandraViewsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCassandraResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListCassandraViewsPager("rgName", - "ddb1", - "keyspacename", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBCassandraViewGet.json -func ExampleCassandraResourcesClient_GetCassandraView() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCassandraResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetCassandraView(ctx, - "rg1", - "ddb1", - "keyspacename", - "viewname", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBCassandraViewCreateUpdate.json -func ExampleCassandraResourcesClient_BeginCreateUpdateCassandraView() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCassandraResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateUpdateCassandraView(ctx, - "rg1", - "ddb1", - "keyspacename", - "viewname", - armcosmos.CassandraViewCreateUpdateParameters{ - Tags: map[string]*string{}, - Properties: &armcosmos.CassandraViewCreateUpdateProperties{ - Options: &armcosmos.CreateUpdateOptions{}, - Resource: &armcosmos.CassandraViewResource{ - ID: to.Ptr("viewname"), - ViewDefinition: to.Ptr("SELECT columna, columnb, columnc FROM keyspacename.srctablename WHERE columna IS NOT NULL AND columnc IS NOT NULL PRIMARY (columnc, columna)"), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBCassandraViewDelete.json -func ExampleCassandraResourcesClient_BeginDeleteCassandraView() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCassandraResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDeleteCassandraView(ctx, - "rg1", - "ddb1", - "keyspacename", - "viewname", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBCassandraViewThroughputGet.json -func ExampleCassandraResourcesClient_GetCassandraViewThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCassandraResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetCassandraViewThroughput(ctx, - "rg1", - "ddb1", - "keyspacename", - "viewname", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBCassandraViewThroughputUpdate.json -func ExampleCassandraResourcesClient_BeginUpdateCassandraViewThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCassandraResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdateCassandraViewThroughput(ctx, - "rg1", - "ddb1", - "keyspacename", - "viewname", - armcosmos.ThroughputSettingsUpdateParameters{ - Tags: map[string]*string{}, - Properties: &armcosmos.ThroughputSettingsUpdateProperties{ - Resource: &armcosmos.ThroughputSettingsResource{ - Throughput: to.Ptr[int32](400), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBCassandraViewMigrateToAutoscale.json -func ExampleCassandraResourcesClient_BeginMigrateCassandraViewToAutoscale() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCassandraResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginMigrateCassandraViewToAutoscale(ctx, - "rg1", - "ddb1", - "keyspacename", - "viewname", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBCassandraViewMigrateToManualThroughput.json -func ExampleCassandraResourcesClient_BeginMigrateCassandraViewToManualThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCassandraResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginMigrateCassandraViewToManualThroughput(ctx, - "rg1", - "ddb1", - "keyspacename", - "viewname", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/collection_client.go b/sdk/resourcemanager/cosmos/armcosmos/collection_client.go index 85fd3a42635c..59294fde3f03 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/collection_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/collection_client.go @@ -57,7 +57,7 @@ func NewCollectionClient(subscriptionID string, credential azcore.TokenCredentia // NewListMetricDefinitionsPager - Retrieves metric definitions for the given collection. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseRid - Cosmos DB database rid. @@ -114,7 +114,7 @@ func (client *CollectionClient) listMetricDefinitionsCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -131,7 +131,7 @@ func (client *CollectionClient) listMetricDefinitionsHandleResponse(resp *http.R // NewListMetricsPager - Retrieves the metrics determined by the given filter for the given database account and collection. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseRid - Cosmos DB database rid. @@ -190,7 +190,7 @@ func (client *CollectionClient) listMetricsCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") reqQP.Set("$filter", filter) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -208,7 +208,7 @@ func (client *CollectionClient) listMetricsHandleResponse(resp *http.Response) ( // NewListUsagesPager - Retrieves the usages (most recent storage data) for the given collection. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseRid - Cosmos DB database rid. @@ -264,7 +264,7 @@ func (client *CollectionClient) listUsagesCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/cosmos/armcosmos/collection_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/collection_client_example_test.go deleted file mode 100644 index 65e6a36756e3..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/collection_client_example_test.go +++ /dev/null @@ -1,103 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBCollectionGetMetrics.json -func ExampleCollectionClient_NewListMetricsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCollectionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListMetricsPager("rg1", - "ddb1", - "databaseRid", - "collectionRid", - "$filter=(name.value eq 'Total Requests') and timeGrain eq duration'PT5M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T00:13:55.2780000Z", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBCollectionGetUsages.json -func ExampleCollectionClient_NewListUsagesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCollectionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListUsagesPager("rg1", - "ddb1", - "databaseRid", - "collectionRid", - &armcosmos.CollectionClientListUsagesOptions{Filter: to.Ptr("$filter=name.value eq 'Storage'")}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBCollectionGetMetricDefinitions.json -func ExampleCollectionClient_NewListMetricDefinitionsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCollectionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListMetricDefinitionsPager("rg1", - "ddb1", - "databaseRid", - "collectionRid", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/collectionpartition_client.go b/sdk/resourcemanager/cosmos/armcosmos/collectionpartition_client.go index a94e5669b334..2f2d11082052 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/collectionpartition_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/collectionpartition_client.go @@ -57,7 +57,7 @@ func NewCollectionPartitionClient(subscriptionID string, credential azcore.Token // NewListMetricsPager - Retrieves the metrics determined by the given filter for the given collection, split by partition. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseRid - Cosmos DB database rid. @@ -117,7 +117,7 @@ func (client *CollectionPartitionClient) listMetricsCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") reqQP.Set("$filter", filter) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -135,7 +135,7 @@ func (client *CollectionPartitionClient) listMetricsHandleResponse(resp *http.Re // NewListUsagesPager - Retrieves the usages (most recent storage data) for the given collection, split by partition. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseRid - Cosmos DB database rid. @@ -192,7 +192,7 @@ func (client *CollectionPartitionClient) listUsagesCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/cosmos/armcosmos/collectionpartition_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/collectionpartition_client_example_test.go deleted file mode 100644 index f630cd499372..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/collectionpartition_client_example_test.go +++ /dev/null @@ -1,75 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBCollectionPartitionGetMetrics.json -func ExampleCollectionPartitionClient_NewListMetricsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCollectionPartitionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListMetricsPager("rg1", - "ddb1", - "databaseRid", - "collectionRid", - "$filter=(name.value eq 'Max RUs Per Second') and timeGrain eq duration'PT1M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T23:58:55.2780000Z", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBCollectionPartitionGetUsages.json -func ExampleCollectionPartitionClient_NewListUsagesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCollectionPartitionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListUsagesPager("rg1", - "ddb1", - "databaseRid", - "collectionRid", - &armcosmos.CollectionPartitionClientListUsagesOptions{Filter: to.Ptr("$filter=name.value eq 'Partition Storage'")}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/collectionpartitionregion_client.go b/sdk/resourcemanager/cosmos/armcosmos/collectionpartitionregion_client.go index 8dd3ff770310..ebe827045c70 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/collectionpartitionregion_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/collectionpartitionregion_client.go @@ -58,7 +58,7 @@ func NewCollectionPartitionRegionClient(subscriptionID string, credential azcore // NewListMetricsPager - Retrieves the metrics determined by the given filter for the given collection and region, split by // partition. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // region - Cosmos DB region, with spaces between words and each word capitalized. @@ -123,7 +123,7 @@ func (client *CollectionPartitionRegionClient) listMetricsCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") reqQP.Set("$filter", filter) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/cosmos/armcosmos/collectionpartitionregion_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/collectionpartitionregion_client_example_test.go deleted file mode 100644 index f0d4b004bd6c..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/collectionpartitionregion_client_example_test.go +++ /dev/null @@ -1,47 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBCollectionPartitionRegionGetMetrics.json -func ExampleCollectionPartitionRegionClient_NewListMetricsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCollectionPartitionRegionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListMetricsPager("rg1", - "ddb1", - "North Europe", - "databaseRid", - "collectionRid", - "$filter=(name.value eq 'Max RUs Per Second') and timeGrain eq duration'PT1M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T23:58:55.2780000Z", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/collectionregion_client.go b/sdk/resourcemanager/cosmos/armcosmos/collectionregion_client.go index 4ea9ce72e648..c32301f71de0 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/collectionregion_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/collectionregion_client.go @@ -58,7 +58,7 @@ func NewCollectionRegionClient(subscriptionID string, credential azcore.TokenCre // NewListMetricsPager - Retrieves the metrics determined by the given filter for the given database account, collection and // region. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // region - Cosmos DB region, with spaces between words and each word capitalized. @@ -123,7 +123,7 @@ func (client *CollectionRegionClient) listMetricsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") reqQP.Set("$filter", filter) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/cosmos/armcosmos/collectionregion_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/collectionregion_client_example_test.go deleted file mode 100644 index dc50426c9802..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/collectionregion_client_example_test.go +++ /dev/null @@ -1,47 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBRegionCollectionGetMetrics.json -func ExampleCollectionRegionClient_NewListMetricsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewCollectionRegionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListMetricsPager("rg1", - "ddb1", - "North Europe", - "databaseRid", - "collectionRid", - "$filter=(name.value eq 'Total Requests') and timeGrain eq duration'PT5M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T00:13:55.2780000Z", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/constants.go b/sdk/resourcemanager/cosmos/armcosmos/constants.go index be1afab96387..465ed13ec03b 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/constants.go +++ b/sdk/resourcemanager/cosmos/armcosmos/constants.go @@ -11,7 +11,7 @@ package armcosmos const ( moduleName = "armcosmos" - moduleVersion = "v2.1.0-beta.1" + moduleVersion = "v2.1.0" ) // APIType - Enum to indicate the API type of the restorable database account. @@ -56,12 +56,11 @@ func PossibleAnalyticalStorageSchemaTypeValues() []AnalyticalStorageSchemaType { // AuthenticationMethod - Which authentication method Cassandra should use to authenticate clients. 'None' turns off authentication, // so should not be used except in emergencies. 'Cassandra' is the default password based -// authentication. The default is 'Cassandra'. 'Ldap' is in preview. +// authentication. The default is 'Cassandra'. type AuthenticationMethod string const ( AuthenticationMethodCassandra AuthenticationMethod = "Cassandra" - AuthenticationMethodLdap AuthenticationMethod = "Ldap" AuthenticationMethodNone AuthenticationMethod = "None" ) @@ -69,7 +68,6 @@ const ( func PossibleAuthenticationMethodValues() []AuthenticationMethod { return []AuthenticationMethod{ AuthenticationMethodCassandra, - AuthenticationMethodLdap, AuthenticationMethodNone, } } @@ -198,22 +196,6 @@ func PossibleConnectorOfferValues() []ConnectorOffer { } } -// ContinuousTier - Enum to indicate type of Continuous backup tier. -type ContinuousTier string - -const ( - ContinuousTierContinuous30Days ContinuousTier = "Continuous30Days" - ContinuousTierContinuous7Days ContinuousTier = "Continuous7Days" -) - -// PossibleContinuousTierValues returns the possible values for the ContinuousTier const type. -func PossibleContinuousTierValues() []ContinuousTier { - return []ContinuousTier{ - ContinuousTierContinuous30Days, - ContinuousTierContinuous7Days, - } -} - // CreateMode - Enum to indicate the mode of account creation. type CreateMode string @@ -250,23 +232,6 @@ func PossibleCreatedByTypeValues() []CreatedByType { } } -type DataTransferComponent string - -const ( - DataTransferComponentAzureBlobStorage DataTransferComponent = "AzureBlobStorage" - DataTransferComponentCosmosDBCassandra DataTransferComponent = "CosmosDBCassandra" - DataTransferComponentCosmosDBSQL DataTransferComponent = "CosmosDBSql" -) - -// PossibleDataTransferComponentValues returns the possible values for the DataTransferComponent const type. -func PossibleDataTransferComponentValues() []DataTransferComponent { - return []DataTransferComponent{ - DataTransferComponentAzureBlobStorage, - DataTransferComponentCosmosDBCassandra, - DataTransferComponentCosmosDBSQL, - } -} - // DataType - The datatype for which the indexing behavior is applied to. type DataType string @@ -331,24 +296,6 @@ func PossibleDefaultConsistencyLevelValues() []DefaultConsistencyLevel { } } -// EnableFullTextQuery - Describe the level of detail with which queries are to be logged. -type EnableFullTextQuery string - -const ( - EnableFullTextQueryNone EnableFullTextQuery = "None" - EnableFullTextQueryTrue EnableFullTextQuery = "True" - EnableFullTextQueryFalse EnableFullTextQuery = "False" -) - -// PossibleEnableFullTextQueryValues returns the possible values for the EnableFullTextQuery const type. -func PossibleEnableFullTextQueryValues() []EnableFullTextQuery { - return []EnableFullTextQuery{ - EnableFullTextQueryNone, - EnableFullTextQueryTrue, - EnableFullTextQueryFalse, - } -} - // IndexKind - Indicates the type of index. type IndexKind string @@ -761,24 +708,6 @@ func PossibleSpatialTypeValues() []SpatialType { } } -// ThroughputPolicyType - ThroughputPolicy to apply for throughput redistribution -type ThroughputPolicyType string - -const ( - ThroughputPolicyTypeCustom ThroughputPolicyType = "custom" - ThroughputPolicyTypeEqual ThroughputPolicyType = "equal" - ThroughputPolicyTypeNone ThroughputPolicyType = "none" -) - -// PossibleThroughputPolicyTypeValues returns the possible values for the ThroughputPolicyType const type. -func PossibleThroughputPolicyTypeValues() []ThroughputPolicyType { - return []ThroughputPolicyType{ - ThroughputPolicyTypeCustom, - ThroughputPolicyTypeEqual, - ThroughputPolicyTypeNone, - } -} - // TriggerOperation - The operation the trigger is associated with type TriggerOperation string diff --git a/sdk/resourcemanager/cosmos/armcosmos/database_client.go b/sdk/resourcemanager/cosmos/armcosmos/database_client.go index a68521986367..7126b2fc23c7 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/database_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/database_client.go @@ -57,7 +57,7 @@ func NewDatabaseClient(subscriptionID string, credential azcore.TokenCredential, // NewListMetricDefinitionsPager - Retrieves metric definitions for the given database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseRid - Cosmos DB database rid. @@ -109,7 +109,7 @@ func (client *DatabaseClient) listMetricDefinitionsCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -126,7 +126,7 @@ func (client *DatabaseClient) listMetricDefinitionsHandleResponse(resp *http.Res // NewListMetricsPager - Retrieves the metrics determined by the given filter for the given database account and database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseRid - Cosmos DB database rid. @@ -180,7 +180,7 @@ func (client *DatabaseClient) listMetricsCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") reqQP.Set("$filter", filter) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -198,7 +198,7 @@ func (client *DatabaseClient) listMetricsHandleResponse(resp *http.Response) (Da // NewListUsagesPager - Retrieves the usages (most recent data) for the given database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseRid - Cosmos DB database rid. @@ -249,7 +249,7 @@ func (client *DatabaseClient) listUsagesCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/cosmos/armcosmos/database_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/database_client_example_test.go deleted file mode 100644 index f227b0e135ae..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/database_client_example_test.go +++ /dev/null @@ -1,100 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBDatabaseGetMetrics.json -func ExampleDatabaseClient_NewListMetricsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewDatabaseClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListMetricsPager("rg1", - "ddb1", - "rid", - "$filter=(name.value eq 'Total Requests') and timeGrain eq duration'PT5M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T00:13:55.2780000Z", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBDatabaseGetUsages.json -func ExampleDatabaseClient_NewListUsagesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewDatabaseClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListUsagesPager("rg1", - "ddb1", - "databaseRid", - &armcosmos.DatabaseClientListUsagesOptions{Filter: to.Ptr("$filter=name.value eq 'Storage'")}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBDatabaseGetMetricDefinitions.json -func ExampleDatabaseClient_NewListMetricDefinitionsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewDatabaseClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListMetricDefinitionsPager("rg1", - "ddb1", - "databaseRid", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/databaseaccountregion_client.go b/sdk/resourcemanager/cosmos/armcosmos/databaseaccountregion_client.go index b3968d056ad5..c01bb6539be8 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/databaseaccountregion_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/databaseaccountregion_client.go @@ -57,7 +57,7 @@ func NewDatabaseAccountRegionClient(subscriptionID string, credential azcore.Tok // NewListMetricsPager - Retrieves the metrics determined by the given filter for the given database account and region. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // region - Cosmos DB region, with spaces between words and each word capitalized. @@ -112,7 +112,7 @@ func (client *DatabaseAccountRegionClient) listMetricsCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") reqQP.Set("$filter", filter) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/cosmos/armcosmos/databaseaccountregion_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/databaseaccountregion_client_example_test.go deleted file mode 100644 index 411b14df9a67..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/databaseaccountregion_client_example_test.go +++ /dev/null @@ -1,45 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBDatabaseAccountRegionGetMetrics.json -func ExampleDatabaseAccountRegionClient_NewListMetricsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewDatabaseAccountRegionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListMetricsPager("rg1", - "ddb1", - "North Europe", - "$filter=(name.value eq 'Total Requests') and timeGrain eq duration'PT5M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T00:13:55.2780000Z", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/databaseaccounts_client.go b/sdk/resourcemanager/cosmos/armcosmos/databaseaccounts_client.go index a0125fc9ff3b..d8a7e0189388 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/databaseaccounts_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/databaseaccounts_client.go @@ -57,7 +57,7 @@ func NewDatabaseAccountsClient(subscriptionID string, credential azcore.TokenCre // CheckNameExists - 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. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // accountName - Cosmos DB database account name. // options - DatabaseAccountsClientCheckNameExistsOptions contains the optional parameters for the DatabaseAccountsClient.CheckNameExists // method. @@ -88,7 +88,7 @@ func (client *DatabaseAccountsClient) checkNameExistsCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -96,7 +96,7 @@ func (client *DatabaseAccountsClient) checkNameExistsCreateRequest(ctx context.C // BeginCreateOrUpdate - Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing // updates on an account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // createUpdateParameters - The parameters to provide for the current database account. @@ -117,7 +117,7 @@ func (client *DatabaseAccountsClient) BeginCreateOrUpdate(ctx context.Context, r // CreateOrUpdate - Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing // updates on an account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *DatabaseAccountsClient) createOrUpdate(ctx context.Context, resourceGroupName string, accountName string, createUpdateParameters DatabaseAccountCreateUpdateParameters, options *DatabaseAccountsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, accountName, createUpdateParameters, options) if err != nil { @@ -153,7 +153,7 @@ func (client *DatabaseAccountsClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, createUpdateParameters) @@ -161,7 +161,7 @@ func (client *DatabaseAccountsClient) createOrUpdateCreateRequest(ctx context.Co // BeginDelete - Deletes an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // options - DatabaseAccountsClientBeginDeleteOptions contains the optional parameters for the DatabaseAccountsClient.BeginDelete @@ -180,7 +180,7 @@ func (client *DatabaseAccountsClient) BeginDelete(ctx context.Context, resourceG // Delete - Deletes an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *DatabaseAccountsClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, options *DatabaseAccountsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, options) if err != nil { @@ -216,7 +216,7 @@ func (client *DatabaseAccountsClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -225,7 +225,7 @@ func (client *DatabaseAccountsClient) deleteCreateRequest(ctx context.Context, r // 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. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // failoverParameters - The new failover policies for the database account. @@ -247,7 +247,7 @@ func (client *DatabaseAccountsClient) BeginFailoverPriorityChange(ctx context.Co // 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. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *DatabaseAccountsClient) failoverPriorityChange(ctx context.Context, resourceGroupName string, accountName string, failoverParameters FailoverPolicies, options *DatabaseAccountsClientBeginFailoverPriorityChangeOptions) (*http.Response, error) { req, err := client.failoverPriorityChangeCreateRequest(ctx, resourceGroupName, accountName, failoverParameters, options) if err != nil { @@ -283,14 +283,14 @@ func (client *DatabaseAccountsClient) failoverPriorityChangeCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() return req, runtime.MarshalAsJSON(req, failoverParameters) } // Get - Retrieves the properties of an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // options - DatabaseAccountsClientGetOptions contains the optional parameters for the DatabaseAccountsClient.Get method. @@ -329,7 +329,7 @@ func (client *DatabaseAccountsClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -346,7 +346,7 @@ func (client *DatabaseAccountsClient) getHandleResponse(resp *http.Response) (Da // GetReadOnlyKeys - Lists the read-only access keys for the specified Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // options - DatabaseAccountsClientGetReadOnlyKeysOptions contains the optional parameters for the DatabaseAccountsClient.GetReadOnlyKeys @@ -386,7 +386,7 @@ func (client *DatabaseAccountsClient) getReadOnlyKeysCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -403,7 +403,7 @@ func (client *DatabaseAccountsClient) getReadOnlyKeysHandleResponse(resp *http.R // NewListPager - Lists all the Azure Cosmos DB database accounts available under the subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // options - DatabaseAccountsClientListOptions contains the optional parameters for the DatabaseAccountsClient.List method. func (client *DatabaseAccountsClient) NewListPager(options *DatabaseAccountsClientListOptions) *runtime.Pager[DatabaseAccountsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[DatabaseAccountsClientListResponse]{ @@ -439,7 +439,7 @@ func (client *DatabaseAccountsClient) listCreateRequest(ctx context.Context, opt return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -456,7 +456,7 @@ func (client *DatabaseAccountsClient) listHandleResponse(resp *http.Response) (D // NewListByResourceGroupPager - Lists all the Azure Cosmos DB database accounts available under the given resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // options - DatabaseAccountsClientListByResourceGroupOptions contains the optional parameters for the DatabaseAccountsClient.ListByResourceGroup // method. @@ -498,7 +498,7 @@ func (client *DatabaseAccountsClient) listByResourceGroupCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -515,7 +515,7 @@ func (client *DatabaseAccountsClient) listByResourceGroupHandleResponse(resp *ht // ListConnectionStrings - Lists the connection strings for the specified Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // options - DatabaseAccountsClientListConnectionStringsOptions contains the optional parameters for the DatabaseAccountsClient.ListConnectionStrings @@ -555,7 +555,7 @@ func (client *DatabaseAccountsClient) listConnectionStringsCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -572,7 +572,7 @@ func (client *DatabaseAccountsClient) listConnectionStringsHandleResponse(resp * // ListKeys - Lists the access keys for the specified Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // options - DatabaseAccountsClientListKeysOptions contains the optional parameters for the DatabaseAccountsClient.ListKeys @@ -612,7 +612,7 @@ func (client *DatabaseAccountsClient) listKeysCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -629,7 +629,7 @@ func (client *DatabaseAccountsClient) listKeysHandleResponse(resp *http.Response // NewListMetricDefinitionsPager - Retrieves metric definitions for the given database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // options - DatabaseAccountsClientListMetricDefinitionsOptions contains the optional parameters for the DatabaseAccountsClient.ListMetricDefinitions @@ -676,7 +676,7 @@ func (client *DatabaseAccountsClient) listMetricDefinitionsCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -693,7 +693,7 @@ func (client *DatabaseAccountsClient) listMetricDefinitionsHandleResponse(resp * // NewListMetricsPager - Retrieves the metrics determined by the given filter for the given database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // filter - An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are @@ -743,7 +743,7 @@ func (client *DatabaseAccountsClient) listMetricsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") reqQP.Set("$filter", filter) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -761,7 +761,7 @@ func (client *DatabaseAccountsClient) listMetricsHandleResponse(resp *http.Respo // ListReadOnlyKeys - Lists the read-only access keys for the specified Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // options - DatabaseAccountsClientListReadOnlyKeysOptions contains the optional parameters for the DatabaseAccountsClient.ListReadOnlyKeys @@ -801,7 +801,7 @@ func (client *DatabaseAccountsClient) listReadOnlyKeysCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -818,7 +818,7 @@ func (client *DatabaseAccountsClient) listReadOnlyKeysHandleResponse(resp *http. // NewListUsagesPager - Retrieves the usages (most recent data) for the given database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // options - DatabaseAccountsClientListUsagesOptions contains the optional parameters for the DatabaseAccountsClient.ListUsages @@ -865,7 +865,7 @@ func (client *DatabaseAccountsClient) listUsagesCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -885,7 +885,7 @@ func (client *DatabaseAccountsClient) listUsagesHandleResponse(resp *http.Respon // BeginOfflineRegion - Offline the specified region for the specified Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // regionParameterForOffline - Cosmos DB region to offline for the database account. @@ -905,7 +905,7 @@ func (client *DatabaseAccountsClient) BeginOfflineRegion(ctx context.Context, re // OfflineRegion - Offline the specified region for the specified Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *DatabaseAccountsClient) offlineRegion(ctx context.Context, resourceGroupName string, accountName string, regionParameterForOffline RegionForOnlineOffline, options *DatabaseAccountsClientBeginOfflineRegionOptions) (*http.Response, error) { req, err := client.offlineRegionCreateRequest(ctx, resourceGroupName, accountName, regionParameterForOffline, options) if err != nil { @@ -941,7 +941,7 @@ func (client *DatabaseAccountsClient) offlineRegionCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, regionParameterForOffline) @@ -949,7 +949,7 @@ func (client *DatabaseAccountsClient) offlineRegionCreateRequest(ctx context.Con // BeginOnlineRegion - Online the specified region for the specified Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // regionParameterForOnline - Cosmos DB region to online for the database account. @@ -969,7 +969,7 @@ func (client *DatabaseAccountsClient) BeginOnlineRegion(ctx context.Context, res // OnlineRegion - Online the specified region for the specified Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *DatabaseAccountsClient) onlineRegion(ctx context.Context, resourceGroupName string, accountName string, regionParameterForOnline RegionForOnlineOffline, options *DatabaseAccountsClientBeginOnlineRegionOptions) (*http.Response, error) { req, err := client.onlineRegionCreateRequest(ctx, resourceGroupName, accountName, regionParameterForOnline, options) if err != nil { @@ -1005,7 +1005,7 @@ func (client *DatabaseAccountsClient) onlineRegionCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, regionParameterForOnline) @@ -1013,7 +1013,7 @@ func (client *DatabaseAccountsClient) onlineRegionCreateRequest(ctx context.Cont // BeginRegenerateKey - Regenerates an access key for the specified Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // keyToRegenerate - The name of the key to regenerate. @@ -1033,7 +1033,7 @@ func (client *DatabaseAccountsClient) BeginRegenerateKey(ctx context.Context, re // RegenerateKey - Regenerates an access key for the specified Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *DatabaseAccountsClient) regenerateKey(ctx context.Context, resourceGroupName string, accountName string, keyToRegenerate DatabaseAccountRegenerateKeyParameters, options *DatabaseAccountsClientBeginRegenerateKeyOptions) (*http.Response, error) { req, err := client.regenerateKeyCreateRequest(ctx, resourceGroupName, accountName, keyToRegenerate, options) if err != nil { @@ -1069,14 +1069,14 @@ func (client *DatabaseAccountsClient) regenerateKeyCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() return req, runtime.MarshalAsJSON(req, keyToRegenerate) } // BeginUpdate - Updates the properties of an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // updateParameters - The parameters to provide for the current database account. @@ -1096,7 +1096,7 @@ func (client *DatabaseAccountsClient) BeginUpdate(ctx context.Context, resourceG // Update - Updates the properties of an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *DatabaseAccountsClient) update(ctx context.Context, resourceGroupName string, accountName string, updateParameters DatabaseAccountUpdateParameters, options *DatabaseAccountsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, updateParameters, options) if err != nil { @@ -1132,7 +1132,7 @@ func (client *DatabaseAccountsClient) updateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, updateParameters) diff --git a/sdk/resourcemanager/cosmos/armcosmos/databaseaccounts_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/databaseaccounts_client_example_test.go deleted file mode 100644 index 79fe7eb0ecab..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/databaseaccounts_client_example_test.go +++ /dev/null @@ -1,592 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBDatabaseAccountGet.json -func ExampleDatabaseAccountsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewDatabaseAccountsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "ddb1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBDatabaseAccountPatch.json -func ExampleDatabaseAccountsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewDatabaseAccountsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "rg1", - "ddb1", - armcosmos.DatabaseAccountUpdateParameters{ - Identity: &armcosmos.ManagedServiceIdentity{ - Type: to.Ptr(armcosmos.ResourceIdentityTypeSystemAssignedUserAssigned), - UserAssignedIdentities: map[string]*armcosmos.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - "/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/eu2cgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {}, - }, - }, - Location: to.Ptr("westus"), - Properties: &armcosmos.DatabaseAccountUpdateProperties{ - AnalyticalStorageConfiguration: &armcosmos.AnalyticalStorageConfiguration{ - SchemaType: to.Ptr(armcosmos.AnalyticalStorageSchemaTypeWellDefined), - }, - BackupPolicy: &armcosmos.PeriodicModeBackupPolicy{ - Type: to.Ptr(armcosmos.BackupPolicyTypePeriodic), - PeriodicModeProperties: &armcosmos.PeriodicModeProperties{ - BackupIntervalInMinutes: to.Ptr[int32](240), - BackupRetentionIntervalInHours: to.Ptr[int32](720), - BackupStorageRedundancy: to.Ptr(armcosmos.BackupStorageRedundancyGeo), - }, - }, - Capacity: &armcosmos.Capacity{ - TotalThroughputLimit: to.Ptr[int32](2000), - }, - ConsistencyPolicy: &armcosmos.ConsistencyPolicy{ - DefaultConsistencyLevel: to.Ptr(armcosmos.DefaultConsistencyLevelBoundedStaleness), - MaxIntervalInSeconds: to.Ptr[int32](10), - MaxStalenessPrefix: to.Ptr[int64](200), - }, - DefaultIdentity: to.Ptr("FirstPartyIdentity"), - DiagnosticLogSettings: &armcosmos.DiagnosticLogSettings{ - EnableFullTextQuery: to.Ptr(armcosmos.EnableFullTextQueryTrue), - }, - EnableAnalyticalStorage: to.Ptr(true), - EnableFreeTier: to.Ptr(false), - IPRules: []*armcosmos.IPAddressOrRange{ - { - IPAddressOrRange: to.Ptr("23.43.230.120"), - }, - { - IPAddressOrRange: to.Ptr("110.12.240.0/12"), - }}, - IsVirtualNetworkFilterEnabled: to.Ptr(true), - NetworkACLBypass: to.Ptr(armcosmos.NetworkACLBypassAzureServices), - NetworkACLBypassResourceIDs: []*string{ - to.Ptr("/subscriptions/subId/resourcegroups/rgName/providers/Microsoft.Synapse/workspaces/workspaceName")}, - VirtualNetworkRules: []*armcosmos.VirtualNetworkRule{ - { - ID: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - IgnoreMissingVNetServiceEndpoint: to.Ptr(false), - }}, - }, - Tags: map[string]*string{ - "dept": to.Ptr("finance"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBDatabaseAccountCreateMax.json -func ExampleDatabaseAccountsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewDatabaseAccountsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "rg1", - "ddb1", - armcosmos.DatabaseAccountCreateUpdateParameters{ - Identity: &armcosmos.ManagedServiceIdentity{ - Type: to.Ptr(armcosmos.ResourceIdentityTypeSystemAssignedUserAssigned), - UserAssignedIdentities: map[string]*armcosmos.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ - "/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/eu2cgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {}, - }, - }, - Location: to.Ptr("westus"), - Tags: map[string]*string{}, - Kind: to.Ptr(armcosmos.DatabaseAccountKindMongoDB), - Properties: &armcosmos.DatabaseAccountCreateUpdateProperties{ - AnalyticalStorageConfiguration: &armcosmos.AnalyticalStorageConfiguration{ - SchemaType: to.Ptr(armcosmos.AnalyticalStorageSchemaTypeWellDefined), - }, - APIProperties: &armcosmos.APIProperties{ - ServerVersion: to.Ptr(armcosmos.ServerVersionThree2), - }, - BackupPolicy: &armcosmos.PeriodicModeBackupPolicy{ - Type: to.Ptr(armcosmos.BackupPolicyTypePeriodic), - PeriodicModeProperties: &armcosmos.PeriodicModeProperties{ - BackupIntervalInMinutes: to.Ptr[int32](240), - BackupRetentionIntervalInHours: to.Ptr[int32](8), - BackupStorageRedundancy: to.Ptr(armcosmos.BackupStorageRedundancyGeo), - }, - }, - Capacity: &armcosmos.Capacity{ - TotalThroughputLimit: to.Ptr[int32](2000), - }, - ConsistencyPolicy: &armcosmos.ConsistencyPolicy{ - DefaultConsistencyLevel: to.Ptr(armcosmos.DefaultConsistencyLevelBoundedStaleness), - MaxIntervalInSeconds: to.Ptr[int32](10), - MaxStalenessPrefix: to.Ptr[int64](200), - }, - Cors: []*armcosmos.CorsPolicy{ - { - AllowedOrigins: to.Ptr("https://test"), - }}, - CreateMode: to.Ptr(armcosmos.CreateModeDefault), - DatabaseAccountOfferType: to.Ptr("Standard"), - DefaultIdentity: to.Ptr("FirstPartyIdentity"), - EnableAnalyticalStorage: to.Ptr(true), - EnableFreeTier: to.Ptr(false), - EnableMaterializedViews: to.Ptr(false), - IPRules: []*armcosmos.IPAddressOrRange{ - { - IPAddressOrRange: to.Ptr("23.43.230.120"), - }, - { - IPAddressOrRange: to.Ptr("110.12.240.0/12"), - }}, - IsVirtualNetworkFilterEnabled: to.Ptr(true), - KeyVaultKeyURI: to.Ptr("https://myKeyVault.vault.azure.net"), - Locations: []*armcosmos.Location{ - { - FailoverPriority: to.Ptr[int32](0), - IsZoneRedundant: to.Ptr(false), - LocationName: to.Ptr("southcentralus"), - }, - { - FailoverPriority: to.Ptr[int32](1), - IsZoneRedundant: to.Ptr(false), - LocationName: to.Ptr("eastus"), - }}, - NetworkACLBypass: to.Ptr(armcosmos.NetworkACLBypassAzureServices), - NetworkACLBypassResourceIDs: []*string{ - to.Ptr("/subscriptions/subId/resourcegroups/rgName/providers/Microsoft.Synapse/workspaces/workspaceName")}, - PublicNetworkAccess: to.Ptr(armcosmos.PublicNetworkAccessEnabled), - VirtualNetworkRules: []*armcosmos.VirtualNetworkRule{ - { - ID: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - IgnoreMissingVNetServiceEndpoint: to.Ptr(false), - }}, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBDatabaseAccountDelete.json -func ExampleDatabaseAccountsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewDatabaseAccountsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "rg1", - "ddb1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBDatabaseAccountFailoverPriorityChange.json -func ExampleDatabaseAccountsClient_BeginFailoverPriorityChange() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewDatabaseAccountsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginFailoverPriorityChange(ctx, - "rg1", - "ddb1-failover", - armcosmos.FailoverPolicies{ - FailoverPolicies: []*armcosmos.FailoverPolicy{ - { - FailoverPriority: to.Ptr[int32](0), - LocationName: to.Ptr("eastus"), - }, - { - FailoverPriority: to.Ptr[int32](1), - LocationName: to.Ptr("westus"), - }}, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBDatabaseAccountList.json -func ExampleDatabaseAccountsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewDatabaseAccountsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBDatabaseAccountListByResourceGroup.json -func ExampleDatabaseAccountsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewDatabaseAccountsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("rg1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBDatabaseAccountListKeys.json -func ExampleDatabaseAccountsClient_ListKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewDatabaseAccountsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListKeys(ctx, - "rg1", - "ddb1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBDatabaseAccountListConnectionStrings.json -func ExampleDatabaseAccountsClient_ListConnectionStrings() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewDatabaseAccountsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListConnectionStrings(ctx, - "rg1", - "ddb1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBDatabaseAccountOfflineRegion.json -func ExampleDatabaseAccountsClient_BeginOfflineRegion() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewDatabaseAccountsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginOfflineRegion(ctx, - "rg1", - "ddb1", - armcosmos.RegionForOnlineOffline{}, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBDatabaseAccountOnlineRegion.json -func ExampleDatabaseAccountsClient_BeginOnlineRegion() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewDatabaseAccountsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginOnlineRegion(ctx, - "rg1", - "ddb1", - armcosmos.RegionForOnlineOffline{}, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json -func ExampleDatabaseAccountsClient_GetReadOnlyKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewDatabaseAccountsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetReadOnlyKeys(ctx, - "rg1", - "ddb1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json -func ExampleDatabaseAccountsClient_ListReadOnlyKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewDatabaseAccountsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListReadOnlyKeys(ctx, - "rg1", - "ddb1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBDatabaseAccountRegenerateKey.json -func ExampleDatabaseAccountsClient_BeginRegenerateKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewDatabaseAccountsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRegenerateKey(ctx, - "rg1", - "ddb1", - armcosmos.DatabaseAccountRegenerateKeyParameters{ - KeyKind: to.Ptr(armcosmos.KeyKindPrimary), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBDatabaseAccountCheckNameExists.json -func ExampleDatabaseAccountsClient_CheckNameExists() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewDatabaseAccountsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.CheckNameExists(ctx, - "ddb1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBDatabaseAccountGetMetrics.json -func ExampleDatabaseAccountsClient_NewListMetricsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewDatabaseAccountsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListMetricsPager("rg1", - "ddb1", - "$filter=(name.value eq 'Total Requests') and timeGrain eq duration'PT5M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T00:13:55.2780000Z", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBDatabaseAccountGetUsages.json -func ExampleDatabaseAccountsClient_NewListUsagesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewDatabaseAccountsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListUsagesPager("rg1", - "ddb1", - &armcosmos.DatabaseAccountsClientListUsagesOptions{Filter: to.Ptr("$filter=name.value eq 'Storage'")}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBDatabaseAccountGetMetricDefinitions.json -func ExampleDatabaseAccountsClient_NewListMetricDefinitionsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewDatabaseAccountsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListMetricDefinitionsPager("rg1", - "ddb1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/datatransferjobs_client.go b/sdk/resourcemanager/cosmos/armcosmos/datatransferjobs_client.go deleted file mode 100644 index 9daa012674ec..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/datatransferjobs_client.go +++ /dev/null @@ -1,431 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armcosmos - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// DataTransferJobsClient contains the methods for the DataTransferJobs group. -// Don't use this type directly, use NewDataTransferJobsClient() instead. -type DataTransferJobsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewDataTransferJobsClient creates a new instance of DataTransferJobsClient with the specified values. -// subscriptionID - The ID of the target subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewDataTransferJobsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DataTransferJobsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &DataTransferJobsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// Cancel - Cancels a Data Transfer Job. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// accountName - Cosmos DB database account name. -// jobName - Name of the Data Transfer Job -// options - DataTransferJobsClientCancelOptions contains the optional parameters for the DataTransferJobsClient.Cancel method. -func (client *DataTransferJobsClient) Cancel(ctx context.Context, resourceGroupName string, accountName string, jobName string, options *DataTransferJobsClientCancelOptions) (DataTransferJobsClientCancelResponse, error) { - req, err := client.cancelCreateRequest(ctx, resourceGroupName, accountName, jobName, options) - if err != nil { - return DataTransferJobsClientCancelResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DataTransferJobsClientCancelResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DataTransferJobsClientCancelResponse{}, runtime.NewResponseError(resp) - } - return client.cancelHandleResponse(resp) -} - -// cancelCreateRequest creates the Cancel request. -func (client *DataTransferJobsClient) cancelCreateRequest(ctx context.Context, resourceGroupName string, accountName string, jobName string, options *DataTransferJobsClientCancelOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/cancel" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - if jobName == "" { - return nil, errors.New("parameter jobName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{jobName}", url.PathEscape(jobName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// cancelHandleResponse handles the Cancel response. -func (client *DataTransferJobsClient) cancelHandleResponse(resp *http.Response) (DataTransferJobsClientCancelResponse, error) { - result := DataTransferJobsClientCancelResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DataTransferJobGetResults); err != nil { - return DataTransferJobsClientCancelResponse{}, err - } - return result, nil -} - -// Create - Creates a Data Transfer Job. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// accountName - Cosmos DB database account name. -// jobName - Name of the Data Transfer Job -// options - DataTransferJobsClientCreateOptions contains the optional parameters for the DataTransferJobsClient.Create method. -func (client *DataTransferJobsClient) Create(ctx context.Context, resourceGroupName string, accountName string, jobName string, jobCreateParameters CreateJobRequest, options *DataTransferJobsClientCreateOptions) (DataTransferJobsClientCreateResponse, error) { - req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, jobName, jobCreateParameters, options) - if err != nil { - return DataTransferJobsClientCreateResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DataTransferJobsClientCreateResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DataTransferJobsClientCreateResponse{}, runtime.NewResponseError(resp) - } - return client.createHandleResponse(resp) -} - -// createCreateRequest creates the Create request. -func (client *DataTransferJobsClient) createCreateRequest(ctx context.Context, resourceGroupName string, accountName string, jobName string, jobCreateParameters CreateJobRequest, options *DataTransferJobsClientCreateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - if jobName == "" { - return nil, errors.New("parameter jobName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{jobName}", url.PathEscape(jobName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, jobCreateParameters) -} - -// createHandleResponse handles the Create response. -func (client *DataTransferJobsClient) createHandleResponse(resp *http.Response) (DataTransferJobsClientCreateResponse, error) { - result := DataTransferJobsClientCreateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DataTransferJobGetResults); err != nil { - return DataTransferJobsClientCreateResponse{}, err - } - return result, nil -} - -// Get - Get a Data Transfer Job. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// accountName - Cosmos DB database account name. -// jobName - Name of the Data Transfer Job -// options - DataTransferJobsClientGetOptions contains the optional parameters for the DataTransferJobsClient.Get method. -func (client *DataTransferJobsClient) Get(ctx context.Context, resourceGroupName string, accountName string, jobName string, options *DataTransferJobsClientGetOptions) (DataTransferJobsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, jobName, options) - if err != nil { - return DataTransferJobsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DataTransferJobsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DataTransferJobsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *DataTransferJobsClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, jobName string, options *DataTransferJobsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - if jobName == "" { - return nil, errors.New("parameter jobName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{jobName}", url.PathEscape(jobName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *DataTransferJobsClient) getHandleResponse(resp *http.Response) (DataTransferJobsClientGetResponse, error) { - result := DataTransferJobsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DataTransferJobGetResults); err != nil { - return DataTransferJobsClientGetResponse{}, err - } - return result, nil -} - -// NewListByDatabaseAccountPager - Get a list of Data Transfer jobs. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// accountName - Cosmos DB database account name. -// options - DataTransferJobsClientListByDatabaseAccountOptions contains the optional parameters for the DataTransferJobsClient.ListByDatabaseAccount -// method. -func (client *DataTransferJobsClient) NewListByDatabaseAccountPager(resourceGroupName string, accountName string, options *DataTransferJobsClientListByDatabaseAccountOptions) *runtime.Pager[DataTransferJobsClientListByDatabaseAccountResponse] { - return runtime.NewPager(runtime.PagingHandler[DataTransferJobsClientListByDatabaseAccountResponse]{ - More: func(page DataTransferJobsClientListByDatabaseAccountResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DataTransferJobsClientListByDatabaseAccountResponse) (DataTransferJobsClientListByDatabaseAccountResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByDatabaseAccountCreateRequest(ctx, resourceGroupName, accountName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return DataTransferJobsClientListByDatabaseAccountResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DataTransferJobsClientListByDatabaseAccountResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DataTransferJobsClientListByDatabaseAccountResponse{}, runtime.NewResponseError(resp) - } - return client.listByDatabaseAccountHandleResponse(resp) - }, - }) -} - -// listByDatabaseAccountCreateRequest creates the ListByDatabaseAccount request. -func (client *DataTransferJobsClient) listByDatabaseAccountCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *DataTransferJobsClientListByDatabaseAccountOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByDatabaseAccountHandleResponse handles the ListByDatabaseAccount response. -func (client *DataTransferJobsClient) listByDatabaseAccountHandleResponse(resp *http.Response) (DataTransferJobsClientListByDatabaseAccountResponse, error) { - result := DataTransferJobsClientListByDatabaseAccountResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DataTransferJobFeedResults); err != nil { - return DataTransferJobsClientListByDatabaseAccountResponse{}, err - } - return result, nil -} - -// Pause - Pause a Data Transfer Job. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// accountName - Cosmos DB database account name. -// jobName - Name of the Data Transfer Job -// options - DataTransferJobsClientPauseOptions contains the optional parameters for the DataTransferJobsClient.Pause method. -func (client *DataTransferJobsClient) Pause(ctx context.Context, resourceGroupName string, accountName string, jobName string, options *DataTransferJobsClientPauseOptions) (DataTransferJobsClientPauseResponse, error) { - req, err := client.pauseCreateRequest(ctx, resourceGroupName, accountName, jobName, options) - if err != nil { - return DataTransferJobsClientPauseResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DataTransferJobsClientPauseResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DataTransferJobsClientPauseResponse{}, runtime.NewResponseError(resp) - } - return client.pauseHandleResponse(resp) -} - -// pauseCreateRequest creates the Pause request. -func (client *DataTransferJobsClient) pauseCreateRequest(ctx context.Context, resourceGroupName string, accountName string, jobName string, options *DataTransferJobsClientPauseOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/pause" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - if jobName == "" { - return nil, errors.New("parameter jobName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{jobName}", url.PathEscape(jobName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// pauseHandleResponse handles the Pause response. -func (client *DataTransferJobsClient) pauseHandleResponse(resp *http.Response) (DataTransferJobsClientPauseResponse, error) { - result := DataTransferJobsClientPauseResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DataTransferJobGetResults); err != nil { - return DataTransferJobsClientPauseResponse{}, err - } - return result, nil -} - -// Resume - Resumes a Data Transfer Job. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// accountName - Cosmos DB database account name. -// jobName - Name of the Data Transfer Job -// options - DataTransferJobsClientResumeOptions contains the optional parameters for the DataTransferJobsClient.Resume method. -func (client *DataTransferJobsClient) Resume(ctx context.Context, resourceGroupName string, accountName string, jobName string, options *DataTransferJobsClientResumeOptions) (DataTransferJobsClientResumeResponse, error) { - req, err := client.resumeCreateRequest(ctx, resourceGroupName, accountName, jobName, options) - if err != nil { - return DataTransferJobsClientResumeResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DataTransferJobsClientResumeResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DataTransferJobsClientResumeResponse{}, runtime.NewResponseError(resp) - } - return client.resumeHandleResponse(resp) -} - -// resumeCreateRequest creates the Resume request. -func (client *DataTransferJobsClient) resumeCreateRequest(ctx context.Context, resourceGroupName string, accountName string, jobName string, options *DataTransferJobsClientResumeOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/resume" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - if jobName == "" { - return nil, errors.New("parameter jobName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{jobName}", url.PathEscape(jobName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// resumeHandleResponse handles the Resume response. -func (client *DataTransferJobsClient) resumeHandleResponse(resp *http.Response) (DataTransferJobsClientResumeResponse, error) { - result := DataTransferJobsClientResumeResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DataTransferJobGetResults); err != nil { - return DataTransferJobsClientResumeResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/datatransferjobs_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/datatransferjobs_client_example_test.go deleted file mode 100644 index 7e15e758c8e6..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/datatransferjobs_client_example_test.go +++ /dev/null @@ -1,173 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobCreate.json -func ExampleDataTransferJobsClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewDataTransferJobsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, - "rg1", - "ddb1", - "j1", - armcosmos.CreateJobRequest{ - Properties: &armcosmos.DataTransferJobProperties{ - Destination: &armcosmos.AzureBlobDataTransferDataSourceSink{ - Component: to.Ptr(armcosmos.DataTransferComponentAzureBlobStorage), - ContainerName: to.Ptr("blob_container"), - EndpointURL: to.Ptr("https://blob.windows.net"), - }, - Source: &armcosmos.CassandraDataTransferDataSourceSink{ - Component: to.Ptr(armcosmos.DataTransferComponentCosmosDBCassandra), - KeyspaceName: to.Ptr("keyspace"), - TableName: to.Ptr("table"), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobGet.json -func ExampleDataTransferJobsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewDataTransferJobsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "ddb1", - "j1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobPause.json -func ExampleDataTransferJobsClient_Pause() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewDataTransferJobsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Pause(ctx, - "rg1", - "ddb1", - "j1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobResume.json -func ExampleDataTransferJobsClient_Resume() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewDataTransferJobsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Resume(ctx, - "rg1", - "ddb1", - "j1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobCancel.json -func ExampleDataTransferJobsClient_Cancel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewDataTransferJobsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Cancel(ctx, - "rg1", - "ddb1", - "j1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobFeed.json -func ExampleDataTransferJobsClient_NewListByDatabaseAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewDataTransferJobsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabaseAccountPager("rg1", - "ddb1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/go.mod b/sdk/resourcemanager/cosmos/armcosmos/go.mod index fd85aa0e3c08..9af9d72d0a7d 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/go.mod +++ b/sdk/resourcemanager/cosmos/armcosmos/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2 go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1 // indirect - github.com/golang-jwt/jwt v3.2.1+incompatible // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/cosmos/armcosmos/go.sum b/sdk/resourcemanager/cosmos/armcosmos/go.sum index 8828b17b1853..3afb578030a5 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/go.sum +++ b/sdk/resourcemanager/cosmos/armcosmos/go.sum @@ -1,33 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 h1:QkAcEIAKbNL4KoFr4SathZPhDhF4mVwpBMFlYjyAqy8= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0/go.mod h1:bhXu1AjYL+wutSL/kpSq6s7733q2Rb0yuot9Zgfqa/0= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1 h1:BWe8a+f/t+7KY7zH2mqygeUD0t8hNFXe08p1Pb3/jKE= -github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/cosmos/armcosmos/graphresources_client.go b/sdk/resourcemanager/cosmos/armcosmos/graphresources_client.go deleted file mode 100644 index c7782b3e4bff..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/graphresources_client.go +++ /dev/null @@ -1,317 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armcosmos - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// GraphResourcesClient contains the methods for the GraphResources group. -// Don't use this type directly, use NewGraphResourcesClient() instead. -type GraphResourcesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewGraphResourcesClient creates a new instance of GraphResourcesClient with the specified values. -// subscriptionID - The ID of the target subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewGraphResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GraphResourcesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &GraphResourcesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateUpdateGraph - Create or update an Azure Cosmos DB Graph. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// accountName - Cosmos DB database account name. -// graphName - Cosmos DB graph resource name. -// createUpdateGraphParameters - The parameters to provide for the current graph. -// options - GraphResourcesClientBeginCreateUpdateGraphOptions contains the optional parameters for the GraphResourcesClient.BeginCreateUpdateGraph -// method. -func (client *GraphResourcesClient) BeginCreateUpdateGraph(ctx context.Context, resourceGroupName string, accountName string, graphName string, createUpdateGraphParameters GraphResourceCreateUpdateParameters, options *GraphResourcesClientBeginCreateUpdateGraphOptions) (*runtime.Poller[GraphResourcesClientCreateUpdateGraphResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createUpdateGraph(ctx, resourceGroupName, accountName, graphName, createUpdateGraphParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[GraphResourcesClientCreateUpdateGraphResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[GraphResourcesClientCreateUpdateGraphResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateUpdateGraph - Create or update an Azure Cosmos DB Graph. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -func (client *GraphResourcesClient) createUpdateGraph(ctx context.Context, resourceGroupName string, accountName string, graphName string, createUpdateGraphParameters GraphResourceCreateUpdateParameters, options *GraphResourcesClientBeginCreateUpdateGraphOptions) (*http.Response, error) { - req, err := client.createUpdateGraphCreateRequest(ctx, resourceGroupName, accountName, graphName, createUpdateGraphParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createUpdateGraphCreateRequest creates the CreateUpdateGraph request. -func (client *GraphResourcesClient) createUpdateGraphCreateRequest(ctx context.Context, resourceGroupName string, accountName string, graphName string, createUpdateGraphParameters GraphResourceCreateUpdateParameters, options *GraphResourcesClientBeginCreateUpdateGraphOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - if graphName == "" { - return nil, errors.New("parameter graphName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{graphName}", url.PathEscape(graphName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, createUpdateGraphParameters) -} - -// BeginDeleteGraphResource - Deletes an existing Azure Cosmos DB Graph Resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// accountName - Cosmos DB database account name. -// graphName - Cosmos DB graph resource name. -// options - GraphResourcesClientBeginDeleteGraphResourceOptions contains the optional parameters for the GraphResourcesClient.BeginDeleteGraphResource -// method. -func (client *GraphResourcesClient) BeginDeleteGraphResource(ctx context.Context, resourceGroupName string, accountName string, graphName string, options *GraphResourcesClientBeginDeleteGraphResourceOptions) (*runtime.Poller[GraphResourcesClientDeleteGraphResourceResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteGraphResource(ctx, resourceGroupName, accountName, graphName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[GraphResourcesClientDeleteGraphResourceResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[GraphResourcesClientDeleteGraphResourceResponse](options.ResumeToken, client.pl, nil) - } -} - -// DeleteGraphResource - Deletes an existing Azure Cosmos DB Graph Resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -func (client *GraphResourcesClient) deleteGraphResource(ctx context.Context, resourceGroupName string, accountName string, graphName string, options *GraphResourcesClientBeginDeleteGraphResourceOptions) (*http.Response, error) { - req, err := client.deleteGraphResourceCreateRequest(ctx, resourceGroupName, accountName, graphName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteGraphResourceCreateRequest creates the DeleteGraphResource request. -func (client *GraphResourcesClient) deleteGraphResourceCreateRequest(ctx context.Context, resourceGroupName string, accountName string, graphName string, options *GraphResourcesClientBeginDeleteGraphResourceOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - if graphName == "" { - return nil, errors.New("parameter graphName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{graphName}", url.PathEscape(graphName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - return req, nil -} - -// GetGraph - Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// accountName - Cosmos DB database account name. -// graphName - Cosmos DB graph resource name. -// options - GraphResourcesClientGetGraphOptions contains the optional parameters for the GraphResourcesClient.GetGraph method. -func (client *GraphResourcesClient) GetGraph(ctx context.Context, resourceGroupName string, accountName string, graphName string, options *GraphResourcesClientGetGraphOptions) (GraphResourcesClientGetGraphResponse, error) { - req, err := client.getGraphCreateRequest(ctx, resourceGroupName, accountName, graphName, options) - if err != nil { - return GraphResourcesClientGetGraphResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return GraphResourcesClientGetGraphResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GraphResourcesClientGetGraphResponse{}, runtime.NewResponseError(resp) - } - return client.getGraphHandleResponse(resp) -} - -// getGraphCreateRequest creates the GetGraph request. -func (client *GraphResourcesClient) getGraphCreateRequest(ctx context.Context, resourceGroupName string, accountName string, graphName string, options *GraphResourcesClientGetGraphOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - if graphName == "" { - return nil, errors.New("parameter graphName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{graphName}", url.PathEscape(graphName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getGraphHandleResponse handles the GetGraph response. -func (client *GraphResourcesClient) getGraphHandleResponse(resp *http.Response) (GraphResourcesClientGetGraphResponse, error) { - result := GraphResourcesClientGetGraphResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GraphResourceGetResults); err != nil { - return GraphResourcesClientGetGraphResponse{}, err - } - return result, nil -} - -// NewListGraphsPager - Lists the graphs under an existing Azure Cosmos DB database account. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// accountName - Cosmos DB database account name. -// options - GraphResourcesClientListGraphsOptions contains the optional parameters for the GraphResourcesClient.ListGraphs -// method. -func (client *GraphResourcesClient) NewListGraphsPager(resourceGroupName string, accountName string, options *GraphResourcesClientListGraphsOptions) *runtime.Pager[GraphResourcesClientListGraphsResponse] { - return runtime.NewPager(runtime.PagingHandler[GraphResourcesClientListGraphsResponse]{ - More: func(page GraphResourcesClientListGraphsResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *GraphResourcesClientListGraphsResponse) (GraphResourcesClientListGraphsResponse, error) { - req, err := client.listGraphsCreateRequest(ctx, resourceGroupName, accountName, options) - if err != nil { - return GraphResourcesClientListGraphsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return GraphResourcesClientListGraphsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GraphResourcesClientListGraphsResponse{}, runtime.NewResponseError(resp) - } - return client.listGraphsHandleResponse(resp) - }, - }) -} - -// listGraphsCreateRequest creates the ListGraphs request. -func (client *GraphResourcesClient) listGraphsCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *GraphResourcesClientListGraphsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listGraphsHandleResponse handles the ListGraphs response. -func (client *GraphResourcesClient) listGraphsHandleResponse(resp *http.Response) (GraphResourcesClientListGraphsResponse, error) { - result := GraphResourcesClientListGraphsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GraphResourcesListResult); err != nil { - return GraphResourcesClientListGraphsResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/graphresources_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/graphresources_client_example_test.go deleted file mode 100644 index c23d01429313..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/graphresources_client_example_test.go +++ /dev/null @@ -1,129 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBGraphResourceList.json -func ExampleGraphResourcesClient_NewListGraphsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewGraphResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListGraphsPager("rgName", - "ddb1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBGraphResourceGet.json -func ExampleGraphResourcesClient_GetGraph() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewGraphResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetGraph(ctx, - "rg1", - "ddb1", - "graphName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBGraphResourceCreateUpdate.json -func ExampleGraphResourcesClient_BeginCreateUpdateGraph() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewGraphResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateUpdateGraph(ctx, - "rg1", - "ddb1", - "graphName", - armcosmos.GraphResourceCreateUpdateParameters{ - Location: to.Ptr("West US"), - Tags: map[string]*string{}, - Properties: &armcosmos.GraphResourceCreateUpdateProperties{ - Options: &armcosmos.CreateUpdateOptions{}, - Resource: &armcosmos.GraphResource{ - ID: to.Ptr("graphName"), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBGraphResourceDelete.json -func ExampleGraphResourcesClient_BeginDeleteGraphResource() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewGraphResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDeleteGraphResource(ctx, - "rg1", - "ddb1", - "graphName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/gremlinresources_client.go b/sdk/resourcemanager/cosmos/armcosmos/gremlinresources_client.go index a759f4263acf..8ac79287b277 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/gremlinresources_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/gremlinresources_client.go @@ -57,7 +57,7 @@ func NewGremlinResourcesClient(subscriptionID string, credential azcore.TokenCre // BeginCreateUpdateGremlinDatabase - Create or update an Azure Cosmos DB Gremlin database // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -78,7 +78,7 @@ func (client *GremlinResourcesClient) BeginCreateUpdateGremlinDatabase(ctx conte // CreateUpdateGremlinDatabase - Create or update an Azure Cosmos DB Gremlin database // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *GremlinResourcesClient) createUpdateGremlinDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string, createUpdateGremlinDatabaseParameters GremlinDatabaseCreateUpdateParameters, options *GremlinResourcesClientBeginCreateUpdateGremlinDatabaseOptions) (*http.Response, error) { req, err := client.createUpdateGremlinDatabaseCreateRequest(ctx, resourceGroupName, accountName, databaseName, createUpdateGremlinDatabaseParameters, options) if err != nil { @@ -118,7 +118,7 @@ func (client *GremlinResourcesClient) createUpdateGremlinDatabaseCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, createUpdateGremlinDatabaseParameters) @@ -126,7 +126,7 @@ func (client *GremlinResourcesClient) createUpdateGremlinDatabaseCreateRequest(c // BeginCreateUpdateGremlinGraph - Create or update an Azure Cosmos DB Gremlin graph // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -148,7 +148,7 @@ func (client *GremlinResourcesClient) BeginCreateUpdateGremlinGraph(ctx context. // CreateUpdateGremlinGraph - Create or update an Azure Cosmos DB Gremlin graph // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *GremlinResourcesClient) createUpdateGremlinGraph(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, createUpdateGremlinGraphParameters GremlinGraphCreateUpdateParameters, options *GremlinResourcesClientBeginCreateUpdateGremlinGraphOptions) (*http.Response, error) { req, err := client.createUpdateGremlinGraphCreateRequest(ctx, resourceGroupName, accountName, databaseName, graphName, createUpdateGremlinGraphParameters, options) if err != nil { @@ -192,7 +192,7 @@ func (client *GremlinResourcesClient) createUpdateGremlinGraphCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, createUpdateGremlinGraphParameters) @@ -200,7 +200,7 @@ func (client *GremlinResourcesClient) createUpdateGremlinGraphCreateRequest(ctx // BeginDeleteGremlinDatabase - Deletes an existing Azure Cosmos DB Gremlin database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -220,7 +220,7 @@ func (client *GremlinResourcesClient) BeginDeleteGremlinDatabase(ctx context.Con // DeleteGremlinDatabase - Deletes an existing Azure Cosmos DB Gremlin database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *GremlinResourcesClient) deleteGremlinDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *GremlinResourcesClientBeginDeleteGremlinDatabaseOptions) (*http.Response, error) { req, err := client.deleteGremlinDatabaseCreateRequest(ctx, resourceGroupName, accountName, databaseName, options) if err != nil { @@ -260,14 +260,14 @@ func (client *GremlinResourcesClient) deleteGremlinDatabaseCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // BeginDeleteGremlinGraph - Deletes an existing Azure Cosmos DB Gremlin graph. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -288,7 +288,7 @@ func (client *GremlinResourcesClient) BeginDeleteGremlinGraph(ctx context.Contex // DeleteGremlinGraph - Deletes an existing Azure Cosmos DB Gremlin graph. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *GremlinResourcesClient) deleteGremlinGraph(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, options *GremlinResourcesClientBeginDeleteGremlinGraphOptions) (*http.Response, error) { req, err := client.deleteGremlinGraphCreateRequest(ctx, resourceGroupName, accountName, databaseName, graphName, options) if err != nil { @@ -332,14 +332,14 @@ func (client *GremlinResourcesClient) deleteGremlinGraphCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // GetGremlinDatabase - Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -384,7 +384,7 @@ func (client *GremlinResourcesClient) getGremlinDatabaseCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -402,7 +402,7 @@ func (client *GremlinResourcesClient) getGremlinDatabaseHandleResponse(resp *htt // GetGremlinDatabaseThroughput - Gets the RUs per second of the Gremlin database under an existing Azure Cosmos DB database // account with the provided name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -447,7 +447,7 @@ func (client *GremlinResourcesClient) getGremlinDatabaseThroughputCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -464,7 +464,7 @@ func (client *GremlinResourcesClient) getGremlinDatabaseThroughputHandleResponse // GetGremlinGraph - Gets the Gremlin graph under an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -514,7 +514,7 @@ func (client *GremlinResourcesClient) getGremlinGraphCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -532,7 +532,7 @@ func (client *GremlinResourcesClient) getGremlinGraphHandleResponse(resp *http.R // GetGremlinGraphThroughput - Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the // provided name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -582,7 +582,7 @@ func (client *GremlinResourcesClient) getGremlinGraphThroughputCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -599,7 +599,7 @@ func (client *GremlinResourcesClient) getGremlinGraphThroughputHandleResponse(re // NewListGremlinDatabasesPager - Lists the Gremlin databases under an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // options - GremlinResourcesClientListGremlinDatabasesOptions contains the optional parameters for the GremlinResourcesClient.ListGremlinDatabases @@ -646,7 +646,7 @@ func (client *GremlinResourcesClient) listGremlinDatabasesCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -663,7 +663,7 @@ func (client *GremlinResourcesClient) listGremlinDatabasesHandleResponse(resp *h // NewListGremlinGraphsPager - Lists the Gremlin graph under an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -715,7 +715,7 @@ func (client *GremlinResourcesClient) listGremlinGraphsCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -732,7 +732,7 @@ func (client *GremlinResourcesClient) listGremlinGraphsHandleResponse(resp *http // BeginMigrateGremlinDatabaseToAutoscale - Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -752,7 +752,7 @@ func (client *GremlinResourcesClient) BeginMigrateGremlinDatabaseToAutoscale(ctx // MigrateGremlinDatabaseToAutoscale - Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *GremlinResourcesClient) migrateGremlinDatabaseToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *GremlinResourcesClientBeginMigrateGremlinDatabaseToAutoscaleOptions) (*http.Response, error) { req, err := client.migrateGremlinDatabaseToAutoscaleCreateRequest(ctx, resourceGroupName, accountName, databaseName, options) if err != nil { @@ -792,7 +792,7 @@ func (client *GremlinResourcesClient) migrateGremlinDatabaseToAutoscaleCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -800,7 +800,7 @@ func (client *GremlinResourcesClient) migrateGremlinDatabaseToAutoscaleCreateReq // BeginMigrateGremlinDatabaseToManualThroughput - Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -820,7 +820,7 @@ func (client *GremlinResourcesClient) BeginMigrateGremlinDatabaseToManualThrough // MigrateGremlinDatabaseToManualThroughput - Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *GremlinResourcesClient) migrateGremlinDatabaseToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *GremlinResourcesClientBeginMigrateGremlinDatabaseToManualThroughputOptions) (*http.Response, error) { req, err := client.migrateGremlinDatabaseToManualThroughputCreateRequest(ctx, resourceGroupName, accountName, databaseName, options) if err != nil { @@ -860,7 +860,7 @@ func (client *GremlinResourcesClient) migrateGremlinDatabaseToManualThroughputCr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -868,7 +868,7 @@ func (client *GremlinResourcesClient) migrateGremlinDatabaseToManualThroughputCr // BeginMigrateGremlinGraphToAutoscale - Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -889,7 +889,7 @@ func (client *GremlinResourcesClient) BeginMigrateGremlinGraphToAutoscale(ctx co // MigrateGremlinGraphToAutoscale - Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *GremlinResourcesClient) migrateGremlinGraphToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, options *GremlinResourcesClientBeginMigrateGremlinGraphToAutoscaleOptions) (*http.Response, error) { req, err := client.migrateGremlinGraphToAutoscaleCreateRequest(ctx, resourceGroupName, accountName, databaseName, graphName, options) if err != nil { @@ -933,7 +933,7 @@ func (client *GremlinResourcesClient) migrateGremlinGraphToAutoscaleCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -941,7 +941,7 @@ func (client *GremlinResourcesClient) migrateGremlinGraphToAutoscaleCreateReques // BeginMigrateGremlinGraphToManualThroughput - Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -962,7 +962,7 @@ func (client *GremlinResourcesClient) BeginMigrateGremlinGraphToManualThroughput // MigrateGremlinGraphToManualThroughput - Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *GremlinResourcesClient) migrateGremlinGraphToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, options *GremlinResourcesClientBeginMigrateGremlinGraphToManualThroughputOptions) (*http.Response, error) { req, err := client.migrateGremlinGraphToManualThroughputCreateRequest(ctx, resourceGroupName, accountName, databaseName, graphName, options) if err != nil { @@ -1006,91 +1006,15 @@ func (client *GremlinResourcesClient) migrateGremlinGraphToManualThroughputCreat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// BeginRetrieveContinuousBackupInformation - Retrieves continuous backup information for a gremlin graph. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// accountName - Cosmos DB database account name. -// databaseName - Cosmos DB database name. -// graphName - Cosmos DB graph name. -// location - The name of the continuous backup restore location. -// options - GremlinResourcesClientBeginRetrieveContinuousBackupInformationOptions contains the optional parameters for the -// GremlinResourcesClient.BeginRetrieveContinuousBackupInformation method. -func (client *GremlinResourcesClient) BeginRetrieveContinuousBackupInformation(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, location ContinuousBackupRestoreLocation, options *GremlinResourcesClientBeginRetrieveContinuousBackupInformationOptions) (*runtime.Poller[GremlinResourcesClientRetrieveContinuousBackupInformationResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.retrieveContinuousBackupInformation(ctx, resourceGroupName, accountName, databaseName, graphName, location, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[GremlinResourcesClientRetrieveContinuousBackupInformationResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[GremlinResourcesClientRetrieveContinuousBackupInformationResponse](options.ResumeToken, client.pl, nil) - } -} - -// RetrieveContinuousBackupInformation - Retrieves continuous backup information for a gremlin graph. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -func (client *GremlinResourcesClient) retrieveContinuousBackupInformation(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, location ContinuousBackupRestoreLocation, options *GremlinResourcesClientBeginRetrieveContinuousBackupInformationOptions) (*http.Response, error) { - req, err := client.retrieveContinuousBackupInformationCreateRequest(ctx, resourceGroupName, accountName, databaseName, graphName, location, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// retrieveContinuousBackupInformationCreateRequest creates the RetrieveContinuousBackupInformation request. -func (client *GremlinResourcesClient) retrieveContinuousBackupInformationCreateRequest(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, location ContinuousBackupRestoreLocation, options *GremlinResourcesClientBeginRetrieveContinuousBackupInformationOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/retrieveContinuousBackupInformation" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - if databaseName == "" { - return nil, errors.New("parameter databaseName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) - if graphName == "" { - return nil, errors.New("parameter graphName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{graphName}", url.PathEscape(graphName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, location) -} - // BeginUpdateGremlinDatabaseThroughput - Update RUs per second of an Azure Cosmos DB Gremlin database // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -1111,7 +1035,7 @@ func (client *GremlinResourcesClient) BeginUpdateGremlinDatabaseThroughput(ctx c // UpdateGremlinDatabaseThroughput - Update RUs per second of an Azure Cosmos DB Gremlin database // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *GremlinResourcesClient) updateGremlinDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *GremlinResourcesClientBeginUpdateGremlinDatabaseThroughputOptions) (*http.Response, error) { req, err := client.updateGremlinDatabaseThroughputCreateRequest(ctx, resourceGroupName, accountName, databaseName, updateThroughputParameters, options) if err != nil { @@ -1151,7 +1075,7 @@ func (client *GremlinResourcesClient) updateGremlinDatabaseThroughputCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, updateThroughputParameters) @@ -1159,7 +1083,7 @@ func (client *GremlinResourcesClient) updateGremlinDatabaseThroughputCreateReque // BeginUpdateGremlinGraphThroughput - Update RUs per second of an Azure Cosmos DB Gremlin graph // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -1181,7 +1105,7 @@ func (client *GremlinResourcesClient) BeginUpdateGremlinGraphThroughput(ctx cont // UpdateGremlinGraphThroughput - Update RUs per second of an Azure Cosmos DB Gremlin graph // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *GremlinResourcesClient) updateGremlinGraphThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *GremlinResourcesClientBeginUpdateGremlinGraphThroughputOptions) (*http.Response, error) { req, err := client.updateGremlinGraphThroughputCreateRequest(ctx, resourceGroupName, accountName, databaseName, graphName, updateThroughputParameters, options) if err != nil { @@ -1225,7 +1149,7 @@ func (client *GremlinResourcesClient) updateGremlinGraphThroughputCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, updateThroughputParameters) diff --git a/sdk/resourcemanager/cosmos/armcosmos/gremlinresources_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/gremlinresources_client_example_test.go deleted file mode 100644 index a736b9411d38..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/gremlinresources_client_example_test.go +++ /dev/null @@ -1,542 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBGremlinDatabaseList.json -func ExampleGremlinResourcesClient_NewListGremlinDatabasesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewGremlinResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListGremlinDatabasesPager("rgName", - "ddb1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBGremlinDatabaseGet.json -func ExampleGremlinResourcesClient_GetGremlinDatabase() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewGremlinResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetGremlinDatabase(ctx, - "rg1", - "ddb1", - "databaseName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBGremlinDatabaseCreateUpdate.json -func ExampleGremlinResourcesClient_BeginCreateUpdateGremlinDatabase() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewGremlinResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateUpdateGremlinDatabase(ctx, - "rg1", - "ddb1", - "databaseName", - armcosmos.GremlinDatabaseCreateUpdateParameters{ - Location: to.Ptr("West US"), - Tags: map[string]*string{}, - Properties: &armcosmos.GremlinDatabaseCreateUpdateProperties{ - Options: &armcosmos.CreateUpdateOptions{}, - Resource: &armcosmos.GremlinDatabaseResource{ - ID: to.Ptr("databaseName"), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBGremlinDatabaseDelete.json -func ExampleGremlinResourcesClient_BeginDeleteGremlinDatabase() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewGremlinResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDeleteGremlinDatabase(ctx, - "rg1", - "ddb1", - "databaseName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBGremlinDatabaseThroughputGet.json -func ExampleGremlinResourcesClient_GetGremlinDatabaseThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewGremlinResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetGremlinDatabaseThroughput(ctx, - "rg1", - "ddb1", - "databaseName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBGremlinDatabaseThroughputUpdate.json -func ExampleGremlinResourcesClient_BeginUpdateGremlinDatabaseThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewGremlinResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdateGremlinDatabaseThroughput(ctx, - "rg1", - "ddb1", - "databaseName", - armcosmos.ThroughputSettingsUpdateParameters{ - Location: to.Ptr("West US"), - Tags: map[string]*string{}, - Properties: &armcosmos.ThroughputSettingsUpdateProperties{ - Resource: &armcosmos.ThroughputSettingsResource{ - Throughput: to.Ptr[int32](400), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBGremlinDatabaseMigrateToAutoscale.json -func ExampleGremlinResourcesClient_BeginMigrateGremlinDatabaseToAutoscale() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewGremlinResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginMigrateGremlinDatabaseToAutoscale(ctx, - "rg1", - "ddb1", - "databaseName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBGremlinDatabaseMigrateToManualThroughput.json -func ExampleGremlinResourcesClient_BeginMigrateGremlinDatabaseToManualThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewGremlinResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginMigrateGremlinDatabaseToManualThroughput(ctx, - "rg1", - "ddb1", - "databaseName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBGremlinGraphList.json -func ExampleGremlinResourcesClient_NewListGremlinGraphsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewGremlinResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListGremlinGraphsPager("rgName", - "ddb1", - "databaseName", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBGremlinGraphGet.json -func ExampleGremlinResourcesClient_GetGremlinGraph() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewGremlinResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetGremlinGraph(ctx, - "rgName", - "ddb1", - "databaseName", - "graphName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBGremlinGraphCreateUpdate.json -func ExampleGremlinResourcesClient_BeginCreateUpdateGremlinGraph() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewGremlinResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateUpdateGremlinGraph(ctx, - "rg1", - "ddb1", - "databaseName", - "graphName", - armcosmos.GremlinGraphCreateUpdateParameters{ - Location: to.Ptr("West US"), - Tags: map[string]*string{}, - Properties: &armcosmos.GremlinGraphCreateUpdateProperties{ - Options: &armcosmos.CreateUpdateOptions{}, - Resource: &armcosmos.GremlinGraphResource{ - ConflictResolutionPolicy: &armcosmos.ConflictResolutionPolicy{ - ConflictResolutionPath: to.Ptr("/path"), - Mode: to.Ptr(armcosmos.ConflictResolutionModeLastWriterWins), - }, - DefaultTTL: to.Ptr[int32](100), - ID: to.Ptr("graphName"), - IndexingPolicy: &armcosmos.IndexingPolicy{ - Automatic: to.Ptr(true), - ExcludedPaths: []*armcosmos.ExcludedPath{}, - IncludedPaths: []*armcosmos.IncludedPath{ - { - Path: to.Ptr("/*"), - Indexes: []*armcosmos.Indexes{ - { - DataType: to.Ptr(armcosmos.DataTypeString), - Kind: to.Ptr(armcosmos.IndexKindRange), - Precision: to.Ptr[int32](-1), - }, - { - DataType: to.Ptr(armcosmos.DataTypeNumber), - Kind: to.Ptr(armcosmos.IndexKindRange), - Precision: to.Ptr[int32](-1), - }}, - }}, - IndexingMode: to.Ptr(armcosmos.IndexingModeConsistent), - }, - PartitionKey: &armcosmos.ContainerPartitionKey{ - Kind: to.Ptr(armcosmos.PartitionKindHash), - Paths: []*string{ - to.Ptr("/AccountNumber")}, - }, - UniqueKeyPolicy: &armcosmos.UniqueKeyPolicy{ - UniqueKeys: []*armcosmos.UniqueKey{ - { - Paths: []*string{ - to.Ptr("/testPath")}, - }}, - }, - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBGremlinGraphDelete.json -func ExampleGremlinResourcesClient_BeginDeleteGremlinGraph() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewGremlinResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDeleteGremlinGraph(ctx, - "rg1", - "ddb1", - "databaseName", - "graphName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBGremlinGraphThroughputGet.json -func ExampleGremlinResourcesClient_GetGremlinGraphThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewGremlinResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetGremlinGraphThroughput(ctx, - "rg1", - "ddb1", - "databaseName", - "graphName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBGremlinGraphThroughputUpdate.json -func ExampleGremlinResourcesClient_BeginUpdateGremlinGraphThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewGremlinResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdateGremlinGraphThroughput(ctx, - "rg1", - "ddb1", - "databaseName", - "graphName", - armcosmos.ThroughputSettingsUpdateParameters{ - Location: to.Ptr("West US"), - Tags: map[string]*string{}, - Properties: &armcosmos.ThroughputSettingsUpdateProperties{ - Resource: &armcosmos.ThroughputSettingsResource{ - Throughput: to.Ptr[int32](400), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBGremlinGraphMigrateToAutoscale.json -func ExampleGremlinResourcesClient_BeginMigrateGremlinGraphToAutoscale() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewGremlinResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginMigrateGremlinGraphToAutoscale(ctx, - "rg1", - "ddb1", - "databaseName", - "graphName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBGremlinGraphMigrateToManualThroughput.json -func ExampleGremlinResourcesClient_BeginMigrateGremlinGraphToManualThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewGremlinResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginMigrateGremlinGraphToManualThroughput(ctx, - "rg1", - "ddb1", - "databaseName", - "graphName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBGremlinGraphBackupInformation.json -func ExampleGremlinResourcesClient_BeginRetrieveContinuousBackupInformation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewGremlinResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRetrieveContinuousBackupInformation(ctx, - "rgName", - "ddb1", - "databaseName", - "graphName", - armcosmos.ContinuousBackupRestoreLocation{ - Location: to.Ptr("North Europe"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/locations_client.go b/sdk/resourcemanager/cosmos/armcosmos/locations_client.go index 8fc87e4e5314..aa250924e985 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/locations_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/locations_client.go @@ -57,7 +57,7 @@ func NewLocationsClient(subscriptionID string, credential azcore.TokenCredential // Get - Get the properties of an existing Cosmos DB location // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // location - Cosmos DB region, with spaces between words and each word capitalized. // options - LocationsClientGetOptions contains the optional parameters for the LocationsClient.Get method. func (client *LocationsClient) Get(ctx context.Context, location string, options *LocationsClientGetOptions) (LocationsClientGetResponse, error) { @@ -91,7 +91,7 @@ func (client *LocationsClient) getCreateRequest(ctx context.Context, location st return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -108,7 +108,7 @@ func (client *LocationsClient) getHandleResponse(resp *http.Response) (Locations // NewListPager - List Cosmos DB locations and their properties // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // options - LocationsClientListOptions contains the optional parameters for the LocationsClient.List method. func (client *LocationsClient) NewListPager(options *LocationsClientListOptions) *runtime.Pager[LocationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[LocationsClientListResponse]{ @@ -144,7 +144,7 @@ func (client *LocationsClient) listCreateRequest(ctx context.Context, options *L return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/locations_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/locations_client_example_test.go deleted file mode 100644 index 2a9cf76daa19..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/locations_client_example_test.go +++ /dev/null @@ -1,62 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBLocationList.json -func ExampleLocationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewLocationsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBLocationGet.json -func ExampleLocationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewLocationsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "westus", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/models.go b/sdk/resourcemanager/cosmos/armcosmos/models.go index 9a29fe493b5a..fdcda81f2111 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/models.go +++ b/sdk/resourcemanager/cosmos/armcosmos/models.go @@ -31,9 +31,6 @@ type ARMProxyResource struct { // ARMResourceProperties - The core properties of ARM resources. type ARMResourceProperties struct { - // Identity for the resource. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -67,28 +64,6 @@ type AnalyticalStorageConfiguration struct { SchemaType *AnalyticalStorageSchemaType `json:"schemaType,omitempty"` } -// AuthenticationMethodLdapProperties - Ldap authentication method properties. This feature is in preview. -type AuthenticationMethodLdapProperties struct { - // Distinguished name of the object to start the recursive search of users from. - SearchBaseDistinguishedName *string `json:"searchBaseDistinguishedName,omitempty"` - - // Template to use for searching. Defaults to (cn=%s) where %s will be replaced by the username used to login. - SearchFilterTemplate *string `json:"searchFilterTemplate,omitempty"` - ServerCertificates []*Certificate `json:"serverCertificates,omitempty"` - - // Hostname of the LDAP server. - ServerHostname *string `json:"serverHostname,omitempty"` - - // Port of the LDAP server. - ServerPort *int32 `json:"serverPort,omitempty"` - - // Distinguished name of the look up user account, who can look up user details on authentication. - ServiceUserDistinguishedName *string `json:"serviceUserDistinguishedName,omitempty"` - - // Password of the look up user. - ServiceUserPassword *string `json:"serviceUserPassword,omitempty"` -} - // AutoUpgradePolicyResource - Cosmos DB resource auto-upgrade policy type AutoUpgradePolicyResource struct { // Represents throughput policy which service must adhere to for auto-upgrade @@ -112,23 +87,6 @@ type AutoscaleSettingsResource struct { TargetMaxThroughput *int32 `json:"targetMaxThroughput,omitempty" azure:"ro"` } -// AzureBlobDataTransferDataSourceSink - An Azure Blob Storage data source/sink -type AzureBlobDataTransferDataSourceSink struct { - // REQUIRED - Component *DataTransferComponent `json:"component,omitempty"` - - // REQUIRED - ContainerName *string `json:"containerName,omitempty"` - EndpointURL *string `json:"endpointUrl,omitempty"` -} - -// GetDataTransferDataSourceSink implements the DataTransferDataSourceSinkClassification interface for type AzureBlobDataTransferDataSourceSink. -func (a *AzureBlobDataTransferDataSourceSink) GetDataTransferDataSourceSink() *DataTransferDataSourceSink { - return &DataTransferDataSourceSink{ - Component: a.Component, - } -} - // BackupInformation - Backup information of a resource. type BackupInformation struct { // READ-ONLY; Information about the status of continuous backups. @@ -168,25 +126,6 @@ type BackupPolicyMigrationState struct { TargetType *BackupPolicyType `json:"targetType,omitempty"` } -// BackupResource - A restorable backup of a Cassandra cluster. -type BackupResource struct { - Properties *BackupResourceProperties `json:"properties,omitempty"` - - // READ-ONLY; The unique resource identifier of the database account. - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; The name of the database account. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; The type of Azure resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -type BackupResourceProperties struct { - // The time this backup was taken, formatted like 2021-01-21T17:35:21 - Timestamp *time.Time `json:"timestamp,omitempty"` -} - // Capability - Cosmos DB capability object type Capability struct { // Name of the Cosmos DB capability. For example, "name": "EnableCassandra". Current values also include "EnableTable" and @@ -263,22 +202,11 @@ type CassandraClustersClientBeginUpdateOptions struct { ResumeToken string } -// CassandraClustersClientGetBackupOptions contains the optional parameters for the CassandraClustersClient.GetBackup method. -type CassandraClustersClientGetBackupOptions struct { - // placeholder for future optional parameters -} - // CassandraClustersClientGetOptions contains the optional parameters for the CassandraClustersClient.Get method. type CassandraClustersClientGetOptions struct { // placeholder for future optional parameters } -// CassandraClustersClientListBackupsOptions contains the optional parameters for the CassandraClustersClient.ListBackups -// method. -type CassandraClustersClientListBackupsOptions struct { - // placeholder for future optional parameters -} - // CassandraClustersClientListByResourceGroupOptions contains the optional parameters for the CassandraClustersClient.ListByResourceGroup // method. type CassandraClustersClientListByResourceGroupOptions struct { @@ -327,33 +255,11 @@ type CassandraDataCentersClientListOptions struct { // placeholder for future optional parameters } -// CassandraDataTransferDataSourceSink - A CosmosDB Cassandra API data source/sink -type CassandraDataTransferDataSourceSink struct { - // REQUIRED - Component *DataTransferComponent `json:"component,omitempty"` - - // REQUIRED - KeyspaceName *string `json:"keyspaceName,omitempty"` - - // REQUIRED - TableName *string `json:"tableName,omitempty"` -} - -// GetDataTransferDataSourceSink implements the DataTransferDataSourceSinkClassification interface for type CassandraDataTransferDataSourceSink. -func (c *CassandraDataTransferDataSourceSink) GetDataTransferDataSourceSink() *DataTransferDataSourceSink { - return &DataTransferDataSourceSink{ - Component: c.Component, - } -} - // CassandraKeyspaceCreateUpdateParameters - Parameters to create and update Cosmos DB Cassandra keyspace. type CassandraKeyspaceCreateUpdateParameters struct { // REQUIRED; Properties to create and update Azure Cosmos DB Cassandra keyspace. Properties *CassandraKeyspaceCreateUpdateProperties `json:"properties,omitempty"` - // Identity for the resource. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -414,9 +320,6 @@ type CassandraKeyspaceGetPropertiesResource struct { // CassandraKeyspaceGetResults - An Azure Cosmos DB Cassandra keyspace. type CassandraKeyspaceGetResults struct { - // Identity for the resource. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -472,13 +375,6 @@ type CassandraResourcesClientBeginCreateUpdateCassandraTableOptions struct { ResumeToken string } -// CassandraResourcesClientBeginCreateUpdateCassandraViewOptions contains the optional parameters for the CassandraResourcesClient.BeginCreateUpdateCassandraView -// method. -type CassandraResourcesClientBeginCreateUpdateCassandraViewOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - // CassandraResourcesClientBeginDeleteCassandraKeyspaceOptions contains the optional parameters for the CassandraResourcesClient.BeginDeleteCassandraKeyspace // method. type CassandraResourcesClientBeginDeleteCassandraKeyspaceOptions struct { @@ -493,13 +389,6 @@ type CassandraResourcesClientBeginDeleteCassandraTableOptions struct { ResumeToken string } -// CassandraResourcesClientBeginDeleteCassandraViewOptions contains the optional parameters for the CassandraResourcesClient.BeginDeleteCassandraView -// method. -type CassandraResourcesClientBeginDeleteCassandraViewOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - // CassandraResourcesClientBeginMigrateCassandraKeyspaceToAutoscaleOptions contains the optional parameters for the CassandraResourcesClient.BeginMigrateCassandraKeyspaceToAutoscale // method. type CassandraResourcesClientBeginMigrateCassandraKeyspaceToAutoscaleOptions struct { @@ -528,20 +417,6 @@ type CassandraResourcesClientBeginMigrateCassandraTableToManualThroughputOptions ResumeToken string } -// CassandraResourcesClientBeginMigrateCassandraViewToAutoscaleOptions contains the optional parameters for the CassandraResourcesClient.BeginMigrateCassandraViewToAutoscale -// method. -type CassandraResourcesClientBeginMigrateCassandraViewToAutoscaleOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CassandraResourcesClientBeginMigrateCassandraViewToManualThroughputOptions contains the optional parameters for the CassandraResourcesClient.BeginMigrateCassandraViewToManualThroughput -// method. -type CassandraResourcesClientBeginMigrateCassandraViewToManualThroughputOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - // CassandraResourcesClientBeginUpdateCassandraKeyspaceThroughputOptions contains the optional parameters for the CassandraResourcesClient.BeginUpdateCassandraKeyspaceThroughput // method. type CassandraResourcesClientBeginUpdateCassandraKeyspaceThroughputOptions struct { @@ -556,13 +431,6 @@ type CassandraResourcesClientBeginUpdateCassandraTableThroughputOptions struct { ResumeToken string } -// CassandraResourcesClientBeginUpdateCassandraViewThroughputOptions contains the optional parameters for the CassandraResourcesClient.BeginUpdateCassandraViewThroughput -// method. -type CassandraResourcesClientBeginUpdateCassandraViewThroughputOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - // CassandraResourcesClientGetCassandraKeyspaceOptions contains the optional parameters for the CassandraResourcesClient.GetCassandraKeyspace // method. type CassandraResourcesClientGetCassandraKeyspaceOptions struct { @@ -587,18 +455,6 @@ type CassandraResourcesClientGetCassandraTableThroughputOptions struct { // placeholder for future optional parameters } -// CassandraResourcesClientGetCassandraViewOptions contains the optional parameters for the CassandraResourcesClient.GetCassandraView -// method. -type CassandraResourcesClientGetCassandraViewOptions struct { - // placeholder for future optional parameters -} - -// CassandraResourcesClientGetCassandraViewThroughputOptions contains the optional parameters for the CassandraResourcesClient.GetCassandraViewThroughput -// method. -type CassandraResourcesClientGetCassandraViewThroughputOptions struct { - // placeholder for future optional parameters -} - // CassandraResourcesClientListCassandraKeyspacesOptions contains the optional parameters for the CassandraResourcesClient.ListCassandraKeyspaces // method. type CassandraResourcesClientListCassandraKeyspacesOptions struct { @@ -611,12 +467,6 @@ type CassandraResourcesClientListCassandraTablesOptions struct { // placeholder for future optional parameters } -// CassandraResourcesClientListCassandraViewsOptions contains the optional parameters for the CassandraResourcesClient.ListCassandraViews -// method. -type CassandraResourcesClientListCassandraViewsOptions struct { - // placeholder for future optional parameters -} - // CassandraSchema - Cosmos DB Cassandra table schema type CassandraSchema struct { // List of cluster key. @@ -634,9 +484,6 @@ type CassandraTableCreateUpdateParameters struct { // REQUIRED; Properties to create and update Azure Cosmos DB Cassandra table. Properties *CassandraTableCreateUpdateProperties `json:"properties,omitempty"` - // Identity for the resource. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -706,9 +553,6 @@ type CassandraTableGetPropertiesResource struct { // CassandraTableGetResults - An Azure Cosmos DB Cassandra table. type CassandraTableGetResults struct { - // Identity for the resource. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -753,224 +597,11 @@ type CassandraTableResource struct { Schema *CassandraSchema `json:"schema,omitempty"` } -// CassandraViewCreateUpdateParameters - Parameters to create and update Cosmos DB Cassandra view. -type CassandraViewCreateUpdateParameters struct { - // REQUIRED; Properties to create and update Azure Cosmos DB Cassandra view. - Properties *CassandraViewCreateUpdateProperties `json:"properties,omitempty"` - - // Identity for the resource. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - - // The location of the resource group to which the resource belongs. - Location *string `json:"location,omitempty"` - - // Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource - // (across resource groups). A maximum of 15 tags can be provided for a - // resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example, - // the default experience for a template type is set with "defaultExperience": - // "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; The unique resource identifier of the ARM resource. - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; The name of the ARM resource. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; The type of Azure resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// CassandraViewCreateUpdateProperties - Properties to create and update Azure Cosmos DB Cassandra view. -type CassandraViewCreateUpdateProperties struct { - // REQUIRED; The standard JSON format of a Cassandra view - Resource *CassandraViewResource `json:"resource,omitempty"` - - // A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - Options *CreateUpdateOptions `json:"options,omitempty"` -} - -// CassandraViewGetProperties - The properties of an Azure Cosmos DB Cassandra view -type CassandraViewGetProperties struct { - Options *CassandraViewGetPropertiesOptions `json:"options,omitempty"` - Resource *CassandraViewGetPropertiesResource `json:"resource,omitempty"` -} - -type CassandraViewGetPropertiesOptions struct { - // Specifies the Autoscale settings. - AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"` - - // Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer - // details. - Throughput *int32 `json:"throughput,omitempty"` -} - -type CassandraViewGetPropertiesResource struct { - // REQUIRED; Name of the Cosmos DB Cassandra view - ID *string `json:"id,omitempty"` - - // REQUIRED; View Definition of the Cosmos DB Cassandra view - ViewDefinition *string `json:"viewDefinition,omitempty"` - - // READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. - Etag *string `json:"_etag,omitempty" azure:"ro"` - - // READ-ONLY; A system generated property. A unique identifier. - Rid *string `json:"_rid,omitempty" azure:"ro"` - - // READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. - Ts *float32 `json:"_ts,omitempty" azure:"ro"` -} - -// CassandraViewGetResults - An Azure Cosmos DB Cassandra view. -type CassandraViewGetResults struct { - // Identity for the resource. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - - // The location of the resource group to which the resource belongs. - Location *string `json:"location,omitempty"` - - // The properties of an Azure Cosmos DB Cassandra view - Properties *CassandraViewGetProperties `json:"properties,omitempty"` - - // Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource - // (across resource groups). A maximum of 15 tags can be provided for a - // resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example, - // the default experience for a template type is set with "defaultExperience": - // "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; The unique resource identifier of the ARM resource. - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; The name of the ARM resource. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; The type of Azure resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// CassandraViewListResult - The List operation response, that contains the Cassandra views and their properties. -type CassandraViewListResult struct { - // READ-ONLY; List of Cassandra views and their properties. - Value []*CassandraViewGetResults `json:"value,omitempty" azure:"ro"` -} - -// CassandraViewResource - Cosmos DB Cassandra view resource object -type CassandraViewResource struct { - // REQUIRED; Name of the Cosmos DB Cassandra view - ID *string `json:"id,omitempty"` - - // REQUIRED; View Definition of the Cosmos DB Cassandra view - ViewDefinition *string `json:"viewDefinition,omitempty"` -} - type Certificate struct { // PEM formatted public key. Pem *string `json:"pem,omitempty"` } -// ClientEncryptionIncludedPath - . -type ClientEncryptionIncludedPath struct { - // REQUIRED; The identifier of the Client Encryption Key to be used to encrypt the path. - ClientEncryptionKeyID *string `json:"clientEncryptionKeyId,omitempty"` - - // REQUIRED; The encryption algorithm which will be used. Eg - AEADAES256CBCHMAC_SHA256. - EncryptionAlgorithm *string `json:"encryptionAlgorithm,omitempty"` - - // REQUIRED; The type of encryption to be performed. Eg - Deterministic, Randomized. - EncryptionType *string `json:"encryptionType,omitempty"` - - // REQUIRED; Path that needs to be encrypted. - Path *string `json:"path,omitempty"` -} - -// ClientEncryptionKeyCreateUpdateParameters - Parameters to create and update ClientEncryptionKey. -type ClientEncryptionKeyCreateUpdateParameters struct { - // REQUIRED; Properties to create and update ClientEncryptionKey. - Properties *ClientEncryptionKeyCreateUpdateProperties `json:"properties,omitempty"` -} - -// ClientEncryptionKeyCreateUpdateProperties - Properties to create and update ClientEncryptionKey. -type ClientEncryptionKeyCreateUpdateProperties struct { - // REQUIRED; The standard JSON format of a ClientEncryptionKey - Resource *ClientEncryptionKeyResource `json:"resource,omitempty"` -} - -// ClientEncryptionKeyGetProperties - The properties of a ClientEncryptionKey resource -type ClientEncryptionKeyGetProperties struct { - Resource *ClientEncryptionKeyGetPropertiesResource `json:"resource,omitempty"` -} - -type ClientEncryptionKeyGetPropertiesResource struct { - // Encryption algorithm that will be used along with this client encryption key to encrypt/decrypt data. - EncryptionAlgorithm *string `json:"encryptionAlgorithm,omitempty"` - - // Name of the ClientEncryptionKey - ID *string `json:"id,omitempty"` - - // Metadata for the wrapping provider that can be used to unwrap the wrapped client encryption key. - KeyWrapMetadata *KeyWrapMetadata `json:"keyWrapMetadata,omitempty"` - - // Wrapped (encrypted) form of the key represented as a byte array. - WrappedDataEncryptionKey []byte `json:"wrappedDataEncryptionKey,omitempty"` - - // READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. - Etag *string `json:"_etag,omitempty" azure:"ro"` - - // READ-ONLY; A system generated property. A unique identifier. - Rid *string `json:"_rid,omitempty" azure:"ro"` - - // READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. - Ts *float32 `json:"_ts,omitempty" azure:"ro"` -} - -// ClientEncryptionKeyGetResults - Client Encryption Key. -type ClientEncryptionKeyGetResults struct { - // The properties of a ClientEncryptionKey - Properties *ClientEncryptionKeyGetProperties `json:"properties,omitempty"` - - // READ-ONLY; The unique resource identifier of the database account. - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; The name of the database account. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; The type of Azure resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ClientEncryptionKeyResource - Cosmos DB client encryption key resource object. -type ClientEncryptionKeyResource struct { - // Encryption algorithm that will be used along with this client encryption key to encrypt/decrypt data. - EncryptionAlgorithm *string `json:"encryptionAlgorithm,omitempty"` - - // Name of the ClientEncryptionKey - ID *string `json:"id,omitempty"` - - // Metadata for the wrapping provider that can be used to unwrap the wrapped client encryption key. - KeyWrapMetadata *KeyWrapMetadata `json:"keyWrapMetadata,omitempty"` - - // Wrapped (encrypted) form of the key represented as a byte array. - WrappedDataEncryptionKey []byte `json:"wrappedDataEncryptionKey,omitempty"` -} - -// ClientEncryptionKeysListResult - The List operation response, that contains the client encryption keys and their properties. -type ClientEncryptionKeysListResult struct { - // READ-ONLY; List of client encryption keys and their properties. - Value []*ClientEncryptionKeyGetResults `json:"value,omitempty" azure:"ro"` -} - -// ClientEncryptionPolicy - Cosmos DB client encryption policy. -type ClientEncryptionPolicy struct { - // REQUIRED; Paths of the item that need encryption along with path-specific settings. - IncludedPaths []*ClientEncryptionIncludedPath `json:"includedPaths,omitempty"` - - // Version of the client encryption policy definition. Please note, user passed value is ignored. Default policy version is - // 1. - PolicyFormatVersion *int32 `json:"policyFormatVersion,omitempty"` -} - // CloudError - An error response from the service. type CloudError struct { // Error Response. @@ -1018,7 +649,7 @@ type ClusterResource struct { type ClusterResourceProperties struct { // Which authentication method Cassandra should use to authenticate clients. 'None' turns off authentication, so should not // be used except in emergencies. 'Cassandra' is the default password based - // authentication. The default is 'Cassandra'. 'Ldap' is in preview. + // authentication. The default is 'Cassandra'. AuthenticationMethod *AuthenticationMethod `json:"authenticationMethod,omitempty"` // Whether Cassandra audit logging is enabled @@ -1055,7 +686,7 @@ type ClusterResourceProperties struct { // nodes. ExternalSeedNodes []*SeedNode `json:"externalSeedNodes,omitempty"` - // Number of hours to wait between taking a backup of the cluster. + // Number of hours to wait between taking a backup of the cluster. To disable backups, set this property to 0. HoursBetweenBackups *int32 `json:"hoursBetweenBackups,omitempty"` // Initial password for clients connecting as admin to the cluster. Should be changed after cluster creation. Returns null @@ -1213,7 +844,7 @@ type ComponentsM9L909SchemasCassandraclusterpublicstatusPropertiesDatacentersIte State *NodeState `json:"state,omitempty"` Status *string `json:"status,omitempty"` - // The timestamp at which that snapshot of these usage statistics were taken. + // The timestamp when these statistics were captured. Timestamp *string `json:"timestamp,omitempty"` // List of tokens this node covers. @@ -1306,9 +937,6 @@ type ContinuousModeBackupPolicy struct { // REQUIRED; Describes the mode of backups. Type *BackupPolicyType `json:"type,omitempty"` - // Configuration values for continuous mode backup - ContinuousModeProperties *ContinuousModeProperties `json:"continuousModeProperties,omitempty"` - // The object representing the state of the migration between the backup policies. MigrationState *BackupPolicyMigrationState `json:"migrationState,omitempty"` } @@ -1321,12 +949,6 @@ func (c *ContinuousModeBackupPolicy) GetBackupPolicy() *BackupPolicy { } } -// ContinuousModeProperties - Configuration values for periodic mode backup -type ContinuousModeProperties struct { - // Enum to indicate type of Continuos backup mode - Tier *ContinuousTier `json:"tier,omitempty"` -} - // CorsPolicy - The CORS policy for the Cosmos DB database account. type CorsPolicy struct { // REQUIRED; The origin domains that are permitted to make a request against the service via CORS. @@ -1345,21 +967,6 @@ type CorsPolicy struct { MaxAgeInSeconds *int64 `json:"maxAgeInSeconds,omitempty"` } -// CreateJobRequest - Parameters to create Data Transfer Job -type CreateJobRequest struct { - // REQUIRED; Data Transfer Create Job Properties - Properties *DataTransferJobProperties `json:"properties,omitempty"` - - // READ-ONLY; The unique resource identifier of the database account. - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; The name of the database account. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; The type of Azure resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - // CreateUpdateOptions are a list of key-value pairs that describe the resource. Supported keys are "If-Match", "If-None-Match", // "Session-Token" and "Throughput" type CreateUpdateOptions struct { @@ -1387,11 +994,8 @@ type DataCenterResource struct { // DataCenterResourceProperties - Properties of a managed Cassandra data center. type DataCenterResourceProperties struct { - // Ldap authentication method properties. This feature is in preview. - AuthenticationMethodLdapProperties *AuthenticationMethodLdapProperties `json:"authenticationMethodLdapProperties,omitempty"` - - // If the data center has Availability Zone feature, apply it to the Virtual Machine ScaleSet that host the cassandra data - // center virtual machines. + // If the azure data center has Availability Zone support, apply it to the Virtual Machine ScaleSet that host the cassandra + // data center virtual machines. AvailabilityZone *bool `json:"availabilityZone,omitempty"` // Indicates the Key Uri of the customer key to use for encryption of the backup storage account. @@ -1421,126 +1025,21 @@ type DataCenterResourceProperties struct { // permissions(key get/wrap/unwrap permissions) on the key. ManagedDiskCustomerKeyURI *string `json:"managedDiskCustomerKeyUri,omitempty"` - // The number of nodes the data center should have. This is the desired number. After it is set, it may take some time for - // the data center to be scaled to match. To monitor the number of nodes and their - // status, use the fetchNodeStatus method on the cluster. - NodeCount *int32 `json:"nodeCount,omitempty"` - - // The status of the resource at the time the operation was called. - ProvisioningState *ManagedCassandraProvisioningState `json:"provisioningState,omitempty"` - - // Virtual Machine SKU used for data centers. Default value is StandardDS14v2 - SKU *string `json:"sku,omitempty"` - - // READ-ONLY; IP addresses for seed nodes in this data center. This is for reference. Generally you will want to use the seedNodes - // property on the cluster, which aggregates the seed nodes from all data centers in - // the cluster. - SeedNodes []*SeedNode `json:"seedNodes,omitempty" azure:"ro"` -} - -// DataTransferDataSourceSinkClassification provides polymorphic access to related types. -// Call the interface's GetDataTransferDataSourceSink() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AzureBlobDataTransferDataSourceSink, *CassandraDataTransferDataSourceSink, *DataTransferDataSourceSink, *SQLDataTransferDataSourceSink -type DataTransferDataSourceSinkClassification interface { - // GetDataTransferDataSourceSink returns the DataTransferDataSourceSink content of the underlying type. - GetDataTransferDataSourceSink() *DataTransferDataSourceSink -} - -// DataTransferDataSourceSink - Base class for all DataTransfer source/sink -type DataTransferDataSourceSink struct { - // REQUIRED - Component *DataTransferComponent `json:"component,omitempty"` -} - -// GetDataTransferDataSourceSink implements the DataTransferDataSourceSinkClassification interface for type DataTransferDataSourceSink. -func (d *DataTransferDataSourceSink) GetDataTransferDataSourceSink() *DataTransferDataSourceSink { - return d -} - -// DataTransferJobFeedResults - The List operation response, that contains the Data Transfer jobs and their properties. -type DataTransferJobFeedResults struct { - // READ-ONLY; URL to get the next set of Data Transfer job list results if there are any. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` - - // READ-ONLY; List of Data Transfer jobs and their properties. - Value []*DataTransferJobGetResults `json:"value,omitempty" azure:"ro"` -} - -// DataTransferJobGetResults - A Cosmos DB Data Transfer Job -type DataTransferJobGetResults struct { - // The properties of a DataTransfer Job - Properties *DataTransferJobProperties `json:"properties,omitempty"` - - // READ-ONLY; The unique resource identifier of the database account. - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; The name of the database account. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; The type of Azure resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// DataTransferJobProperties - The properties of a DataTransfer Job -type DataTransferJobProperties struct { - // REQUIRED; Destination DataStore details - Destination DataTransferDataSourceSinkClassification `json:"destination,omitempty"` - - // REQUIRED; Source DataStore details - Source DataTransferDataSourceSinkClassification `json:"source,omitempty"` - - // Worker count - WorkerCount *int32 `json:"workerCount,omitempty"` - - // READ-ONLY; Error response for Faulted job - Error *ErrorResponse `json:"error,omitempty" azure:"ro"` - - // READ-ONLY; Job Name - JobName *string `json:"jobName,omitempty" azure:"ro"` - - // READ-ONLY; Last Updated Time (ISO-8601 format). - LastUpdatedUTCTime *time.Time `json:"lastUpdatedUtcTime,omitempty" azure:"ro"` - - // READ-ONLY; Processed Count. - ProcessedCount *int64 `json:"processedCount,omitempty" azure:"ro"` - - // READ-ONLY; Job Status - Status *string `json:"status,omitempty" azure:"ro"` - - // READ-ONLY; Total Count. - TotalCount *int64 `json:"totalCount,omitempty" azure:"ro"` -} - -// DataTransferJobsClientCancelOptions contains the optional parameters for the DataTransferJobsClient.Cancel method. -type DataTransferJobsClientCancelOptions struct { - // placeholder for future optional parameters -} - -// DataTransferJobsClientCreateOptions contains the optional parameters for the DataTransferJobsClient.Create method. -type DataTransferJobsClientCreateOptions struct { - // placeholder for future optional parameters -} - -// DataTransferJobsClientGetOptions contains the optional parameters for the DataTransferJobsClient.Get method. -type DataTransferJobsClientGetOptions struct { - // placeholder for future optional parameters -} + // The number of nodes the data center should have. This is the desired number. After it is set, it may take some time for + // the data center to be scaled to match. To monitor the number of nodes and their + // status, use the fetchNodeStatus method on the cluster. + NodeCount *int32 `json:"nodeCount,omitempty"` -// DataTransferJobsClientListByDatabaseAccountOptions contains the optional parameters for the DataTransferJobsClient.ListByDatabaseAccount -// method. -type DataTransferJobsClientListByDatabaseAccountOptions struct { - // placeholder for future optional parameters -} + // The status of the resource at the time the operation was called. + ProvisioningState *ManagedCassandraProvisioningState `json:"provisioningState,omitempty"` -// DataTransferJobsClientPauseOptions contains the optional parameters for the DataTransferJobsClient.Pause method. -type DataTransferJobsClientPauseOptions struct { - // placeholder for future optional parameters -} + // Virtual Machine SKU used for data centers. Default value is StandardDS14v2 + SKU *string `json:"sku,omitempty"` -// DataTransferJobsClientResumeOptions contains the optional parameters for the DataTransferJobsClient.Resume method. -type DataTransferJobsClientResumeOptions struct { - // placeholder for future optional parameters + // READ-ONLY; IP addresses for seed nodes in this data center. This is for reference. Generally you will want to use the seedNodes + // property on the cluster, which aggregates the seed nodes from all data centers in + // the cluster. + SeedNodes []*SeedNode `json:"seedNodes,omitempty" azure:"ro"` } // DataTransferRegionalServiceResource - Resource for a regional service location. @@ -1678,9 +1177,6 @@ type DatabaseAccountCreateUpdateProperties struct { // "SystemAssignedIdentity" and more. DefaultIdentity *string `json:"defaultIdentity,omitempty"` - // The Object representing the different Diagnostic log settings for the Cosmos DB Account. - DiagnosticLogSettings *DiagnosticLogSettings `json:"diagnosticLogSettings,omitempty"` - // Disable write operations on metadata resources (databases, containers, throughput) via account keys DisableKeyBasedMetadataWriteAccess *bool `json:"disableKeyBasedMetadataWriteAccess,omitempty"` @@ -1701,12 +1197,12 @@ type DatabaseAccountCreateUpdateProperties struct { // Flag to indicate whether Free Tier is enabled. EnableFreeTier *bool `json:"enableFreeTier,omitempty"` - // Flag to indicate whether to enable MaterializedViews on the Cosmos DB account - EnableMaterializedViews *bool `json:"enableMaterializedViews,omitempty"` - // Enables the account to write in multiple locations EnableMultipleWriteLocations *bool `json:"enableMultipleWriteLocations,omitempty"` + // Flag to indicate enabling/disabling of Partition Merge feature on the account + EnablePartitionMerge *bool `json:"enablePartitionMerge,omitempty"` + // List of IpRules. IPRules []*IPAddressOrRange `json:"ipRules,omitempty"` @@ -1716,10 +1212,6 @@ type DatabaseAccountCreateUpdateProperties struct { // The URI of the key vault KeyVaultKeyURI *string `json:"keyVaultKeyUri,omitempty"` - // 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. - KeysMetadata *DatabaseAccountKeysMetadata `json:"keysMetadata,omitempty"` - // Indicates what services are allowed to bypass firewall checks. NetworkACLBypass *NetworkACLBypass `json:"networkAclBypass,omitempty"` @@ -1734,6 +1226,10 @@ type DatabaseAccountCreateUpdateProperties struct { // List of Virtual Network ACL rules configured for the Cosmos DB account. VirtualNetworkRules []*VirtualNetworkRule `json:"virtualNetworkRules,omitempty"` + + // READ-ONLY; 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. + KeysMetadata *DatabaseAccountKeysMetadata `json:"keysMetadata,omitempty" azure:"ro"` } // DatabaseAccountGetProperties - Properties for the database account. @@ -1770,9 +1266,6 @@ type DatabaseAccountGetProperties struct { // "SystemAssignedIdentity" and more. DefaultIdentity *string `json:"defaultIdentity,omitempty"` - // The Object representing the different Diagnostic log settings for the Cosmos DB Account. - DiagnosticLogSettings *DiagnosticLogSettings `json:"diagnosticLogSettings,omitempty"` - // Disable write operations on metadata resources (databases, containers, throughput) via account keys DisableKeyBasedMetadataWriteAccess *bool `json:"disableKeyBasedMetadataWriteAccess,omitempty"` @@ -1793,12 +1286,12 @@ type DatabaseAccountGetProperties struct { // Flag to indicate whether Free Tier is enabled. EnableFreeTier *bool `json:"enableFreeTier,omitempty"` - // Flag to indicate whether to enable MaterializedViews on the Cosmos DB account - EnableMaterializedViews *bool `json:"enableMaterializedViews,omitempty"` - // Enables the account to write in multiple locations EnableMultipleWriteLocations *bool `json:"enableMultipleWriteLocations,omitempty"` + // Flag to indicate enabling/disabling of Partition Merge feature on the account + EnablePartitionMerge *bool `json:"enablePartitionMerge,omitempty"` + // List of IpRules. IPRules []*IPAddressOrRange `json:"ipRules,omitempty"` @@ -1808,9 +1301,6 @@ type DatabaseAccountGetProperties struct { // The URI of the key vault KeyVaultKeyURI *string `json:"keyVaultKeyUri,omitempty"` - // The object that represents the metadata for the Account Keys of the Cosmos DB account. - KeysMetadata *DatabaseAccountKeysMetadata `json:"keysMetadata,omitempty"` - // Indicates what services are allowed to bypass firewall checks. NetworkACLBypass *NetworkACLBypass `json:"networkAclBypass,omitempty"` @@ -1838,6 +1328,9 @@ type DatabaseAccountGetProperties struct { // READ-ONLY; A unique identifier assigned to the database account InstanceID *string `json:"instanceId,omitempty" azure:"ro"` + // READ-ONLY; The object that represents the metadata for the Account Keys of the Cosmos DB account. + KeysMetadata *DatabaseAccountKeysMetadata `json:"keysMetadata,omitempty" azure:"ro"` + // READ-ONLY; An array that contains all of the locations enabled for the Cosmos DB account. Locations []*Location `json:"locations,omitempty" azure:"ro"` @@ -1895,17 +1388,17 @@ type DatabaseAccountGetResults struct { // DatabaseAccountKeysMetadata - The metadata related to each access key for the given Cosmos DB database account. type DatabaseAccountKeysMetadata struct { - // The metadata related to the Primary Read-Write Key for the given Cosmos DB database account. - PrimaryMasterKey *AccountKeyMetadata `json:"primaryMasterKey,omitempty"` + // READ-ONLY; The metadata related to the Primary Read-Write Key for the given Cosmos DB database account. + PrimaryMasterKey *AccountKeyMetadata `json:"primaryMasterKey,omitempty" azure:"ro"` - // The metadata related to the Primary Read-Only Key for the given Cosmos DB database account. - PrimaryReadonlyMasterKey *AccountKeyMetadata `json:"primaryReadonlyMasterKey,omitempty"` + // READ-ONLY; The metadata related to the Primary Read-Only Key for the given Cosmos DB database account. + PrimaryReadonlyMasterKey *AccountKeyMetadata `json:"primaryReadonlyMasterKey,omitempty" azure:"ro"` - // The metadata related to the Secondary Read-Write Key for the given Cosmos DB database account. - SecondaryMasterKey *AccountKeyMetadata `json:"secondaryMasterKey,omitempty"` + // READ-ONLY; The metadata related to the Secondary Read-Write Key for the given Cosmos DB database account. + SecondaryMasterKey *AccountKeyMetadata `json:"secondaryMasterKey,omitempty" azure:"ro"` - // The metadata related to the Secondary Read-Only Key for the given Cosmos DB database account. - SecondaryReadonlyMasterKey *AccountKeyMetadata `json:"secondaryReadonlyMasterKey,omitempty"` + // READ-ONLY; The metadata related to the Secondary Read-Only Key for the given Cosmos DB database account. + SecondaryReadonlyMasterKey *AccountKeyMetadata `json:"secondaryReadonlyMasterKey,omitempty" azure:"ro"` } // DatabaseAccountListConnectionStringsResult - The connection strings for the given database account. @@ -2000,9 +1493,6 @@ type DatabaseAccountUpdateProperties struct { // "SystemAssignedIdentity" and more. DefaultIdentity *string `json:"defaultIdentity,omitempty"` - // The Object representing the different Diagnostic log settings for the Cosmos DB Account. - DiagnosticLogSettings *DiagnosticLogSettings `json:"diagnosticLogSettings,omitempty"` - // Disable write operations on metadata resources (databases, containers, throughput) via account keys DisableKeyBasedMetadataWriteAccess *bool `json:"disableKeyBasedMetadataWriteAccess,omitempty"` @@ -2023,12 +1513,12 @@ type DatabaseAccountUpdateProperties struct { // Flag to indicate whether Free Tier is enabled. EnableFreeTier *bool `json:"enableFreeTier,omitempty"` - // Flag to indicate whether to enable MaterializedViews on the Cosmos DB account - EnableMaterializedViews *bool `json:"enableMaterializedViews,omitempty"` - // Enables the account to write in multiple locations EnableMultipleWriteLocations *bool `json:"enableMultipleWriteLocations,omitempty"` + // Flag to indicate enabling/disabling of Partition Merge feature on the account + EnablePartitionMerge *bool `json:"enablePartitionMerge,omitempty"` + // List of IpRules. IPRules []*IPAddressOrRange `json:"ipRules,omitempty"` @@ -2038,10 +1528,6 @@ type DatabaseAccountUpdateProperties struct { // The URI of the key vault KeyVaultKeyURI *string `json:"keyVaultKeyUri,omitempty"` - // 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. - KeysMetadata *DatabaseAccountKeysMetadata `json:"keysMetadata,omitempty"` - // An array that contains the georeplication locations enabled for the Cosmos DB account. Locations []*Location `json:"locations,omitempty"` @@ -2056,6 +1542,10 @@ type DatabaseAccountUpdateProperties struct { // List of Virtual Network ACL rules configured for the Cosmos DB account. VirtualNetworkRules []*VirtualNetworkRule `json:"virtualNetworkRules,omitempty"` + + // READ-ONLY; 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. + KeysMetadata *DatabaseAccountKeysMetadata `json:"keysMetadata,omitempty" azure:"ro"` } // DatabaseAccountsClientBeginCreateOrUpdateOptions contains the optional parameters for the DatabaseAccountsClient.BeginCreateOrUpdate @@ -2201,12 +1691,6 @@ type DatabaseRestoreResource struct { DatabaseName *string `json:"databaseName,omitempty"` } -// DiagnosticLogSettings - Indicates what diagnostic log settings are to be enabled. -type DiagnosticLogSettings struct { - // Describe the level of detail with which queries are to be logged. - EnableFullTextQuery *EnableFullTextQuery `json:"enableFullTextQuery,omitempty"` -} - // ErrorResponse - Error Response. type ErrorResponse struct { // Error code. @@ -2314,135 +1798,11 @@ func (g *GraphAPIComputeServiceResourceProperties) GetServiceResourceProperties( } } -// GraphResource - Cosmos DB Graph resource object -type GraphResource struct { - // REQUIRED; Name of the Cosmos DB Graph - ID *string `json:"id,omitempty"` -} - -// GraphResourceCreateUpdateParameters - Parameters to create and update Cosmos DB Graph resource. -type GraphResourceCreateUpdateParameters struct { - // REQUIRED; Properties to create and update Azure Cosmos DB Graph resource. - Properties *GraphResourceCreateUpdateProperties `json:"properties,omitempty"` - - // Identity for the resource. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - - // The location of the resource group to which the resource belongs. - Location *string `json:"location,omitempty"` - - // Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource - // (across resource groups). A maximum of 15 tags can be provided for a - // resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example, - // the default experience for a template type is set with "defaultExperience": - // "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; The unique resource identifier of the ARM resource. - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; The name of the ARM resource. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; The type of Azure resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// GraphResourceCreateUpdateProperties - Properties to create and update Azure Cosmos DB Graph resource. -type GraphResourceCreateUpdateProperties struct { - // REQUIRED; The standard JSON format of a Graph resource - Resource *GraphResource `json:"resource,omitempty"` - - // A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - Options *CreateUpdateOptions `json:"options,omitempty"` -} - -// GraphResourceGetProperties - The properties of an Azure Cosmos DB SQL database -type GraphResourceGetProperties struct { - Options *GraphResourceGetPropertiesOptions `json:"options,omitempty"` - Resource *GraphResourceGetPropertiesResource `json:"resource,omitempty"` -} - -type GraphResourceGetPropertiesOptions struct { - // Specifies the Autoscale settings. - AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"` - - // Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer - // details. - Throughput *int32 `json:"throughput,omitempty"` -} - -type GraphResourceGetPropertiesResource struct { - // REQUIRED; Name of the Cosmos DB Graph - ID *string `json:"id,omitempty"` -} - -// GraphResourceGetResults - An Azure Cosmos DB Graph resource. -type GraphResourceGetResults struct { - // Identity for the resource. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - - // The location of the resource group to which the resource belongs. - Location *string `json:"location,omitempty"` - - // The properties of an Azure Cosmos DB Graph resource. - Properties *GraphResourceGetProperties `json:"properties,omitempty"` - - // Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource - // (across resource groups). A maximum of 15 tags can be provided for a - // resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example, - // the default experience for a template type is set with "defaultExperience": - // "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; The unique resource identifier of the ARM resource. - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; The name of the ARM resource. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; The type of Azure resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// GraphResourcesClientBeginCreateUpdateGraphOptions contains the optional parameters for the GraphResourcesClient.BeginCreateUpdateGraph -// method. -type GraphResourcesClientBeginCreateUpdateGraphOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GraphResourcesClientBeginDeleteGraphResourceOptions contains the optional parameters for the GraphResourcesClient.BeginDeleteGraphResource -// method. -type GraphResourcesClientBeginDeleteGraphResourceOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GraphResourcesClientGetGraphOptions contains the optional parameters for the GraphResourcesClient.GetGraph method. -type GraphResourcesClientGetGraphOptions struct { - // placeholder for future optional parameters -} - -// GraphResourcesClientListGraphsOptions contains the optional parameters for the GraphResourcesClient.ListGraphs method. -type GraphResourcesClientListGraphsOptions struct { - // placeholder for future optional parameters -} - -// GraphResourcesListResult - The List operation response, that contains the Graph resource and their properties. -type GraphResourcesListResult struct { - // READ-ONLY; List of Graph resource and their properties. - Value []*GraphResourceGetResults `json:"value,omitempty" azure:"ro"` -} - // GremlinDatabaseCreateUpdateParameters - Parameters to create and update Cosmos DB Gremlin database. type GremlinDatabaseCreateUpdateParameters struct { // REQUIRED; Properties to create and update Azure Cosmos DB Gremlin database. Properties *GremlinDatabaseCreateUpdateProperties `json:"properties,omitempty"` - // Identity for the resource. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -2503,9 +1863,6 @@ type GremlinDatabaseGetPropertiesResource struct { // GremlinDatabaseGetResults - An Azure Cosmos DB Gremlin database. type GremlinDatabaseGetResults struct { - // Identity for the resource. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -2541,23 +1898,11 @@ type GremlinDatabaseResource struct { ID *string `json:"id,omitempty"` } -// GremlinDatabaseRestoreResource - Specific Gremlin Databases to restore. -type GremlinDatabaseRestoreResource struct { - // The name of the gremlin database available for restore. - DatabaseName *string `json:"databaseName,omitempty"` - - // The names of the graphs available for restore. - GraphNames []*string `json:"graphNames,omitempty"` -} - // GremlinGraphCreateUpdateParameters - Parameters to create and update Cosmos DB Gremlin graph. type GremlinGraphCreateUpdateParameters struct { // REQUIRED; Properties to create and update Azure Cosmos DB Gremlin graph. Properties *GremlinGraphCreateUpdateProperties `json:"properties,omitempty"` - // Identity for the resource. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -2637,9 +1982,6 @@ type GremlinGraphGetPropertiesResource struct { // GremlinGraphGetResults - An Azure Cosmos DB Gremlin graph. type GremlinGraphGetResults struct { - // Identity for the resource. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -2750,13 +2092,6 @@ type GremlinResourcesClientBeginMigrateGremlinGraphToManualThroughputOptions str ResumeToken string } -// GremlinResourcesClientBeginRetrieveContinuousBackupInformationOptions contains the optional parameters for the GremlinResourcesClient.BeginRetrieveContinuousBackupInformation -// method. -type GremlinResourcesClientBeginRetrieveContinuousBackupInformationOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - // GremlinResourcesClientBeginUpdateGremlinDatabaseThroughputOptions contains the optional parameters for the GremlinResourcesClient.BeginUpdateGremlinDatabaseThroughput // method. type GremlinResourcesClientBeginUpdateGremlinDatabaseThroughputOptions struct { @@ -2858,28 +2193,6 @@ type IndexingPolicy struct { SpatialIndexes []*SpatialSpec `json:"spatialIndexes,omitempty"` } -// KeyWrapMetadata - Represents key wrap metadata that a key wrapping provider can use to wrap/unwrap a client encryption -// key. -type KeyWrapMetadata struct { - // Algorithm used in wrapping and unwrapping of the data encryption key. - Algorithm *string `json:"algorithm,omitempty"` - - // The name of associated KeyEncryptionKey (aka CustomerManagedKey). - Name *string `json:"name,omitempty"` - - // ProviderName of KeyStoreProvider. - Type *string `json:"type,omitempty"` - - // Reference / link to the KeyEncryptionKey. - Value *string `json:"value,omitempty"` -} - -// ListBackups - List of restorable backups for a Cassandra cluster. -type ListBackups struct { - // READ-ONLY; Container for array of backups. - Value []*BackupResource `json:"value,omitempty" azure:"ro"` -} - // ListClusters - List of managed Cassandra clusters. type ListClusters struct { // Container for the array of clusters. @@ -2949,9 +2262,6 @@ type LocationProperties struct { // READ-ONLY; Flag indicating whether the location is residency sensitive. IsResidencyRestricted *bool `json:"isResidencyRestricted,omitempty" azure:"ro"` - // READ-ONLY; The current status of location in Azure. - Status *string `json:"status,omitempty" azure:"ro"` - // READ-ONLY; Flag indicating whether the location supports availability zones or not. SupportsAvailabilityZone *bool `json:"supportsAvailabilityZone,omitempty" azure:"ro"` } @@ -3087,12 +2397,6 @@ func (m *MaterializedViewsBuilderServiceResourceProperties) GetServiceResourcePr } } -// MergeParameters - The properties of an Azure Cosmos DB merge operations -type MergeParameters struct { - // Specifies whether the operation is a real merge operation or a simulation. - IsDryRun *bool `json:"isDryRun,omitempty"` -} - // Metric data type Metric struct { // READ-ONLY; The end time for the metric (ISO-8601 format). @@ -3188,9 +2492,6 @@ type MongoDBCollectionCreateUpdateParameters struct { // REQUIRED; Properties to create and update Azure Cosmos DB MongoDB collection. Properties *MongoDBCollectionCreateUpdateProperties `json:"properties,omitempty"` - // Identity for the resource. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -3260,9 +2561,6 @@ type MongoDBCollectionGetPropertiesResource struct { // MongoDBCollectionGetResults - An Azure Cosmos DB MongoDB collection. type MongoDBCollectionGetResults struct { - // Identity for the resource. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -3312,9 +2610,6 @@ type MongoDBDatabaseCreateUpdateParameters struct { // REQUIRED; Properties to create and update Azure Cosmos DB MongoDB database. Properties *MongoDBDatabaseCreateUpdateProperties `json:"properties,omitempty"` - // Identity for the resource. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -3375,9 +2670,6 @@ type MongoDBDatabaseGetPropertiesResource struct { // MongoDBDatabaseGetResults - An Azure Cosmos DB MongoDB database. type MongoDBDatabaseGetResults struct { - // Identity for the resource. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -3469,13 +2761,6 @@ type MongoDBResourcesClientBeginDeleteMongoUserDefinitionOptions struct { ResumeToken string } -// MongoDBResourcesClientBeginListMongoDBCollectionPartitionMergeOptions contains the optional parameters for the MongoDBResourcesClient.BeginListMongoDBCollectionPartitionMerge -// method. -type MongoDBResourcesClientBeginListMongoDBCollectionPartitionMergeOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - // MongoDBResourcesClientBeginMigrateMongoDBCollectionToAutoscaleOptions contains the optional parameters for the MongoDBResourcesClient.BeginMigrateMongoDBCollectionToAutoscale // method. type MongoDBResourcesClientBeginMigrateMongoDBCollectionToAutoscaleOptions struct { @@ -3504,20 +2789,6 @@ type MongoDBResourcesClientBeginMigrateMongoDBDatabaseToManualThroughputOptions ResumeToken string } -// MongoDBResourcesClientBeginMongoDBContainerRedistributeThroughputOptions contains the optional parameters for the MongoDBResourcesClient.BeginMongoDBContainerRedistributeThroughput -// method. -type MongoDBResourcesClientBeginMongoDBContainerRedistributeThroughputOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// MongoDBResourcesClientBeginMongoDBContainerRetrieveThroughputDistributionOptions contains the optional parameters for the -// MongoDBResourcesClient.BeginMongoDBContainerRetrieveThroughputDistribution method. -type MongoDBResourcesClientBeginMongoDBContainerRetrieveThroughputDistributionOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - // MongoDBResourcesClientBeginRetrieveContinuousBackupInformationOptions contains the optional parameters for the MongoDBResourcesClient.BeginRetrieveContinuousBackupInformation // method. type MongoDBResourcesClientBeginRetrieveContinuousBackupInformationOptions struct { @@ -4064,84 +3335,6 @@ type Permission struct { NotDataActions []*string `json:"notDataActions,omitempty"` } -// PhysicalPartitionID - PhysicalPartitionId object -type PhysicalPartitionID struct { - // REQUIRED; Id of a physical partition - ID *string `json:"id,omitempty"` -} - -// PhysicalPartitionStorageInfo - The storage of a physical partition -type PhysicalPartitionStorageInfo struct { - // READ-ONLY; The unique identifier of the partition. - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; The storage in KB for the physical partition. - StorageInKB *float64 `json:"storageInKB,omitempty" azure:"ro"` -} - -// PhysicalPartitionStorageInfoCollection - List of physical partitions and their properties returned by a merge operation. -type PhysicalPartitionStorageInfoCollection struct { - // READ-ONLY; List of physical partitions and their properties. - PhysicalPartitionStorageInfoCollection []*PhysicalPartitionStorageInfo `json:"physicalPartitionStorageInfoCollection,omitempty" azure:"ro"` -} - -// PhysicalPartitionThroughputInfoProperties - The properties of an Azure Cosmos DB PhysicalPartitionThroughputInfoProperties -// object -type PhysicalPartitionThroughputInfoProperties struct { - // Array of physical partition throughput info objects - PhysicalPartitionThroughputInfo []*PhysicalPartitionThroughputInfoResource `json:"physicalPartitionThroughputInfo,omitempty"` -} - -// PhysicalPartitionThroughputInfoResource - PhysicalPartitionThroughputInfo object -type PhysicalPartitionThroughputInfoResource struct { - // REQUIRED; Id of a physical partition - ID *string `json:"id,omitempty"` - - // Throughput of a physical partition - Throughput *float64 `json:"throughput,omitempty"` -} - -// PhysicalPartitionThroughputInfoResult - An Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. -type PhysicalPartitionThroughputInfoResult struct { - // Identity for the resource. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - - // The location of the resource group to which the resource belongs. - Location *string `json:"location,omitempty"` - - // The properties of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object - Properties *PhysicalPartitionThroughputInfoResultProperties `json:"properties,omitempty"` - - // Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource - // (across resource groups). A maximum of 15 tags can be provided for a - // resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example, - // the default experience for a template type is set with "defaultExperience": - // "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; The unique resource identifier of the ARM resource. - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; The name of the ARM resource. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; The type of Azure resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// PhysicalPartitionThroughputInfoResultProperties - The properties of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult -// object -type PhysicalPartitionThroughputInfoResultProperties struct { - // properties of physical partition throughput info - Resource *PhysicalPartitionThroughputInfoResultPropertiesResource `json:"resource,omitempty"` -} - -// PhysicalPartitionThroughputInfoResultPropertiesResource - properties of physical partition throughput info -type PhysicalPartitionThroughputInfoResultPropertiesResource struct { - // Array of physical partition throughput info objects - PhysicalPartitionThroughputInfo []*PhysicalPartitionThroughputInfoResource `json:"physicalPartitionThroughputInfo,omitempty"` -} - // PrivateEndpointConnection - A private endpoint connection type PrivateEndpointConnection struct { // Resource properties. @@ -4297,52 +3490,6 @@ type ProxyResource struct { Type *string `json:"type,omitempty" azure:"ro"` } -// RedistributeThroughputParameters - Cosmos DB redistribute throughput parameters object -type RedistributeThroughputParameters struct { - // REQUIRED; Properties to redistribute throughput parameters object - Properties *RedistributeThroughputProperties `json:"properties,omitempty"` - - // Identity for the resource. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - - // The location of the resource group to which the resource belongs. - Location *string `json:"location,omitempty"` - - // Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource - // (across resource groups). A maximum of 15 tags can be provided for a - // resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example, - // the default experience for a template type is set with "defaultExperience": - // "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; The unique resource identifier of the ARM resource. - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; The name of the ARM resource. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; The type of Azure resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// RedistributeThroughputProperties - Properties to redistribute throughput for Azure Cosmos DB resource. -type RedistributeThroughputProperties struct { - // REQUIRED; The standard JSON format of a resource throughput - Resource *RedistributeThroughputPropertiesResource `json:"resource,omitempty"` -} - -// RedistributeThroughputPropertiesResource - Resource to redistribute throughput for Azure Cosmos DB resource -type RedistributeThroughputPropertiesResource struct { - // REQUIRED; Array of PhysicalPartitionThroughputInfoResource objects. - SourcePhysicalPartitionThroughputInfo []*PhysicalPartitionThroughputInfoResource `json:"sourcePhysicalPartitionThroughputInfo,omitempty"` - - // REQUIRED; Array of PhysicalPartitionThroughputInfoResource objects. - TargetPhysicalPartitionThroughputInfo []*PhysicalPartitionThroughputInfoResource `json:"targetPhysicalPartitionThroughputInfo,omitempty"` - - // REQUIRED; ThroughputPolicy to apply for throughput redistribution - ThroughputPolicy *ThroughputPolicyType `json:"throughputPolicy,omitempty"` -} - // RegionForOnlineOffline - Cosmos DB region to online or offline. type RegionForOnlineOffline struct { // REQUIRED; Cosmos DB region, with spaces between words and each word capitalized. @@ -4402,9 +3549,6 @@ type RestorableDatabaseAccountProperties struct { // The time at which the restorable database account has been deleted (ISO-8601 format). DeletionTime *time.Time `json:"deletionTime,omitempty"` - // The least recent time at which the database account can be restored to (ISO-8601 format). - OldestRestorableTime *time.Time `json:"oldestRestorableTime,omitempty"` - // READ-ONLY; The API type of the restorable database account. APIType *APIType `json:"apiType,omitempty" azure:"ro"` @@ -4437,146 +3581,6 @@ type RestorableDatabaseAccountsListResult struct { Value []*RestorableDatabaseAccountGetResult `json:"value,omitempty" azure:"ro"` } -// RestorableGremlinDatabaseGetResult - An Azure Cosmos DB Gremlin database event -type RestorableGremlinDatabaseGetResult struct { - // The properties of a Gremlin database event. - Properties *RestorableGremlinDatabaseProperties `json:"properties,omitempty"` - - // READ-ONLY; The unique resource Identifier of the ARM resource. - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; The name of the ARM resource. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; The type of Azure resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// RestorableGremlinDatabaseProperties - The properties of an Azure Cosmos DB Gremlin database event -type RestorableGremlinDatabaseProperties struct { - // The resource of an Azure Cosmos DB Gremlin database event - Resource *RestorableGremlinDatabasePropertiesResource `json:"resource,omitempty"` -} - -// RestorableGremlinDatabasePropertiesResource - The resource of an Azure Cosmos DB Gremlin database event -type RestorableGremlinDatabasePropertiesResource struct { - // READ-ONLY; The time when this database event happened. - EventTimestamp *string `json:"eventTimestamp,omitempty" azure:"ro"` - - // READ-ONLY; The operation type of this database event. - OperationType *OperationType `json:"operationType,omitempty" azure:"ro"` - - // READ-ONLY; The name of this Gremlin database. - OwnerID *string `json:"ownerId,omitempty" azure:"ro"` - - // READ-ONLY; The resource ID of this Gremlin database. - OwnerResourceID *string `json:"ownerResourceId,omitempty" azure:"ro"` - - // READ-ONLY; A system generated property. A unique identifier. - Rid *string `json:"_rid,omitempty" azure:"ro"` -} - -// RestorableGremlinDatabasesClientListOptions contains the optional parameters for the RestorableGremlinDatabasesClient.List -// method. -type RestorableGremlinDatabasesClientListOptions struct { - // placeholder for future optional parameters -} - -// RestorableGremlinDatabasesListResult - The List operation response, that contains the Gremlin database events and their -// properties. -type RestorableGremlinDatabasesListResult struct { - // READ-ONLY; List of Gremlin database events and their properties. - Value []*RestorableGremlinDatabaseGetResult `json:"value,omitempty" azure:"ro"` -} - -// RestorableGremlinGraphGetResult - An Azure Cosmos DB Gremlin graph event -type RestorableGremlinGraphGetResult struct { - // The properties of a Gremlin graph event. - Properties *RestorableGremlinGraphProperties `json:"properties,omitempty"` - - // READ-ONLY; The unique resource Identifier of the ARM resource. - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; The name of the ARM resource. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; The type of Azure resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// RestorableGremlinGraphProperties - The properties of an Azure Cosmos DB Gremlin graph event -type RestorableGremlinGraphProperties struct { - // The resource of an Azure Cosmos DB Gremlin graph event - Resource *RestorableGremlinGraphPropertiesResource `json:"resource,omitempty"` -} - -// RestorableGremlinGraphPropertiesResource - The resource of an Azure Cosmos DB Gremlin graph event -type RestorableGremlinGraphPropertiesResource struct { - // READ-ONLY; The time when this graph event happened. - EventTimestamp *string `json:"eventTimestamp,omitempty" azure:"ro"` - - // READ-ONLY; The operation type of this graph event. - OperationType *OperationType `json:"operationType,omitempty" azure:"ro"` - - // READ-ONLY; The name of this Gremlin graph. - OwnerID *string `json:"ownerId,omitempty" azure:"ro"` - - // READ-ONLY; The resource ID of this Gremlin graph. - OwnerResourceID *string `json:"ownerResourceId,omitempty" azure:"ro"` - - // READ-ONLY; A system generated property. A unique identifier. - Rid *string `json:"_rid,omitempty" azure:"ro"` -} - -// RestorableGremlinGraphsClientListOptions contains the optional parameters for the RestorableGremlinGraphsClient.List method. -type RestorableGremlinGraphsClientListOptions struct { - // Restorable Gremlin graphs event feed end time. - EndTime *string - // The resource ID of the Gremlin database. - RestorableGremlinDatabaseRid *string - // Restorable Gremlin graphs event feed start time. - StartTime *string -} - -// RestorableGremlinGraphsListResult - The List operation response, that contains the Gremlin graph events and their properties. -type RestorableGremlinGraphsListResult struct { - // READ-ONLY; List of Gremlin graph events and their properties. - Value []*RestorableGremlinGraphGetResult `json:"value,omitempty" azure:"ro"` -} - -// RestorableGremlinResourcesClientListOptions contains the optional parameters for the RestorableGremlinResourcesClient.List -// method. -type RestorableGremlinResourcesClientListOptions struct { - // The location where the restorable resources are located. - RestoreLocation *string - // The timestamp when the restorable resources existed. - RestoreTimestampInUTC *string -} - -// RestorableGremlinResourcesGetResult - Specific Databases to restore. -type RestorableGremlinResourcesGetResult struct { - // The name of the gremlin database available for restore. - DatabaseName *string `json:"databaseName,omitempty"` - - // The names of the graphs available for restore. - GraphNames []*string `json:"graphNames,omitempty"` - - // READ-ONLY; The unique resource identifier of the ARM resource. - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; The name of the ARM resource. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; The type of Azure resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// RestorableGremlinResourcesListResult - The List operation response, that contains the restorable Gremlin resources. -type RestorableGremlinResourcesListResult struct { - // READ-ONLY; List of restorable Gremlin resources, including the gremlin database and graph names. - Value []*RestorableGremlinResourcesGetResult `json:"value,omitempty" azure:"ro"` -} - // RestorableLocationResource - Properties of the regional restorable account. type RestorableLocationResource struct { // READ-ONLY; The creation time of the regional restorable database account (ISO-8601 format). @@ -4634,12 +3638,8 @@ type RestorableMongodbCollectionPropertiesResource struct { // RestorableMongodbCollectionsClientListOptions contains the optional parameters for the RestorableMongodbCollectionsClient.List // method. type RestorableMongodbCollectionsClientListOptions struct { - // Restorable MongoDB collections event feed end time. - EndTime *string // The resource ID of the MongoDB database. RestorableMongodbDatabaseRid *string - // Restorable MongoDB collections event feed start time. - StartTime *string } // RestorableMongodbCollectionsListResult - The List operation response, that contains the MongoDB collection events and their @@ -4784,9 +3784,6 @@ type RestorableSQLContainerPropertiesResourceContainer struct { // Analytical TTL. AnalyticalStorageTTL *int64 `json:"analyticalStorageTtl,omitempty"` - // The client encryption policy for the container. - ClientEncryptionPolicy *ClientEncryptionPolicy `json:"clientEncryptionPolicy,omitempty"` - // The conflict resolution policy for the container. ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"` @@ -4818,11 +3815,11 @@ type RestorableSQLContainerPropertiesResourceContainer struct { // RestorableSQLContainersClientListOptions contains the optional parameters for the RestorableSQLContainersClient.List method. type RestorableSQLContainersClientListOptions struct { - // Restorable Sql containers event feed end time. + // The snapshot create timestamp before which snapshots need to be listed. EndTime *string // The resource ID of the SQL database. RestorableSQLDatabaseRid *string - // Restorable Sql containers event feed start time. + // The snapshot create timestamp after which snapshots need to be listed. StartTime *string } @@ -4941,94 +3938,11 @@ type RestorableSQLResourcesListResult struct { Value []*RestorableSQLResourcesGetResult `json:"value,omitempty" azure:"ro"` } -// RestorableTableGetResult - An Azure Cosmos DB Table event -type RestorableTableGetResult struct { - // The properties of a Table event. - Properties *RestorableTableProperties `json:"properties,omitempty"` - - // READ-ONLY; The unique resource Identifier of the ARM resource. - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; The name of the ARM resource. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; The type of Azure resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// RestorableTableProperties - The properties of an Azure Cosmos DB Table event -type RestorableTableProperties struct { - // The resource of an Azure Cosmos DB Table event - Resource *RestorableTablePropertiesResource `json:"resource,omitempty"` -} - -// RestorableTablePropertiesResource - The resource of an Azure Cosmos DB Table event -type RestorableTablePropertiesResource struct { - // READ-ONLY; The time when this table event happened. - EventTimestamp *string `json:"eventTimestamp,omitempty" azure:"ro"` - - // READ-ONLY; The operation type of this table event. - OperationType *OperationType `json:"operationType,omitempty" azure:"ro"` - - // READ-ONLY; The name of this Table. - OwnerID *string `json:"ownerId,omitempty" azure:"ro"` - - // READ-ONLY; The resource ID of this Table. - OwnerResourceID *string `json:"ownerResourceId,omitempty" azure:"ro"` - - // READ-ONLY; A system generated property. A unique identifier. - Rid *string `json:"_rid,omitempty" azure:"ro"` -} - -// RestorableTableResourcesClientListOptions contains the optional parameters for the RestorableTableResourcesClient.List -// method. -type RestorableTableResourcesClientListOptions struct { - // The location where the restorable resources are located. - RestoreLocation *string - // The timestamp when the restorable resources existed. - RestoreTimestampInUTC *string -} - -// RestorableTableResourcesGetResult - Specific Databases to restore. -type RestorableTableResourcesGetResult struct { - // READ-ONLY; The unique resource identifier of the ARM resource. - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; The name of the Table. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; The type of Azure resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// RestorableTableResourcesListResult - List of restorable table names. -type RestorableTableResourcesListResult struct { - // READ-ONLY; List of restorable table names. - Value []*RestorableTableResourcesGetResult `json:"value,omitempty" azure:"ro"` -} - -// RestorableTablesClientListOptions contains the optional parameters for the RestorableTablesClient.List method. -type RestorableTablesClientListOptions struct { - // Restorable Tables event feed end time. - EndTime *string - // Restorable Tables event feed start time. - StartTime *string -} - -// RestorableTablesListResult - The List operation response, that contains the Table events and their properties. -type RestorableTablesListResult struct { - // READ-ONLY; List of Table events and their properties. - Value []*RestorableTableGetResult `json:"value,omitempty" azure:"ro"` -} - // RestoreParameters - Parameters to indicate the information about the restore. type RestoreParameters struct { // List of specific databases available for restore. DatabasesToRestore []*DatabaseRestoreResource `json:"databasesToRestore,omitempty"` - // List of specific gremlin databases available for restore. - GremlinDatabasesToRestore []*GremlinDatabaseRestoreResource `json:"gremlinDatabasesToRestore,omitempty"` - // Describes the mode of the restore. RestoreMode *RestoreMode `json:"restoreMode,omitempty"` @@ -5038,49 +3952,6 @@ type RestoreParameters struct { // Time to which the account has to be restored (ISO-8601 format). RestoreTimestampInUTC *time.Time `json:"restoreTimestampInUtc,omitempty"` - - // List of specific tables available for restore. - TablesToRestore []*string `json:"tablesToRestore,omitempty"` -} - -// RetrieveThroughputParameters - Cosmos DB retrieve throughput parameters object -type RetrieveThroughputParameters struct { - // REQUIRED; Properties to retrieve throughput parameters object - Properties *RetrieveThroughputProperties `json:"properties,omitempty"` - - // Identity for the resource. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - - // The location of the resource group to which the resource belongs. - Location *string `json:"location,omitempty"` - - // Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource - // (across resource groups). A maximum of 15 tags can be provided for a - // resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example, - // the default experience for a template type is set with "defaultExperience": - // "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; The unique resource identifier of the ARM resource. - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; The name of the ARM resource. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; The type of Azure resource. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// RetrieveThroughputProperties - Properties to retrieve throughput for Azure Cosmos DB resource. -type RetrieveThroughputProperties struct { - // REQUIRED; The standard JSON format of a resource throughput - Resource *RetrieveThroughputPropertiesResource `json:"resource,omitempty"` -} - -// RetrieveThroughputPropertiesResource - Resource to retrieve throughput information for Cosmos DB resource -type RetrieveThroughputPropertiesResource struct { - // REQUIRED; Array of PhysicalPartitionId objects. - PhysicalPartitionIDs []*PhysicalPartitionID `json:"physicalPartitionIds,omitempty"` } // Role - The set of roles permitted through this Role Definition. @@ -5097,9 +3968,6 @@ type SQLContainerCreateUpdateParameters struct { // REQUIRED; Properties to create and update Azure Cosmos DB container. Properties *SQLContainerCreateUpdateProperties `json:"properties,omitempty"` - // Identity for the resource. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -5151,9 +4019,6 @@ type SQLContainerGetPropertiesResource struct { // Analytical TTL. AnalyticalStorageTTL *int64 `json:"analyticalStorageTtl,omitempty"` - // The client encryption policy for the container. - ClientEncryptionPolicy *ClientEncryptionPolicy `json:"clientEncryptionPolicy,omitempty"` - // The conflict resolution policy for the container. ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"` @@ -5182,9 +4047,6 @@ type SQLContainerGetPropertiesResource struct { // SQLContainerGetResults - An Azure Cosmos DB container. type SQLContainerGetResults struct { - // Identity for the resource. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -5222,9 +4084,6 @@ type SQLContainerResource struct { // Analytical TTL. AnalyticalStorageTTL *int64 `json:"analyticalStorageTtl,omitempty"` - // The client encryption policy for the container. - ClientEncryptionPolicy *ClientEncryptionPolicy `json:"clientEncryptionPolicy,omitempty"` - // The conflict resolution policy for the container. ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"` @@ -5242,33 +4101,11 @@ type SQLContainerResource struct { UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"` } -// SQLDataTransferDataSourceSink - A CosmosDB Cassandra API data source/sink -type SQLDataTransferDataSourceSink struct { - // REQUIRED - Component *DataTransferComponent `json:"component,omitempty"` - - // REQUIRED - ContainerName *string `json:"containerName,omitempty"` - - // REQUIRED - DatabaseName *string `json:"databaseName,omitempty"` -} - -// GetDataTransferDataSourceSink implements the DataTransferDataSourceSinkClassification interface for type SQLDataTransferDataSourceSink. -func (s *SQLDataTransferDataSourceSink) GetDataTransferDataSourceSink() *DataTransferDataSourceSink { - return &DataTransferDataSourceSink{ - Component: s.Component, - } -} - // SQLDatabaseCreateUpdateParameters - Parameters to create and update Cosmos DB SQL database. type SQLDatabaseCreateUpdateParameters struct { // REQUIRED; Properties to create and update Azure Cosmos DB SQL database. Properties *SQLDatabaseCreateUpdateProperties `json:"properties,omitempty"` - // Identity for the resource. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -5335,9 +4172,6 @@ type SQLDatabaseGetPropertiesResource struct { // SQLDatabaseGetResults - An Azure Cosmos DB SQL database. type SQLDatabaseGetResults struct { - // Identity for the resource. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -5433,13 +4267,6 @@ func (s *SQLDedicatedGatewayServiceResourceProperties) GetServiceResourcePropert } } -// SQLResourcesClientBeginCreateUpdateClientEncryptionKeyOptions contains the optional parameters for the SQLResourcesClient.BeginCreateUpdateClientEncryptionKey -// method. -type SQLResourcesClientBeginCreateUpdateClientEncryptionKeyOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - // SQLResourcesClientBeginCreateUpdateSQLContainerOptions contains the optional parameters for the SQLResourcesClient.BeginCreateUpdateSQLContainer // method. type SQLResourcesClientBeginCreateUpdateSQLContainerOptions struct { @@ -5538,13 +4365,6 @@ type SQLResourcesClientBeginDeleteSQLUserDefinedFunctionOptions struct { ResumeToken string } -// SQLResourcesClientBeginListSQLContainerPartitionMergeOptions contains the optional parameters for the SQLResourcesClient.BeginListSQLContainerPartitionMerge -// method. -type SQLResourcesClientBeginListSQLContainerPartitionMergeOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - // SQLResourcesClientBeginMigrateSQLContainerToAutoscaleOptions contains the optional parameters for the SQLResourcesClient.BeginMigrateSQLContainerToAutoscale // method. type SQLResourcesClientBeginMigrateSQLContainerToAutoscaleOptions struct { @@ -5580,20 +4400,6 @@ type SQLResourcesClientBeginRetrieveContinuousBackupInformationOptions struct { ResumeToken string } -// SQLResourcesClientBeginSQLContainerRedistributeThroughputOptions contains the optional parameters for the SQLResourcesClient.BeginSQLContainerRedistributeThroughput -// method. -type SQLResourcesClientBeginSQLContainerRedistributeThroughputOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SQLResourcesClientBeginSQLContainerRetrieveThroughputDistributionOptions contains the optional parameters for the SQLResourcesClient.BeginSQLContainerRetrieveThroughputDistribution -// method. -type SQLResourcesClientBeginSQLContainerRetrieveThroughputDistributionOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - // SQLResourcesClientBeginUpdateSQLContainerThroughputOptions contains the optional parameters for the SQLResourcesClient.BeginUpdateSQLContainerThroughput // method. type SQLResourcesClientBeginUpdateSQLContainerThroughputOptions struct { @@ -5608,12 +4414,6 @@ type SQLResourcesClientBeginUpdateSQLDatabaseThroughputOptions struct { ResumeToken string } -// SQLResourcesClientGetClientEncryptionKeyOptions contains the optional parameters for the SQLResourcesClient.GetClientEncryptionKey -// method. -type SQLResourcesClientGetClientEncryptionKeyOptions struct { - // placeholder for future optional parameters -} - // SQLResourcesClientGetSQLContainerOptions contains the optional parameters for the SQLResourcesClient.GetSQLContainer method. type SQLResourcesClientGetSQLContainerOptions struct { // placeholder for future optional parameters @@ -5665,12 +4465,6 @@ type SQLResourcesClientGetSQLUserDefinedFunctionOptions struct { // placeholder for future optional parameters } -// SQLResourcesClientListClientEncryptionKeysOptions contains the optional parameters for the SQLResourcesClient.ListClientEncryptionKeys -// method. -type SQLResourcesClientListClientEncryptionKeysOptions struct { - // placeholder for future optional parameters -} - // SQLResourcesClientListSQLContainersOptions contains the optional parameters for the SQLResourcesClient.ListSQLContainers // method. type SQLResourcesClientListSQLContainersOptions struct { @@ -5804,9 +4598,6 @@ type SQLStoredProcedureCreateUpdateParameters struct { // REQUIRED; Properties to create and update Azure Cosmos DB storedProcedure. Properties *SQLStoredProcedureCreateUpdateProperties `json:"properties,omitempty"` - // Identity for the resource. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -5860,9 +4651,6 @@ type SQLStoredProcedureGetPropertiesResource struct { // SQLStoredProcedureGetResults - An Azure Cosmos DB storedProcedure. type SQLStoredProcedureGetResults struct { - // Identity for the resource. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -5906,9 +4694,6 @@ type SQLTriggerCreateUpdateParameters struct { // REQUIRED; Properties to create and update Azure Cosmos DB trigger. Properties *SQLTriggerCreateUpdateProperties `json:"properties,omitempty"` - // Identity for the resource. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -5968,9 +4753,6 @@ type SQLTriggerGetPropertiesResource struct { // SQLTriggerGetResults - An Azure Cosmos DB trigger. type SQLTriggerGetResults struct { - // Identity for the resource. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -6020,9 +4802,6 @@ type SQLUserDefinedFunctionCreateUpdateParameters struct { // REQUIRED; Properties to create and update Azure Cosmos DB userDefinedFunction. Properties *SQLUserDefinedFunctionCreateUpdateProperties `json:"properties,omitempty"` - // Identity for the resource. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -6076,9 +4855,6 @@ type SQLUserDefinedFunctionGetPropertiesResource struct { // SQLUserDefinedFunctionGetResults - An Azure Cosmos DB userDefinedFunction. type SQLUserDefinedFunctionGetResults struct { - // Identity for the resource. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -6253,9 +5029,6 @@ type TableCreateUpdateParameters struct { // REQUIRED; Properties to create and update Azure Cosmos DB Table. Properties *TableCreateUpdateProperties `json:"properties,omitempty"` - // Identity for the resource. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -6316,9 +5089,6 @@ type TableGetPropertiesResource struct { // TableGetResults - An Azure Cosmos DB Table. type TableGetResults struct { - // Identity for the resource. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -6382,13 +5152,6 @@ type TableResourcesClientBeginMigrateTableToManualThroughputOptions struct { ResumeToken string } -// TableResourcesClientBeginRetrieveContinuousBackupInformationOptions contains the optional parameters for the TableResourcesClient.BeginRetrieveContinuousBackupInformation -// method. -type TableResourcesClientBeginRetrieveContinuousBackupInformationOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - // TableResourcesClientBeginUpdateTableThroughputOptions contains the optional parameters for the TableResourcesClient.BeginUpdateTableThroughput // method. type TableResourcesClientBeginUpdateTableThroughputOptions struct { @@ -6451,9 +5214,6 @@ type ThroughputSettingsGetPropertiesResource struct { // ThroughputSettingsGetResults - An Azure Cosmos DB resource throughput. type ThroughputSettingsGetResults struct { - // Identity for the resource. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -6498,9 +5258,6 @@ type ThroughputSettingsUpdateParameters struct { // REQUIRED; Properties to update Azure Cosmos DB resource throughput. Properties *ThroughputSettingsUpdateProperties `json:"properties,omitempty"` - // Identity for the resource. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` diff --git a/sdk/resourcemanager/cosmos/armcosmos/models_serde.go b/sdk/resourcemanager/cosmos/armcosmos/models_serde.go index 2fb514f0f317..192e375a2da4 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/models_serde.go +++ b/sdk/resourcemanager/cosmos/armcosmos/models_serde.go @@ -13,7 +13,6 @@ import ( "encoding/json" "fmt" "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "reflect" ) @@ -83,7 +82,6 @@ func (a *ARMProxyResource) UnmarshalJSON(data []byte) error { func (a ARMResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", a.ID) - populate(objectMap, "identity", a.Identity) populate(objectMap, "location", a.Location) populate(objectMap, "name", a.Name) populate(objectMap, "tags", a.Tags) @@ -103,9 +101,6 @@ func (a *ARMResourceProperties) UnmarshalJSON(data []byte) error { case "id": err = unpopulate(val, "ID", &a.ID) delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &a.Identity) - delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &a.Location) delete(rawMsg, key) @@ -180,57 +175,6 @@ func (a *AnalyticalStorageConfiguration) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AuthenticationMethodLdapProperties. -func (a AuthenticationMethodLdapProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "searchBaseDistinguishedName", a.SearchBaseDistinguishedName) - populate(objectMap, "searchFilterTemplate", a.SearchFilterTemplate) - populate(objectMap, "serverCertificates", a.ServerCertificates) - populate(objectMap, "serverHostname", a.ServerHostname) - populate(objectMap, "serverPort", a.ServerPort) - populate(objectMap, "serviceUserDistinguishedName", a.ServiceUserDistinguishedName) - populate(objectMap, "serviceUserPassword", a.ServiceUserPassword) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AuthenticationMethodLdapProperties. -func (a *AuthenticationMethodLdapProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "searchBaseDistinguishedName": - err = unpopulate(val, "SearchBaseDistinguishedName", &a.SearchBaseDistinguishedName) - delete(rawMsg, key) - case "searchFilterTemplate": - err = unpopulate(val, "SearchFilterTemplate", &a.SearchFilterTemplate) - delete(rawMsg, key) - case "serverCertificates": - err = unpopulate(val, "ServerCertificates", &a.ServerCertificates) - delete(rawMsg, key) - case "serverHostname": - err = unpopulate(val, "ServerHostname", &a.ServerHostname) - delete(rawMsg, key) - case "serverPort": - err = unpopulate(val, "ServerPort", &a.ServerPort) - delete(rawMsg, key) - case "serviceUserDistinguishedName": - err = unpopulate(val, "ServiceUserDistinguishedName", &a.ServiceUserDistinguishedName) - delete(rawMsg, key) - case "serviceUserPassword": - err = unpopulate(val, "ServiceUserPassword", &a.ServiceUserPassword) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type AutoUpgradePolicyResource. func (a AutoUpgradePolicyResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -320,41 +264,6 @@ func (a *AutoscaleSettingsResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureBlobDataTransferDataSourceSink. -func (a AzureBlobDataTransferDataSourceSink) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["component"] = DataTransferComponentAzureBlobStorage - populate(objectMap, "containerName", a.ContainerName) - populate(objectMap, "endpointUrl", a.EndpointURL) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureBlobDataTransferDataSourceSink. -func (a *AzureBlobDataTransferDataSourceSink) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "component": - err = unpopulate(val, "Component", &a.Component) - delete(rawMsg, key) - case "containerName": - err = unpopulate(val, "ContainerName", &a.ContainerName) - delete(rawMsg, key) - case "endpointUrl": - err = unpopulate(val, "EndpointURL", &a.EndpointURL) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type BackupInformation. func (b BackupInformation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -448,72 +357,6 @@ func (b *BackupPolicyMigrationState) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type BackupResource. -func (b BackupResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", b.ID) - populate(objectMap, "name", b.Name) - populate(objectMap, "properties", b.Properties) - populate(objectMap, "type", b.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BackupResource. -func (b *BackupResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &b.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &b.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &b.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &b.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BackupResourceProperties. -func (b BackupResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "timestamp", b.Timestamp) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BackupResourceProperties. -func (b *BackupResourceProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "timestamp": - err = unpopulateTimeRFC3339(val, "Timestamp", &b.Timestamp) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type Capability. func (c Capability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -642,46 +485,10 @@ func (c *CassandraClusterPublicStatusDataCentersItem) UnmarshalJSON(data []byte) return nil } -// MarshalJSON implements the json.Marshaller interface for type CassandraDataTransferDataSourceSink. -func (c CassandraDataTransferDataSourceSink) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["component"] = DataTransferComponentCosmosDBCassandra - populate(objectMap, "keyspaceName", c.KeyspaceName) - populate(objectMap, "tableName", c.TableName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CassandraDataTransferDataSourceSink. -func (c *CassandraDataTransferDataSourceSink) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "component": - err = unpopulate(val, "Component", &c.Component) - delete(rawMsg, key) - case "keyspaceName": - err = unpopulate(val, "KeyspaceName", &c.KeyspaceName) - delete(rawMsg, key) - case "tableName": - err = unpopulate(val, "TableName", &c.TableName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type CassandraKeyspaceCreateUpdateParameters. func (c CassandraKeyspaceCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", c.ID) - populate(objectMap, "identity", c.Identity) populate(objectMap, "location", c.Location) populate(objectMap, "name", c.Name) populate(objectMap, "properties", c.Properties) @@ -702,9 +509,6 @@ func (c *CassandraKeyspaceCreateUpdateParameters) UnmarshalJSON(data []byte) err case "id": err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &c.Identity) - delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &c.Location) delete(rawMsg, key) @@ -864,7 +668,6 @@ func (c *CassandraKeyspaceGetPropertiesResource) UnmarshalJSON(data []byte) erro func (c CassandraKeyspaceGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", c.ID) - populate(objectMap, "identity", c.Identity) populate(objectMap, "location", c.Location) populate(objectMap, "name", c.Name) populate(objectMap, "properties", c.Properties) @@ -885,9 +688,6 @@ func (c *CassandraKeyspaceGetResults) UnmarshalJSON(data []byte) error { case "id": err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &c.Identity) - delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &c.Location) delete(rawMsg, key) @@ -1031,7 +831,6 @@ func (c *CassandraSchema) UnmarshalJSON(data []byte) error { func (c CassandraTableCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", c.ID) - populate(objectMap, "identity", c.Identity) populate(objectMap, "location", c.Location) populate(objectMap, "name", c.Name) populate(objectMap, "properties", c.Properties) @@ -1052,9 +851,6 @@ func (c *CassandraTableCreateUpdateParameters) UnmarshalJSON(data []byte) error case "id": err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &c.Identity) - delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &c.Location) delete(rawMsg, key) @@ -1226,7 +1022,6 @@ func (c *CassandraTableGetPropertiesResource) UnmarshalJSON(data []byte) error { func (c CassandraTableGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", c.ID) - populate(objectMap, "identity", c.Identity) populate(objectMap, "location", c.Location) populate(objectMap, "name", c.Name) populate(objectMap, "properties", c.Properties) @@ -1247,9 +1042,6 @@ func (c *CassandraTableGetResults) UnmarshalJSON(data []byte) error { case "id": err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &c.Identity) - delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &c.Location) delete(rawMsg, key) @@ -1339,21 +1131,15 @@ func (c *CassandraTableResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CassandraViewCreateUpdateParameters. -func (c CassandraViewCreateUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Certificate. +func (c Certificate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "id", c.ID) - populate(objectMap, "identity", c.Identity) - populate(objectMap, "location", c.Location) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "tags", c.Tags) - populate(objectMap, "type", c.Type) + populate(objectMap, "pem", c.Pem) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CassandraViewCreateUpdateParameters. -func (c *CassandraViewCreateUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Certificate. +func (c *Certificate) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -1361,26 +1147,8 @@ func (c *CassandraViewCreateUpdateParameters) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &c.Identity) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &c.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &c.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "pem": + err = unpopulate(val, "Pem", &c.Pem) delete(rawMsg, key) } if err != nil { @@ -1390,16 +1158,15 @@ func (c *CassandraViewCreateUpdateParameters) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CassandraViewCreateUpdateProperties. -func (c CassandraViewCreateUpdateProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CloudError. +func (c CloudError) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "options", c.Options) - populate(objectMap, "resource", c.Resource) + populate(objectMap, "error", c.Error) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CassandraViewCreateUpdateProperties. -func (c *CassandraViewCreateUpdateProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudError. +func (c *CloudError) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -1407,11 +1174,8 @@ func (c *CassandraViewCreateUpdateProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "options": - err = unpopulate(val, "Options", &c.Options) - delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &c.Resource) + case "error": + err = unpopulate(val, "Error", &c.Error) delete(rawMsg, key) } if err != nil { @@ -1421,16 +1185,16 @@ func (c *CassandraViewCreateUpdateProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CassandraViewGetProperties. -func (c CassandraViewGetProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ClusterKey. +func (c ClusterKey) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "options", c.Options) - populate(objectMap, "resource", c.Resource) + populate(objectMap, "name", c.Name) + populate(objectMap, "orderBy", c.OrderBy) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CassandraViewGetProperties. -func (c *CassandraViewGetProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterKey. +func (c *ClusterKey) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -1438,11 +1202,11 @@ func (c *CassandraViewGetProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "options": - err = unpopulate(val, "Options", &c.Options) + case "name": + err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &c.Resource) + case "orderBy": + err = unpopulate(val, "OrderBy", &c.OrderBy) delete(rawMsg, key) } if err != nil { @@ -1452,16 +1216,21 @@ func (c *CassandraViewGetProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CassandraViewGetPropertiesOptions. -func (c CassandraViewGetPropertiesOptions) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ClusterResource. +func (c ClusterResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "autoscaleSettings", c.AutoscaleSettings) - populate(objectMap, "throughput", c.Throughput) + populate(objectMap, "id", c.ID) + populate(objectMap, "identity", c.Identity) + populate(objectMap, "location", c.Location) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "tags", c.Tags) + populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CassandraViewGetPropertiesOptions. -func (c *CassandraViewGetPropertiesOptions) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterResource. +func (c *ClusterResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -1469,11 +1238,26 @@ func (c *CassandraViewGetPropertiesOptions) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "autoscaleSettings": - err = unpopulate(val, "AutoscaleSettings", &c.AutoscaleSettings) + case "id": + err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) - case "throughput": - err = unpopulate(val, "Throughput", &c.Throughput) + case "identity": + err = unpopulate(val, "Identity", &c.Identity) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &c.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &c.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) } if err != nil { @@ -1483,40 +1267,88 @@ func (c *CassandraViewGetPropertiesOptions) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CassandraViewGetPropertiesResource. -func (c CassandraViewGetPropertiesResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ClusterResourceProperties. +func (c ClusterResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "_etag", c.Etag) - populate(objectMap, "id", c.ID) - populate(objectMap, "_rid", c.Rid) - populate(objectMap, "_ts", c.Ts) - populate(objectMap, "viewDefinition", c.ViewDefinition) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CassandraViewGetPropertiesResource. -func (c *CassandraViewGetPropertiesResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "_etag": - err = unpopulate(val, "Etag", &c.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &c.ID) + populate(objectMap, "authenticationMethod", c.AuthenticationMethod) + populate(objectMap, "cassandraAuditLoggingEnabled", c.CassandraAuditLoggingEnabled) + populate(objectMap, "cassandraVersion", c.CassandraVersion) + populate(objectMap, "clientCertificates", c.ClientCertificates) + populate(objectMap, "clusterNameOverride", c.ClusterNameOverride) + populate(objectMap, "deallocated", c.Deallocated) + populate(objectMap, "delegatedManagementSubnetId", c.DelegatedManagementSubnetID) + populate(objectMap, "externalGossipCertificates", c.ExternalGossipCertificates) + populate(objectMap, "externalSeedNodes", c.ExternalSeedNodes) + populate(objectMap, "gossipCertificates", c.GossipCertificates) + populate(objectMap, "hoursBetweenBackups", c.HoursBetweenBackups) + populate(objectMap, "initialCassandraAdminPassword", c.InitialCassandraAdminPassword) + populate(objectMap, "prometheusEndpoint", c.PrometheusEndpoint) + populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "repairEnabled", c.RepairEnabled) + populate(objectMap, "restoreFromBackupId", c.RestoreFromBackupID) + populate(objectMap, "seedNodes", c.SeedNodes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterResourceProperties. +func (c *ClusterResourceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "authenticationMethod": + err = unpopulate(val, "AuthenticationMethod", &c.AuthenticationMethod) delete(rawMsg, key) - case "_rid": - err = unpopulate(val, "Rid", &c.Rid) + case "cassandraAuditLoggingEnabled": + err = unpopulate(val, "CassandraAuditLoggingEnabled", &c.CassandraAuditLoggingEnabled) delete(rawMsg, key) - case "_ts": - err = unpopulate(val, "Ts", &c.Ts) + case "cassandraVersion": + err = unpopulate(val, "CassandraVersion", &c.CassandraVersion) + delete(rawMsg, key) + case "clientCertificates": + err = unpopulate(val, "ClientCertificates", &c.ClientCertificates) + delete(rawMsg, key) + case "clusterNameOverride": + err = unpopulate(val, "ClusterNameOverride", &c.ClusterNameOverride) + delete(rawMsg, key) + case "deallocated": + err = unpopulate(val, "Deallocated", &c.Deallocated) + delete(rawMsg, key) + case "delegatedManagementSubnetId": + err = unpopulate(val, "DelegatedManagementSubnetID", &c.DelegatedManagementSubnetID) + delete(rawMsg, key) + case "externalGossipCertificates": + err = unpopulate(val, "ExternalGossipCertificates", &c.ExternalGossipCertificates) + delete(rawMsg, key) + case "externalSeedNodes": + err = unpopulate(val, "ExternalSeedNodes", &c.ExternalSeedNodes) + delete(rawMsg, key) + case "gossipCertificates": + err = unpopulate(val, "GossipCertificates", &c.GossipCertificates) + delete(rawMsg, key) + case "hoursBetweenBackups": + err = unpopulate(val, "HoursBetweenBackups", &c.HoursBetweenBackups) + delete(rawMsg, key) + case "initialCassandraAdminPassword": + err = unpopulate(val, "InitialCassandraAdminPassword", &c.InitialCassandraAdminPassword) + delete(rawMsg, key) + case "prometheusEndpoint": + err = unpopulate(val, "PrometheusEndpoint", &c.PrometheusEndpoint) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + case "repairEnabled": + err = unpopulate(val, "RepairEnabled", &c.RepairEnabled) + delete(rawMsg, key) + case "restoreFromBackupId": + err = unpopulate(val, "RestoreFromBackupID", &c.RestoreFromBackupID) delete(rawMsg, key) - case "viewDefinition": - err = unpopulate(val, "ViewDefinition", &c.ViewDefinition) + case "seedNodes": + err = unpopulate(val, "SeedNodes", &c.SeedNodes) delete(rawMsg, key) } if err != nil { @@ -1526,21 +1358,16 @@ func (c *CassandraViewGetPropertiesResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CassandraViewGetResults. -func (c CassandraViewGetResults) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Column. +func (c Column) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "id", c.ID) - populate(objectMap, "identity", c.Identity) - populate(objectMap, "location", c.Location) populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "tags", c.Tags) populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CassandraViewGetResults. -func (c *CassandraViewGetResults) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Column. +func (c *Column) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -1548,24 +1375,9 @@ func (c *CassandraViewGetResults) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &c.Identity) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &c.Location) - delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &c.Tags) - delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) @@ -1577,15 +1389,15 @@ func (c *CassandraViewGetResults) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CassandraViewListResult. -func (c CassandraViewListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CommandOutput. +func (c CommandOutput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "value", c.Value) + populate(objectMap, "commandOutput", c.CommandOutput) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CassandraViewListResult. -func (c *CassandraViewListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CommandOutput. +func (c *CommandOutput) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -1593,8 +1405,8 @@ func (c *CassandraViewListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &c.Value) + case "commandOutput": + err = unpopulate(val, "CommandOutput", &c.CommandOutput) delete(rawMsg, key) } if err != nil { @@ -1604,16 +1416,19 @@ func (c *CassandraViewListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CassandraViewResource. -func (c CassandraViewResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CommandPostBody. +func (c CommandPostBody) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "id", c.ID) - populate(objectMap, "viewDefinition", c.ViewDefinition) + populate(objectMap, "arguments", c.Arguments) + populate(objectMap, "cassandra-stop-start", c.CassandraStopStart) + populate(objectMap, "command", c.Command) + populate(objectMap, "host", c.Host) + populate(objectMap, "readwrite", c.Readwrite) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CassandraViewResource. -func (c *CassandraViewResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CommandPostBody. +func (c *CommandPostBody) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -1621,11 +1436,20 @@ func (c *CassandraViewResource) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &c.ID) + case "arguments": + err = unpopulate(val, "Arguments", &c.Arguments) + delete(rawMsg, key) + case "cassandra-stop-start": + err = unpopulate(val, "CassandraStopStart", &c.CassandraStopStart) + delete(rawMsg, key) + case "command": + err = unpopulate(val, "Command", &c.Command) delete(rawMsg, key) - case "viewDefinition": - err = unpopulate(val, "ViewDefinition", &c.ViewDefinition) + case "host": + err = unpopulate(val, "Host", &c.Host) + delete(rawMsg, key) + case "readwrite": + err = unpopulate(val, "Readwrite", &c.Readwrite) delete(rawMsg, key) } if err != nil { @@ -1635,15 +1459,16 @@ func (c *CassandraViewResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Certificate. -func (c Certificate) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties. +func (c Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "pem", c.Pem) + populate(objectMap, "clientId", c.ClientID) + populate(objectMap, "principalId", c.PrincipalID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Certificate. -func (c *Certificate) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties. +func (c *Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -1651,8 +1476,11 @@ func (c *Certificate) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "pem": - err = unpopulate(val, "Pem", &c.Pem) + case "clientId": + err = unpopulate(val, "ClientID", &c.ClientID) + delete(rawMsg, key) + case "principalId": + err = unpopulate(val, "PrincipalID", &c.PrincipalID) delete(rawMsg, key) } if err != nil { @@ -1662,18 +1490,30 @@ func (c *Certificate) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ClientEncryptionIncludedPath. -func (c ClientEncryptionIncludedPath) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ComponentsM9L909SchemasCassandraclusterpublicstatusPropertiesDatacentersItemsPropertiesNodesItems. +func (c ComponentsM9L909SchemasCassandraclusterpublicstatusPropertiesDatacentersItemsPropertiesNodesItems) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "clientEncryptionKeyId", c.ClientEncryptionKeyID) - populate(objectMap, "encryptionAlgorithm", c.EncryptionAlgorithm) - populate(objectMap, "encryptionType", c.EncryptionType) - populate(objectMap, "path", c.Path) + populate(objectMap, "address", c.Address) + populate(objectMap, "cpuUsage", c.CPUUsage) + populate(objectMap, "diskFreeKB", c.DiskFreeKB) + populate(objectMap, "diskUsedKB", c.DiskUsedKB) + populate(objectMap, "hostID", c.HostID) + populate(objectMap, "load", c.Load) + populate(objectMap, "memoryBuffersAndCachedKB", c.MemoryBuffersAndCachedKB) + populate(objectMap, "memoryFreeKB", c.MemoryFreeKB) + populate(objectMap, "memoryTotalKB", c.MemoryTotalKB) + populate(objectMap, "memoryUsedKB", c.MemoryUsedKB) + populate(objectMap, "rack", c.Rack) + populate(objectMap, "size", c.Size) + populate(objectMap, "state", c.State) + populate(objectMap, "status", c.Status) + populate(objectMap, "timestamp", c.Timestamp) + populate(objectMap, "tokens", c.Tokens) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ClientEncryptionIncludedPath. -func (c *ClientEncryptionIncludedPath) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentsM9L909SchemasCassandraclusterpublicstatusPropertiesDatacentersItemsPropertiesNodesItems. +func (c *ComponentsM9L909SchemasCassandraclusterpublicstatusPropertiesDatacentersItemsPropertiesNodesItems) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -1681,17 +1521,53 @@ func (c *ClientEncryptionIncludedPath) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "clientEncryptionKeyId": - err = unpopulate(val, "ClientEncryptionKeyID", &c.ClientEncryptionKeyID) + case "address": + err = unpopulate(val, "Address", &c.Address) + delete(rawMsg, key) + case "cpuUsage": + err = unpopulate(val, "CPUUsage", &c.CPUUsage) delete(rawMsg, key) - case "encryptionAlgorithm": - err = unpopulate(val, "EncryptionAlgorithm", &c.EncryptionAlgorithm) + case "diskFreeKB": + err = unpopulate(val, "DiskFreeKB", &c.DiskFreeKB) delete(rawMsg, key) - case "encryptionType": - err = unpopulate(val, "EncryptionType", &c.EncryptionType) + case "diskUsedKB": + err = unpopulate(val, "DiskUsedKB", &c.DiskUsedKB) delete(rawMsg, key) - case "path": - err = unpopulate(val, "Path", &c.Path) + case "hostID": + err = unpopulate(val, "HostID", &c.HostID) + delete(rawMsg, key) + case "load": + err = unpopulate(val, "Load", &c.Load) + delete(rawMsg, key) + case "memoryBuffersAndCachedKB": + err = unpopulate(val, "MemoryBuffersAndCachedKB", &c.MemoryBuffersAndCachedKB) + delete(rawMsg, key) + case "memoryFreeKB": + err = unpopulate(val, "MemoryFreeKB", &c.MemoryFreeKB) + delete(rawMsg, key) + case "memoryTotalKB": + err = unpopulate(val, "MemoryTotalKB", &c.MemoryTotalKB) + delete(rawMsg, key) + case "memoryUsedKB": + err = unpopulate(val, "MemoryUsedKB", &c.MemoryUsedKB) + delete(rawMsg, key) + case "rack": + err = unpopulate(val, "Rack", &c.Rack) + delete(rawMsg, key) + case "size": + err = unpopulate(val, "Size", &c.Size) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &c.State) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &c.Status) + delete(rawMsg, key) + case "timestamp": + err = unpopulate(val, "Timestamp", &c.Timestamp) + delete(rawMsg, key) + case "tokens": + err = unpopulate(val, "Tokens", &c.Tokens) delete(rawMsg, key) } if err != nil { @@ -1701,15 +1577,16 @@ func (c *ClientEncryptionIncludedPath) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ClientEncryptionKeyCreateUpdateParameters. -func (c ClientEncryptionKeyCreateUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CompositePath. +func (c CompositePath) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "properties", c.Properties) + populate(objectMap, "order", c.Order) + populate(objectMap, "path", c.Path) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ClientEncryptionKeyCreateUpdateParameters. -func (c *ClientEncryptionKeyCreateUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CompositePath. +func (c *CompositePath) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -1717,8 +1594,11 @@ func (c *ClientEncryptionKeyCreateUpdateParameters) UnmarshalJSON(data []byte) e for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &c.Properties) + case "order": + err = unpopulate(val, "Order", &c.Order) + delete(rawMsg, key) + case "path": + err = unpopulate(val, "Path", &c.Path) delete(rawMsg, key) } if err != nil { @@ -1728,15 +1608,17 @@ func (c *ClientEncryptionKeyCreateUpdateParameters) UnmarshalJSON(data []byte) e return nil } -// MarshalJSON implements the json.Marshaller interface for type ClientEncryptionKeyCreateUpdateProperties. -func (c ClientEncryptionKeyCreateUpdateProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ConflictResolutionPolicy. +func (c ConflictResolutionPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "resource", c.Resource) + populate(objectMap, "conflictResolutionPath", c.ConflictResolutionPath) + populate(objectMap, "conflictResolutionProcedure", c.ConflictResolutionProcedure) + populate(objectMap, "mode", c.Mode) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ClientEncryptionKeyCreateUpdateProperties. -func (c *ClientEncryptionKeyCreateUpdateProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ConflictResolutionPolicy. +func (c *ConflictResolutionPolicy) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -1744,26 +1626,36 @@ func (c *ClientEncryptionKeyCreateUpdateProperties) UnmarshalJSON(data []byte) e for key, val := range rawMsg { var err error switch key { - case "resource": - err = unpopulate(val, "Resource", &c.Resource) + case "conflictResolutionPath": + err = unpopulate(val, "ConflictResolutionPath", &c.ConflictResolutionPath) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } + case "conflictResolutionProcedure": + err = unpopulate(val, "ConflictResolutionProcedure", &c.ConflictResolutionProcedure) + delete(rawMsg, key) + case "mode": + err = unpopulate(val, "Mode", &c.Mode) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ClientEncryptionKeyGetProperties. -func (c ClientEncryptionKeyGetProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ConnectionError. +func (c ConnectionError) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "resource", c.Resource) + populate(objectMap, "connectionState", c.ConnectionState) + populate(objectMap, "exception", c.Exception) + populate(objectMap, "iPFrom", c.IPFrom) + populate(objectMap, "iPTo", c.IPTo) + populate(objectMap, "port", c.Port) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ClientEncryptionKeyGetProperties. -func (c *ClientEncryptionKeyGetProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionError. +func (c *ConnectionError) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -1771,8 +1663,20 @@ func (c *ClientEncryptionKeyGetProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "resource": - err = unpopulate(val, "Resource", &c.Resource) + case "connectionState": + err = unpopulate(val, "ConnectionState", &c.ConnectionState) + delete(rawMsg, key) + case "exception": + err = unpopulate(val, "Exception", &c.Exception) + delete(rawMsg, key) + case "iPFrom": + err = unpopulate(val, "IPFrom", &c.IPFrom) + delete(rawMsg, key) + case "iPTo": + err = unpopulate(val, "IPTo", &c.IPTo) + delete(rawMsg, key) + case "port": + err = unpopulate(val, "Port", &c.Port) delete(rawMsg, key) } if err != nil { @@ -1782,21 +1686,17 @@ func (c *ClientEncryptionKeyGetProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ClientEncryptionKeyGetPropertiesResource. -func (c ClientEncryptionKeyGetPropertiesResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ConsistencyPolicy. +func (c ConsistencyPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "encryptionAlgorithm", c.EncryptionAlgorithm) - populate(objectMap, "_etag", c.Etag) - populate(objectMap, "id", c.ID) - populate(objectMap, "keyWrapMetadata", c.KeyWrapMetadata) - populate(objectMap, "_rid", c.Rid) - populate(objectMap, "_ts", c.Ts) - populateByteArray(objectMap, "wrappedDataEncryptionKey", c.WrappedDataEncryptionKey, runtime.Base64StdFormat) + populate(objectMap, "defaultConsistencyLevel", c.DefaultConsistencyLevel) + populate(objectMap, "maxIntervalInSeconds", c.MaxIntervalInSeconds) + populate(objectMap, "maxStalenessPrefix", c.MaxStalenessPrefix) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ClientEncryptionKeyGetPropertiesResource. -func (c *ClientEncryptionKeyGetPropertiesResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ConsistencyPolicy. +func (c *ConsistencyPolicy) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -1804,26 +1704,14 @@ func (c *ClientEncryptionKeyGetPropertiesResource) UnmarshalJSON(data []byte) er for key, val := range rawMsg { var err error switch key { - case "encryptionAlgorithm": - err = unpopulate(val, "EncryptionAlgorithm", &c.EncryptionAlgorithm) - delete(rawMsg, key) - case "_etag": - err = unpopulate(val, "Etag", &c.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "keyWrapMetadata": - err = unpopulate(val, "KeyWrapMetadata", &c.KeyWrapMetadata) - delete(rawMsg, key) - case "_rid": - err = unpopulate(val, "Rid", &c.Rid) + case "defaultConsistencyLevel": + err = unpopulate(val, "DefaultConsistencyLevel", &c.DefaultConsistencyLevel) delete(rawMsg, key) - case "_ts": - err = unpopulate(val, "Ts", &c.Ts) + case "maxIntervalInSeconds": + err = unpopulate(val, "MaxIntervalInSeconds", &c.MaxIntervalInSeconds) delete(rawMsg, key) - case "wrappedDataEncryptionKey": - err = runtime.DecodeByteArray(string(val), &c.WrappedDataEncryptionKey, runtime.Base64StdFormat) + case "maxStalenessPrefix": + err = unpopulate(val, "MaxStalenessPrefix", &c.MaxStalenessPrefix) delete(rawMsg, key) } if err != nil { @@ -1833,18 +1721,18 @@ func (c *ClientEncryptionKeyGetPropertiesResource) UnmarshalJSON(data []byte) er return nil } -// MarshalJSON implements the json.Marshaller interface for type ClientEncryptionKeyGetResults. -func (c ClientEncryptionKeyGetResults) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ContainerPartitionKey. +func (c ContainerPartitionKey) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "id", c.ID) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "type", c.Type) + populate(objectMap, "kind", c.Kind) + populate(objectMap, "paths", c.Paths) + populate(objectMap, "systemKey", c.SystemKey) + populate(objectMap, "version", c.Version) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ClientEncryptionKeyGetResults. -func (c *ClientEncryptionKeyGetResults) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerPartitionKey. +func (c *ContainerPartitionKey) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -1852,17 +1740,17 @@ func (c *ClientEncryptionKeyGetResults) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &c.ID) + case "kind": + err = unpopulate(val, "Kind", &c.Kind) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) + case "paths": + err = unpopulate(val, "Paths", &c.Paths) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) + case "systemKey": + err = unpopulate(val, "SystemKey", &c.SystemKey) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "version": + err = unpopulate(val, "Version", &c.Version) delete(rawMsg, key) } if err != nil { @@ -1872,18 +1760,15 @@ func (c *ClientEncryptionKeyGetResults) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ClientEncryptionKeyResource. -func (c ClientEncryptionKeyResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ContinuousBackupInformation. +func (c ContinuousBackupInformation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "encryptionAlgorithm", c.EncryptionAlgorithm) - populate(objectMap, "id", c.ID) - populate(objectMap, "keyWrapMetadata", c.KeyWrapMetadata) - populateByteArray(objectMap, "wrappedDataEncryptionKey", c.WrappedDataEncryptionKey, runtime.Base64StdFormat) + populate(objectMap, "latestRestorableTimestamp", c.LatestRestorableTimestamp) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ClientEncryptionKeyResource. -func (c *ClientEncryptionKeyResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ContinuousBackupInformation. +func (c *ContinuousBackupInformation) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -1891,17 +1776,8 @@ func (c *ClientEncryptionKeyResource) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "encryptionAlgorithm": - err = unpopulate(val, "EncryptionAlgorithm", &c.EncryptionAlgorithm) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "keyWrapMetadata": - err = unpopulate(val, "KeyWrapMetadata", &c.KeyWrapMetadata) - delete(rawMsg, key) - case "wrappedDataEncryptionKey": - err = runtime.DecodeByteArray(string(val), &c.WrappedDataEncryptionKey, runtime.Base64StdFormat) + case "latestRestorableTimestamp": + err = unpopulate(val, "LatestRestorableTimestamp", &c.LatestRestorableTimestamp) delete(rawMsg, key) } if err != nil { @@ -1911,15 +1787,15 @@ func (c *ClientEncryptionKeyResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ClientEncryptionKeysListResult. -func (c ClientEncryptionKeysListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ContinuousBackupRestoreLocation. +func (c ContinuousBackupRestoreLocation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "value", c.Value) + populate(objectMap, "location", c.Location) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ClientEncryptionKeysListResult. -func (c *ClientEncryptionKeysListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ContinuousBackupRestoreLocation. +func (c *ContinuousBackupRestoreLocation) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -1927,8 +1803,8 @@ func (c *ClientEncryptionKeysListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &c.Value) + case "location": + err = unpopulate(val, "Location", &c.Location) delete(rawMsg, key) } if err != nil { @@ -1938,16 +1814,16 @@ func (c *ClientEncryptionKeysListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ClientEncryptionPolicy. -func (c ClientEncryptionPolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ContinuousModeBackupPolicy. +func (c ContinuousModeBackupPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "includedPaths", c.IncludedPaths) - populate(objectMap, "policyFormatVersion", c.PolicyFormatVersion) + populate(objectMap, "migrationState", c.MigrationState) + objectMap["type"] = BackupPolicyTypeContinuous return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ClientEncryptionPolicy. -func (c *ClientEncryptionPolicy) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ContinuousModeBackupPolicy. +func (c *ContinuousModeBackupPolicy) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -1955,11 +1831,11 @@ func (c *ClientEncryptionPolicy) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "includedPaths": - err = unpopulate(val, "IncludedPaths", &c.IncludedPaths) + case "migrationState": + err = unpopulate(val, "MigrationState", &c.MigrationState) delete(rawMsg, key) - case "policyFormatVersion": - err = unpopulate(val, "PolicyFormatVersion", &c.PolicyFormatVersion) + case "type": + err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) } if err != nil { @@ -1969,15 +1845,19 @@ func (c *ClientEncryptionPolicy) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CloudError. -func (c CloudError) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CorsPolicy. +func (c CorsPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "error", c.Error) + populate(objectMap, "allowedHeaders", c.AllowedHeaders) + populate(objectMap, "allowedMethods", c.AllowedMethods) + populate(objectMap, "allowedOrigins", c.AllowedOrigins) + populate(objectMap, "exposedHeaders", c.ExposedHeaders) + populate(objectMap, "maxAgeInSeconds", c.MaxAgeInSeconds) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudError. -func (c *CloudError) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CorsPolicy. +func (c *CorsPolicy) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -1985,8 +1865,20 @@ func (c *CloudError) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "error": - err = unpopulate(val, "Error", &c.Error) + case "allowedHeaders": + err = unpopulate(val, "AllowedHeaders", &c.AllowedHeaders) + delete(rawMsg, key) + case "allowedMethods": + err = unpopulate(val, "AllowedMethods", &c.AllowedMethods) + delete(rawMsg, key) + case "allowedOrigins": + err = unpopulate(val, "AllowedOrigins", &c.AllowedOrigins) + delete(rawMsg, key) + case "exposedHeaders": + err = unpopulate(val, "ExposedHeaders", &c.ExposedHeaders) + delete(rawMsg, key) + case "maxAgeInSeconds": + err = unpopulate(val, "MaxAgeInSeconds", &c.MaxAgeInSeconds) delete(rawMsg, key) } if err != nil { @@ -1996,16 +1888,16 @@ func (c *CloudError) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ClusterKey. -func (c ClusterKey) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CreateUpdateOptions. +func (c CreateUpdateOptions) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "name", c.Name) - populate(objectMap, "orderBy", c.OrderBy) + populate(objectMap, "autoscaleSettings", c.AutoscaleSettings) + populate(objectMap, "throughput", c.Throughput) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterKey. -func (c *ClusterKey) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CreateUpdateOptions. +func (c *CreateUpdateOptions) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -2013,11 +1905,11 @@ func (c *ClusterKey) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "name": - err = unpopulate(val, "Name", &c.Name) + case "autoscaleSettings": + err = unpopulate(val, "AutoscaleSettings", &c.AutoscaleSettings) delete(rawMsg, key) - case "orderBy": - err = unpopulate(val, "OrderBy", &c.OrderBy) + case "throughput": + err = unpopulate(val, "Throughput", &c.Throughput) delete(rawMsg, key) } if err != nil { @@ -2027,4750 +1919,2329 @@ func (c *ClusterKey) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ClusterResource. -func (c ClusterResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DataCenterResource. +func (d DataCenterResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "id", c.ID) - populate(objectMap, "identity", c.Identity) - populate(objectMap, "location", c.Location) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "tags", c.Tags) - populate(objectMap, "type", c.Type) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterResource. -func (c *ClusterResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DataCenterResource. +func (d *DataCenterResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &c.Identity) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &c.Location) + err = unpopulate(val, "ID", &d.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &c.Name) + err = unpopulate(val, "Name", &d.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &c.Tags) + err = unpopulate(val, "Properties", &d.Properties) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &c.Type) + err = unpopulate(val, "Type", &d.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ClusterResourceProperties. -func (c ClusterResourceProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DataCenterResourceProperties. +func (d DataCenterResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "authenticationMethod", c.AuthenticationMethod) - populate(objectMap, "cassandraAuditLoggingEnabled", c.CassandraAuditLoggingEnabled) - populate(objectMap, "cassandraVersion", c.CassandraVersion) - populate(objectMap, "clientCertificates", c.ClientCertificates) - populate(objectMap, "clusterNameOverride", c.ClusterNameOverride) - populate(objectMap, "deallocated", c.Deallocated) - populate(objectMap, "delegatedManagementSubnetId", c.DelegatedManagementSubnetID) - populate(objectMap, "externalGossipCertificates", c.ExternalGossipCertificates) - populate(objectMap, "externalSeedNodes", c.ExternalSeedNodes) - populate(objectMap, "gossipCertificates", c.GossipCertificates) - populate(objectMap, "hoursBetweenBackups", c.HoursBetweenBackups) - populate(objectMap, "initialCassandraAdminPassword", c.InitialCassandraAdminPassword) - populate(objectMap, "prometheusEndpoint", c.PrometheusEndpoint) - populate(objectMap, "provisioningState", c.ProvisioningState) - populate(objectMap, "repairEnabled", c.RepairEnabled) - populate(objectMap, "restoreFromBackupId", c.RestoreFromBackupID) - populate(objectMap, "seedNodes", c.SeedNodes) + populate(objectMap, "availabilityZone", d.AvailabilityZone) + populate(objectMap, "backupStorageCustomerKeyUri", d.BackupStorageCustomerKeyURI) + populate(objectMap, "base64EncodedCassandraYamlFragment", d.Base64EncodedCassandraYamlFragment) + populate(objectMap, "dataCenterLocation", d.DataCenterLocation) + populate(objectMap, "delegatedSubnetId", d.DelegatedSubnetID) + populate(objectMap, "diskCapacity", d.DiskCapacity) + populate(objectMap, "diskSku", d.DiskSKU) + populate(objectMap, "managedDiskCustomerKeyUri", d.ManagedDiskCustomerKeyURI) + populate(objectMap, "nodeCount", d.NodeCount) + populate(objectMap, "provisioningState", d.ProvisioningState) + populate(objectMap, "sku", d.SKU) + populate(objectMap, "seedNodes", d.SeedNodes) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterResourceProperties. -func (c *ClusterResourceProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DataCenterResourceProperties. +func (d *DataCenterResourceProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "authenticationMethod": - err = unpopulate(val, "AuthenticationMethod", &c.AuthenticationMethod) - delete(rawMsg, key) - case "cassandraAuditLoggingEnabled": - err = unpopulate(val, "CassandraAuditLoggingEnabled", &c.CassandraAuditLoggingEnabled) - delete(rawMsg, key) - case "cassandraVersion": - err = unpopulate(val, "CassandraVersion", &c.CassandraVersion) - delete(rawMsg, key) - case "clientCertificates": - err = unpopulate(val, "ClientCertificates", &c.ClientCertificates) - delete(rawMsg, key) - case "clusterNameOverride": - err = unpopulate(val, "ClusterNameOverride", &c.ClusterNameOverride) + case "availabilityZone": + err = unpopulate(val, "AvailabilityZone", &d.AvailabilityZone) delete(rawMsg, key) - case "deallocated": - err = unpopulate(val, "Deallocated", &c.Deallocated) + case "backupStorageCustomerKeyUri": + err = unpopulate(val, "BackupStorageCustomerKeyURI", &d.BackupStorageCustomerKeyURI) delete(rawMsg, key) - case "delegatedManagementSubnetId": - err = unpopulate(val, "DelegatedManagementSubnetID", &c.DelegatedManagementSubnetID) + case "base64EncodedCassandraYamlFragment": + err = unpopulate(val, "Base64EncodedCassandraYamlFragment", &d.Base64EncodedCassandraYamlFragment) delete(rawMsg, key) - case "externalGossipCertificates": - err = unpopulate(val, "ExternalGossipCertificates", &c.ExternalGossipCertificates) + case "dataCenterLocation": + err = unpopulate(val, "DataCenterLocation", &d.DataCenterLocation) delete(rawMsg, key) - case "externalSeedNodes": - err = unpopulate(val, "ExternalSeedNodes", &c.ExternalSeedNodes) + case "delegatedSubnetId": + err = unpopulate(val, "DelegatedSubnetID", &d.DelegatedSubnetID) delete(rawMsg, key) - case "gossipCertificates": - err = unpopulate(val, "GossipCertificates", &c.GossipCertificates) + case "diskCapacity": + err = unpopulate(val, "DiskCapacity", &d.DiskCapacity) delete(rawMsg, key) - case "hoursBetweenBackups": - err = unpopulate(val, "HoursBetweenBackups", &c.HoursBetweenBackups) + case "diskSku": + err = unpopulate(val, "DiskSKU", &d.DiskSKU) delete(rawMsg, key) - case "initialCassandraAdminPassword": - err = unpopulate(val, "InitialCassandraAdminPassword", &c.InitialCassandraAdminPassword) + case "managedDiskCustomerKeyUri": + err = unpopulate(val, "ManagedDiskCustomerKeyURI", &d.ManagedDiskCustomerKeyURI) delete(rawMsg, key) - case "prometheusEndpoint": - err = unpopulate(val, "PrometheusEndpoint", &c.PrometheusEndpoint) + case "nodeCount": + err = unpopulate(val, "NodeCount", &d.NodeCount) delete(rawMsg, key) case "provisioningState": - err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) - delete(rawMsg, key) - case "repairEnabled": - err = unpopulate(val, "RepairEnabled", &c.RepairEnabled) + err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) delete(rawMsg, key) - case "restoreFromBackupId": - err = unpopulate(val, "RestoreFromBackupID", &c.RestoreFromBackupID) + case "sku": + err = unpopulate(val, "SKU", &d.SKU) delete(rawMsg, key) case "seedNodes": - err = unpopulate(val, "SeedNodes", &c.SeedNodes) + err = unpopulate(val, "SeedNodes", &d.SeedNodes) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Column. -func (c Column) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DataTransferRegionalServiceResource. +func (d DataTransferRegionalServiceResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "name", c.Name) - populate(objectMap, "type", c.Type) + populate(objectMap, "location", d.Location) + populate(objectMap, "name", d.Name) + populate(objectMap, "status", d.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Column. -func (c *Column) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DataTransferRegionalServiceResource. +func (d *DataTransferRegionalServiceResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { + case "location": + err = unpopulate(val, "Location", &d.Location) + delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &c.Name) + err = unpopulate(val, "Name", &d.Name) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "status": + err = unpopulate(val, "Status", &d.Status) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CommandOutput. -func (c CommandOutput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DataTransferServiceResource. +func (d DataTransferServiceResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "commandOutput", c.CommandOutput) + populate(objectMap, "properties", d.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CommandOutput. -func (c *CommandOutput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DataTransferServiceResource. +func (d *DataTransferServiceResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "commandOutput": - err = unpopulate(val, "CommandOutput", &c.CommandOutput) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CommandPostBody. -func (c CommandPostBody) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DataTransferServiceResourceProperties. +func (d DataTransferServiceResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "arguments", c.Arguments) - populate(objectMap, "cassandra-stop-start", c.CassandraStopStart) - populate(objectMap, "command", c.Command) - populate(objectMap, "host", c.Host) - populate(objectMap, "readwrite", c.Readwrite) + populateTimeRFC3339(objectMap, "creationTime", d.CreationTime) + populate(objectMap, "instanceCount", d.InstanceCount) + populate(objectMap, "instanceSize", d.InstanceSize) + populate(objectMap, "locations", d.Locations) + objectMap["serviceType"] = ServiceTypeDataTransfer + populate(objectMap, "status", d.Status) + if d.AdditionalProperties != nil { + for key, val := range d.AdditionalProperties { + objectMap[key] = val + } + } return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CommandPostBody. -func (c *CommandPostBody) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DataTransferServiceResourceProperties. +func (d *DataTransferServiceResourceProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "arguments": - err = unpopulate(val, "Arguments", &c.Arguments) + case "creationTime": + err = unpopulateTimeRFC3339(val, "CreationTime", &d.CreationTime) delete(rawMsg, key) - case "cassandra-stop-start": - err = unpopulate(val, "CassandraStopStart", &c.CassandraStopStart) + case "instanceCount": + err = unpopulate(val, "InstanceCount", &d.InstanceCount) delete(rawMsg, key) - case "command": - err = unpopulate(val, "Command", &c.Command) + case "instanceSize": + err = unpopulate(val, "InstanceSize", &d.InstanceSize) delete(rawMsg, key) - case "host": - err = unpopulate(val, "Host", &c.Host) + case "locations": + err = unpopulate(val, "Locations", &d.Locations) delete(rawMsg, key) - case "readwrite": - err = unpopulate(val, "Readwrite", &c.Readwrite) + case "serviceType": + err = unpopulate(val, "ServiceType", &d.ServiceType) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &d.Status) + delete(rawMsg, key) + default: + if d.AdditionalProperties == nil { + d.AdditionalProperties = map[string]interface{}{} + } + if val != nil { + var aux interface{} + err = json.Unmarshal(val, &aux) + d.AdditionalProperties[key] = aux + } delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties. -func (c Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseAccountConnectionString. +func (d DatabaseAccountConnectionString) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "clientId", c.ClientID) - populate(objectMap, "principalId", c.PrincipalID) + populate(objectMap, "connectionString", d.ConnectionString) + populate(objectMap, "description", d.Description) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties. -func (c *Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAccountConnectionString. +func (d *DatabaseAccountConnectionString) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "clientId": - err = unpopulate(val, "ClientID", &c.ClientID) + case "connectionString": + err = unpopulate(val, "ConnectionString", &d.ConnectionString) delete(rawMsg, key) - case "principalId": - err = unpopulate(val, "PrincipalID", &c.PrincipalID) + case "description": + err = unpopulate(val, "Description", &d.Description) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ComponentsM9L909SchemasCassandraclusterpublicstatusPropertiesDatacentersItemsPropertiesNodesItems. -func (c ComponentsM9L909SchemasCassandraclusterpublicstatusPropertiesDatacentersItemsPropertiesNodesItems) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseAccountCreateUpdateParameters. +func (d DatabaseAccountCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "address", c.Address) - populate(objectMap, "cpuUsage", c.CPUUsage) - populate(objectMap, "diskFreeKB", c.DiskFreeKB) - populate(objectMap, "diskUsedKB", c.DiskUsedKB) - populate(objectMap, "hostID", c.HostID) - populate(objectMap, "load", c.Load) - populate(objectMap, "memoryBuffersAndCachedKB", c.MemoryBuffersAndCachedKB) - populate(objectMap, "memoryFreeKB", c.MemoryFreeKB) - populate(objectMap, "memoryTotalKB", c.MemoryTotalKB) - populate(objectMap, "memoryUsedKB", c.MemoryUsedKB) - populate(objectMap, "rack", c.Rack) - populate(objectMap, "size", c.Size) - populate(objectMap, "state", c.State) - populate(objectMap, "status", c.Status) - populate(objectMap, "timestamp", c.Timestamp) - populate(objectMap, "tokens", c.Tokens) + populate(objectMap, "id", d.ID) + populate(objectMap, "identity", d.Identity) + populate(objectMap, "kind", d.Kind) + populate(objectMap, "location", d.Location) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "tags", d.Tags) + populate(objectMap, "type", d.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentsM9L909SchemasCassandraclusterpublicstatusPropertiesDatacentersItemsPropertiesNodesItems. -func (c *ComponentsM9L909SchemasCassandraclusterpublicstatusPropertiesDatacentersItemsPropertiesNodesItems) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAccountCreateUpdateParameters. +func (d *DatabaseAccountCreateUpdateParameters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "address": - err = unpopulate(val, "Address", &c.Address) + case "id": + err = unpopulate(val, "ID", &d.ID) delete(rawMsg, key) - case "cpuUsage": - err = unpopulate(val, "CPUUsage", &c.CPUUsage) + case "identity": + err = unpopulate(val, "Identity", &d.Identity) delete(rawMsg, key) - case "diskFreeKB": - err = unpopulate(val, "DiskFreeKB", &c.DiskFreeKB) + case "kind": + err = unpopulate(val, "Kind", &d.Kind) delete(rawMsg, key) - case "diskUsedKB": - err = unpopulate(val, "DiskUsedKB", &c.DiskUsedKB) + case "location": + err = unpopulate(val, "Location", &d.Location) delete(rawMsg, key) - case "hostID": - err = unpopulate(val, "HostID", &c.HostID) + case "name": + err = unpopulate(val, "Name", &d.Name) delete(rawMsg, key) - case "load": - err = unpopulate(val, "Load", &c.Load) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) delete(rawMsg, key) - case "memoryBuffersAndCachedKB": - err = unpopulate(val, "MemoryBuffersAndCachedKB", &c.MemoryBuffersAndCachedKB) + case "tags": + err = unpopulate(val, "Tags", &d.Tags) delete(rawMsg, key) - case "memoryFreeKB": - err = unpopulate(val, "MemoryFreeKB", &c.MemoryFreeKB) - delete(rawMsg, key) - case "memoryTotalKB": - err = unpopulate(val, "MemoryTotalKB", &c.MemoryTotalKB) - delete(rawMsg, key) - case "memoryUsedKB": - err = unpopulate(val, "MemoryUsedKB", &c.MemoryUsedKB) - delete(rawMsg, key) - case "rack": - err = unpopulate(val, "Rack", &c.Rack) - delete(rawMsg, key) - case "size": - err = unpopulate(val, "Size", &c.Size) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &c.State) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &c.Status) - delete(rawMsg, key) - case "timestamp": - err = unpopulate(val, "Timestamp", &c.Timestamp) - delete(rawMsg, key) - case "tokens": - err = unpopulate(val, "Tokens", &c.Tokens) + case "type": + err = unpopulate(val, "Type", &d.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CompositePath. -func (c CompositePath) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseAccountCreateUpdateProperties. +func (d DatabaseAccountCreateUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "order", c.Order) - populate(objectMap, "path", c.Path) + populate(objectMap, "apiProperties", d.APIProperties) + populate(objectMap, "analyticalStorageConfiguration", d.AnalyticalStorageConfiguration) + populate(objectMap, "backupPolicy", d.BackupPolicy) + populate(objectMap, "capabilities", d.Capabilities) + populate(objectMap, "capacity", d.Capacity) + populate(objectMap, "connectorOffer", d.ConnectorOffer) + populate(objectMap, "consistencyPolicy", d.ConsistencyPolicy) + populate(objectMap, "cors", d.Cors) + populate(objectMap, "createMode", d.CreateMode) + objectMap["databaseAccountOfferType"] = "Standard" + populate(objectMap, "defaultIdentity", d.DefaultIdentity) + populate(objectMap, "disableKeyBasedMetadataWriteAccess", d.DisableKeyBasedMetadataWriteAccess) + populate(objectMap, "disableLocalAuth", d.DisableLocalAuth) + populate(objectMap, "enableAnalyticalStorage", d.EnableAnalyticalStorage) + populate(objectMap, "enableAutomaticFailover", d.EnableAutomaticFailover) + populate(objectMap, "enableCassandraConnector", d.EnableCassandraConnector) + populate(objectMap, "enableFreeTier", d.EnableFreeTier) + populate(objectMap, "enableMultipleWriteLocations", d.EnableMultipleWriteLocations) + populate(objectMap, "enablePartitionMerge", d.EnablePartitionMerge) + populate(objectMap, "ipRules", d.IPRules) + populate(objectMap, "isVirtualNetworkFilterEnabled", d.IsVirtualNetworkFilterEnabled) + populate(objectMap, "keyVaultKeyUri", d.KeyVaultKeyURI) + populate(objectMap, "keysMetadata", d.KeysMetadata) + populate(objectMap, "locations", d.Locations) + populate(objectMap, "networkAclBypass", d.NetworkACLBypass) + populate(objectMap, "networkAclBypassResourceIds", d.NetworkACLBypassResourceIDs) + populate(objectMap, "publicNetworkAccess", d.PublicNetworkAccess) + populate(objectMap, "restoreParameters", d.RestoreParameters) + populate(objectMap, "virtualNetworkRules", d.VirtualNetworkRules) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CompositePath. -func (c *CompositePath) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAccountCreateUpdateProperties. +func (d *DatabaseAccountCreateUpdateProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "order": - err = unpopulate(val, "Order", &c.Order) + case "apiProperties": + err = unpopulate(val, "APIProperties", &d.APIProperties) delete(rawMsg, key) - case "path": - err = unpopulate(val, "Path", &c.Path) + case "analyticalStorageConfiguration": + err = unpopulate(val, "AnalyticalStorageConfiguration", &d.AnalyticalStorageConfiguration) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConflictResolutionPolicy. -func (c ConflictResolutionPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "conflictResolutionPath", c.ConflictResolutionPath) - populate(objectMap, "conflictResolutionProcedure", c.ConflictResolutionProcedure) - populate(objectMap, "mode", c.Mode) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConflictResolutionPolicy. -func (c *ConflictResolutionPolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "conflictResolutionPath": - err = unpopulate(val, "ConflictResolutionPath", &c.ConflictResolutionPath) + case "backupPolicy": + d.BackupPolicy, err = unmarshalBackupPolicyClassification(val) delete(rawMsg, key) - case "conflictResolutionProcedure": - err = unpopulate(val, "ConflictResolutionProcedure", &c.ConflictResolutionProcedure) + case "capabilities": + err = unpopulate(val, "Capabilities", &d.Capabilities) delete(rawMsg, key) - case "mode": - err = unpopulate(val, "Mode", &c.Mode) + case "capacity": + err = unpopulate(val, "Capacity", &d.Capacity) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectionError. -func (c ConnectionError) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "connectionState", c.ConnectionState) - populate(objectMap, "exception", c.Exception) - populate(objectMap, "iPFrom", c.IPFrom) - populate(objectMap, "iPTo", c.IPTo) - populate(objectMap, "port", c.Port) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionError. -func (c *ConnectionError) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "connectionState": - err = unpopulate(val, "ConnectionState", &c.ConnectionState) + case "connectorOffer": + err = unpopulate(val, "ConnectorOffer", &d.ConnectorOffer) delete(rawMsg, key) - case "exception": - err = unpopulate(val, "Exception", &c.Exception) + case "consistencyPolicy": + err = unpopulate(val, "ConsistencyPolicy", &d.ConsistencyPolicy) delete(rawMsg, key) - case "iPFrom": - err = unpopulate(val, "IPFrom", &c.IPFrom) + case "cors": + err = unpopulate(val, "Cors", &d.Cors) delete(rawMsg, key) - case "iPTo": - err = unpopulate(val, "IPTo", &c.IPTo) + case "createMode": + err = unpopulate(val, "CreateMode", &d.CreateMode) delete(rawMsg, key) - case "port": - err = unpopulate(val, "Port", &c.Port) + case "databaseAccountOfferType": + err = unpopulate(val, "DatabaseAccountOfferType", &d.DatabaseAccountOfferType) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConsistencyPolicy. -func (c ConsistencyPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "defaultConsistencyLevel", c.DefaultConsistencyLevel) - populate(objectMap, "maxIntervalInSeconds", c.MaxIntervalInSeconds) - populate(objectMap, "maxStalenessPrefix", c.MaxStalenessPrefix) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConsistencyPolicy. -func (c *ConsistencyPolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "defaultConsistencyLevel": - err = unpopulate(val, "DefaultConsistencyLevel", &c.DefaultConsistencyLevel) + case "defaultIdentity": + err = unpopulate(val, "DefaultIdentity", &d.DefaultIdentity) delete(rawMsg, key) - case "maxIntervalInSeconds": - err = unpopulate(val, "MaxIntervalInSeconds", &c.MaxIntervalInSeconds) + case "disableKeyBasedMetadataWriteAccess": + err = unpopulate(val, "DisableKeyBasedMetadataWriteAccess", &d.DisableKeyBasedMetadataWriteAccess) delete(rawMsg, key) - case "maxStalenessPrefix": - err = unpopulate(val, "MaxStalenessPrefix", &c.MaxStalenessPrefix) + case "disableLocalAuth": + err = unpopulate(val, "DisableLocalAuth", &d.DisableLocalAuth) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ContainerPartitionKey. -func (c ContainerPartitionKey) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "kind", c.Kind) - populate(objectMap, "paths", c.Paths) - populate(objectMap, "systemKey", c.SystemKey) - populate(objectMap, "version", c.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerPartitionKey. -func (c *ContainerPartitionKey) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "kind": - err = unpopulate(val, "Kind", &c.Kind) + case "enableAnalyticalStorage": + err = unpopulate(val, "EnableAnalyticalStorage", &d.EnableAnalyticalStorage) delete(rawMsg, key) - case "paths": - err = unpopulate(val, "Paths", &c.Paths) + case "enableAutomaticFailover": + err = unpopulate(val, "EnableAutomaticFailover", &d.EnableAutomaticFailover) delete(rawMsg, key) - case "systemKey": - err = unpopulate(val, "SystemKey", &c.SystemKey) + case "enableCassandraConnector": + err = unpopulate(val, "EnableCassandraConnector", &d.EnableCassandraConnector) delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &c.Version) + case "enableFreeTier": + err = unpopulate(val, "EnableFreeTier", &d.EnableFreeTier) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ContinuousBackupInformation. -func (c ContinuousBackupInformation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "latestRestorableTimestamp", c.LatestRestorableTimestamp) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ContinuousBackupInformation. -func (c *ContinuousBackupInformation) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "latestRestorableTimestamp": - err = unpopulate(val, "LatestRestorableTimestamp", &c.LatestRestorableTimestamp) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ContinuousBackupRestoreLocation. -func (c ContinuousBackupRestoreLocation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "location", c.Location) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ContinuousBackupRestoreLocation. -func (c *ContinuousBackupRestoreLocation) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "location": - err = unpopulate(val, "Location", &c.Location) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ContinuousModeBackupPolicy. -func (c ContinuousModeBackupPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "continuousModeProperties", c.ContinuousModeProperties) - populate(objectMap, "migrationState", c.MigrationState) - objectMap["type"] = BackupPolicyTypeContinuous - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ContinuousModeBackupPolicy. -func (c *ContinuousModeBackupPolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "continuousModeProperties": - err = unpopulate(val, "ContinuousModeProperties", &c.ContinuousModeProperties) - delete(rawMsg, key) - case "migrationState": - err = unpopulate(val, "MigrationState", &c.MigrationState) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ContinuousModeProperties. -func (c ContinuousModeProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tier", c.Tier) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ContinuousModeProperties. -func (c *ContinuousModeProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "tier": - err = unpopulate(val, "Tier", &c.Tier) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CorsPolicy. -func (c CorsPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "allowedHeaders", c.AllowedHeaders) - populate(objectMap, "allowedMethods", c.AllowedMethods) - populate(objectMap, "allowedOrigins", c.AllowedOrigins) - populate(objectMap, "exposedHeaders", c.ExposedHeaders) - populate(objectMap, "maxAgeInSeconds", c.MaxAgeInSeconds) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CorsPolicy. -func (c *CorsPolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "allowedHeaders": - err = unpopulate(val, "AllowedHeaders", &c.AllowedHeaders) - delete(rawMsg, key) - case "allowedMethods": - err = unpopulate(val, "AllowedMethods", &c.AllowedMethods) - delete(rawMsg, key) - case "allowedOrigins": - err = unpopulate(val, "AllowedOrigins", &c.AllowedOrigins) - delete(rawMsg, key) - case "exposedHeaders": - err = unpopulate(val, "ExposedHeaders", &c.ExposedHeaders) - delete(rawMsg, key) - case "maxAgeInSeconds": - err = unpopulate(val, "MaxAgeInSeconds", &c.MaxAgeInSeconds) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CreateJobRequest. -func (c CreateJobRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", c.ID) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CreateJobRequest. -func (c *CreateJobRequest) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CreateUpdateOptions. -func (c CreateUpdateOptions) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "autoscaleSettings", c.AutoscaleSettings) - populate(objectMap, "throughput", c.Throughput) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CreateUpdateOptions. -func (c *CreateUpdateOptions) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "autoscaleSettings": - err = unpopulate(val, "AutoscaleSettings", &c.AutoscaleSettings) - delete(rawMsg, key) - case "throughput": - err = unpopulate(val, "Throughput", &c.Throughput) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DataCenterResource. -func (d DataCenterResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", d.ID) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DataCenterResource. -func (d *DataCenterResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DataCenterResourceProperties. -func (d DataCenterResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "authenticationMethodLdapProperties", d.AuthenticationMethodLdapProperties) - populate(objectMap, "availabilityZone", d.AvailabilityZone) - populate(objectMap, "backupStorageCustomerKeyUri", d.BackupStorageCustomerKeyURI) - populate(objectMap, "base64EncodedCassandraYamlFragment", d.Base64EncodedCassandraYamlFragment) - populate(objectMap, "dataCenterLocation", d.DataCenterLocation) - populate(objectMap, "delegatedSubnetId", d.DelegatedSubnetID) - populate(objectMap, "diskCapacity", d.DiskCapacity) - populate(objectMap, "diskSku", d.DiskSKU) - populate(objectMap, "managedDiskCustomerKeyUri", d.ManagedDiskCustomerKeyURI) - populate(objectMap, "nodeCount", d.NodeCount) - populate(objectMap, "provisioningState", d.ProvisioningState) - populate(objectMap, "sku", d.SKU) - populate(objectMap, "seedNodes", d.SeedNodes) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DataCenterResourceProperties. -func (d *DataCenterResourceProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "authenticationMethodLdapProperties": - err = unpopulate(val, "AuthenticationMethodLdapProperties", &d.AuthenticationMethodLdapProperties) - delete(rawMsg, key) - case "availabilityZone": - err = unpopulate(val, "AvailabilityZone", &d.AvailabilityZone) - delete(rawMsg, key) - case "backupStorageCustomerKeyUri": - err = unpopulate(val, "BackupStorageCustomerKeyURI", &d.BackupStorageCustomerKeyURI) - delete(rawMsg, key) - case "base64EncodedCassandraYamlFragment": - err = unpopulate(val, "Base64EncodedCassandraYamlFragment", &d.Base64EncodedCassandraYamlFragment) - delete(rawMsg, key) - case "dataCenterLocation": - err = unpopulate(val, "DataCenterLocation", &d.DataCenterLocation) - delete(rawMsg, key) - case "delegatedSubnetId": - err = unpopulate(val, "DelegatedSubnetID", &d.DelegatedSubnetID) - delete(rawMsg, key) - case "diskCapacity": - err = unpopulate(val, "DiskCapacity", &d.DiskCapacity) - delete(rawMsg, key) - case "diskSku": - err = unpopulate(val, "DiskSKU", &d.DiskSKU) - delete(rawMsg, key) - case "managedDiskCustomerKeyUri": - err = unpopulate(val, "ManagedDiskCustomerKeyURI", &d.ManagedDiskCustomerKeyURI) - delete(rawMsg, key) - case "nodeCount": - err = unpopulate(val, "NodeCount", &d.NodeCount) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &d.SKU) - delete(rawMsg, key) - case "seedNodes": - err = unpopulate(val, "SeedNodes", &d.SeedNodes) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DataTransferDataSourceSink. -func (d DataTransferDataSourceSink) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["component"] = d.Component - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DataTransferDataSourceSink. -func (d *DataTransferDataSourceSink) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "component": - err = unpopulate(val, "Component", &d.Component) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DataTransferJobFeedResults. -func (d DataTransferJobFeedResults) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DataTransferJobFeedResults. -func (d *DataTransferJobFeedResults) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DataTransferJobGetResults. -func (d DataTransferJobGetResults) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", d.ID) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DataTransferJobGetResults. -func (d *DataTransferJobGetResults) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DataTransferJobProperties. -func (d DataTransferJobProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "destination", d.Destination) - populate(objectMap, "error", d.Error) - populate(objectMap, "jobName", d.JobName) - populateTimeRFC3339(objectMap, "lastUpdatedUtcTime", d.LastUpdatedUTCTime) - populate(objectMap, "processedCount", d.ProcessedCount) - populate(objectMap, "source", d.Source) - populate(objectMap, "status", d.Status) - populate(objectMap, "totalCount", d.TotalCount) - populate(objectMap, "workerCount", d.WorkerCount) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DataTransferJobProperties. -func (d *DataTransferJobProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "destination": - d.Destination, err = unmarshalDataTransferDataSourceSinkClassification(val) - delete(rawMsg, key) - case "error": - err = unpopulate(val, "Error", &d.Error) - delete(rawMsg, key) - case "jobName": - err = unpopulate(val, "JobName", &d.JobName) - delete(rawMsg, key) - case "lastUpdatedUtcTime": - err = unpopulateTimeRFC3339(val, "LastUpdatedUTCTime", &d.LastUpdatedUTCTime) - delete(rawMsg, key) - case "processedCount": - err = unpopulate(val, "ProcessedCount", &d.ProcessedCount) - delete(rawMsg, key) - case "source": - d.Source, err = unmarshalDataTransferDataSourceSinkClassification(val) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &d.Status) - delete(rawMsg, key) - case "totalCount": - err = unpopulate(val, "TotalCount", &d.TotalCount) - delete(rawMsg, key) - case "workerCount": - err = unpopulate(val, "WorkerCount", &d.WorkerCount) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DataTransferRegionalServiceResource. -func (d DataTransferRegionalServiceResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "location", d.Location) - populate(objectMap, "name", d.Name) - populate(objectMap, "status", d.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DataTransferRegionalServiceResource. -func (d *DataTransferRegionalServiceResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "location": - err = unpopulate(val, "Location", &d.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &d.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DataTransferServiceResource. -func (d DataTransferServiceResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", d.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DataTransferServiceResource. -func (d *DataTransferServiceResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DataTransferServiceResourceProperties. -func (d DataTransferServiceResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "creationTime", d.CreationTime) - populate(objectMap, "instanceCount", d.InstanceCount) - populate(objectMap, "instanceSize", d.InstanceSize) - populate(objectMap, "locations", d.Locations) - objectMap["serviceType"] = ServiceTypeDataTransfer - populate(objectMap, "status", d.Status) - if d.AdditionalProperties != nil { - for key, val := range d.AdditionalProperties { - objectMap[key] = val - } - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DataTransferServiceResourceProperties. -func (d *DataTransferServiceResourceProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "creationTime": - err = unpopulateTimeRFC3339(val, "CreationTime", &d.CreationTime) - delete(rawMsg, key) - case "instanceCount": - err = unpopulate(val, "InstanceCount", &d.InstanceCount) - delete(rawMsg, key) - case "instanceSize": - err = unpopulate(val, "InstanceSize", &d.InstanceSize) - delete(rawMsg, key) - case "locations": - err = unpopulate(val, "Locations", &d.Locations) - delete(rawMsg, key) - case "serviceType": - err = unpopulate(val, "ServiceType", &d.ServiceType) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &d.Status) - delete(rawMsg, key) - default: - if d.AdditionalProperties == nil { - d.AdditionalProperties = map[string]interface{}{} - } - if val != nil { - var aux interface{} - err = json.Unmarshal(val, &aux) - d.AdditionalProperties[key] = aux - } - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DatabaseAccountConnectionString. -func (d DatabaseAccountConnectionString) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "connectionString", d.ConnectionString) - populate(objectMap, "description", d.Description) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAccountConnectionString. -func (d *DatabaseAccountConnectionString) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "connectionString": - err = unpopulate(val, "ConnectionString", &d.ConnectionString) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &d.Description) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DatabaseAccountCreateUpdateParameters. -func (d DatabaseAccountCreateUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", d.ID) - populate(objectMap, "identity", d.Identity) - populate(objectMap, "kind", d.Kind) - populate(objectMap, "location", d.Location) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "tags", d.Tags) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAccountCreateUpdateParameters. -func (d *DatabaseAccountCreateUpdateParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &d.Identity) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &d.Kind) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &d.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &d.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DatabaseAccountCreateUpdateProperties. -func (d DatabaseAccountCreateUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "apiProperties", d.APIProperties) - populate(objectMap, "analyticalStorageConfiguration", d.AnalyticalStorageConfiguration) - populate(objectMap, "backupPolicy", d.BackupPolicy) - populate(objectMap, "capabilities", d.Capabilities) - populate(objectMap, "capacity", d.Capacity) - populate(objectMap, "connectorOffer", d.ConnectorOffer) - populate(objectMap, "consistencyPolicy", d.ConsistencyPolicy) - populate(objectMap, "cors", d.Cors) - populate(objectMap, "createMode", d.CreateMode) - objectMap["databaseAccountOfferType"] = "Standard" - populate(objectMap, "defaultIdentity", d.DefaultIdentity) - populate(objectMap, "diagnosticLogSettings", d.DiagnosticLogSettings) - populate(objectMap, "disableKeyBasedMetadataWriteAccess", d.DisableKeyBasedMetadataWriteAccess) - populate(objectMap, "disableLocalAuth", d.DisableLocalAuth) - populate(objectMap, "enableAnalyticalStorage", d.EnableAnalyticalStorage) - populate(objectMap, "enableAutomaticFailover", d.EnableAutomaticFailover) - populate(objectMap, "enableCassandraConnector", d.EnableCassandraConnector) - populate(objectMap, "enableFreeTier", d.EnableFreeTier) - populate(objectMap, "enableMaterializedViews", d.EnableMaterializedViews) - populate(objectMap, "enableMultipleWriteLocations", d.EnableMultipleWriteLocations) - populate(objectMap, "ipRules", d.IPRules) - populate(objectMap, "isVirtualNetworkFilterEnabled", d.IsVirtualNetworkFilterEnabled) - populate(objectMap, "keyVaultKeyUri", d.KeyVaultKeyURI) - populate(objectMap, "keysMetadata", d.KeysMetadata) - populate(objectMap, "locations", d.Locations) - populate(objectMap, "networkAclBypass", d.NetworkACLBypass) - populate(objectMap, "networkAclBypassResourceIds", d.NetworkACLBypassResourceIDs) - populate(objectMap, "publicNetworkAccess", d.PublicNetworkAccess) - populate(objectMap, "restoreParameters", d.RestoreParameters) - populate(objectMap, "virtualNetworkRules", d.VirtualNetworkRules) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAccountCreateUpdateProperties. -func (d *DatabaseAccountCreateUpdateProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "apiProperties": - err = unpopulate(val, "APIProperties", &d.APIProperties) - delete(rawMsg, key) - case "analyticalStorageConfiguration": - err = unpopulate(val, "AnalyticalStorageConfiguration", &d.AnalyticalStorageConfiguration) - delete(rawMsg, key) - case "backupPolicy": - d.BackupPolicy, err = unmarshalBackupPolicyClassification(val) - delete(rawMsg, key) - case "capabilities": - err = unpopulate(val, "Capabilities", &d.Capabilities) - delete(rawMsg, key) - case "capacity": - err = unpopulate(val, "Capacity", &d.Capacity) - delete(rawMsg, key) - case "connectorOffer": - err = unpopulate(val, "ConnectorOffer", &d.ConnectorOffer) - delete(rawMsg, key) - case "consistencyPolicy": - err = unpopulate(val, "ConsistencyPolicy", &d.ConsistencyPolicy) - delete(rawMsg, key) - case "cors": - err = unpopulate(val, "Cors", &d.Cors) - delete(rawMsg, key) - case "createMode": - err = unpopulate(val, "CreateMode", &d.CreateMode) - delete(rawMsg, key) - case "databaseAccountOfferType": - err = unpopulate(val, "DatabaseAccountOfferType", &d.DatabaseAccountOfferType) - delete(rawMsg, key) - case "defaultIdentity": - err = unpopulate(val, "DefaultIdentity", &d.DefaultIdentity) - delete(rawMsg, key) - case "diagnosticLogSettings": - err = unpopulate(val, "DiagnosticLogSettings", &d.DiagnosticLogSettings) - delete(rawMsg, key) - case "disableKeyBasedMetadataWriteAccess": - err = unpopulate(val, "DisableKeyBasedMetadataWriteAccess", &d.DisableKeyBasedMetadataWriteAccess) - delete(rawMsg, key) - case "disableLocalAuth": - err = unpopulate(val, "DisableLocalAuth", &d.DisableLocalAuth) - delete(rawMsg, key) - case "enableAnalyticalStorage": - err = unpopulate(val, "EnableAnalyticalStorage", &d.EnableAnalyticalStorage) - delete(rawMsg, key) - case "enableAutomaticFailover": - err = unpopulate(val, "EnableAutomaticFailover", &d.EnableAutomaticFailover) - delete(rawMsg, key) - case "enableCassandraConnector": - err = unpopulate(val, "EnableCassandraConnector", &d.EnableCassandraConnector) - delete(rawMsg, key) - case "enableFreeTier": - err = unpopulate(val, "EnableFreeTier", &d.EnableFreeTier) - delete(rawMsg, key) - case "enableMaterializedViews": - err = unpopulate(val, "EnableMaterializedViews", &d.EnableMaterializedViews) - delete(rawMsg, key) - case "enableMultipleWriteLocations": - err = unpopulate(val, "EnableMultipleWriteLocations", &d.EnableMultipleWriteLocations) - delete(rawMsg, key) - case "ipRules": - err = unpopulate(val, "IPRules", &d.IPRules) - delete(rawMsg, key) - case "isVirtualNetworkFilterEnabled": - err = unpopulate(val, "IsVirtualNetworkFilterEnabled", &d.IsVirtualNetworkFilterEnabled) - delete(rawMsg, key) - case "keyVaultKeyUri": - err = unpopulate(val, "KeyVaultKeyURI", &d.KeyVaultKeyURI) - delete(rawMsg, key) - case "keysMetadata": - err = unpopulate(val, "KeysMetadata", &d.KeysMetadata) - delete(rawMsg, key) - case "locations": - err = unpopulate(val, "Locations", &d.Locations) - delete(rawMsg, key) - case "networkAclBypass": - err = unpopulate(val, "NetworkACLBypass", &d.NetworkACLBypass) - delete(rawMsg, key) - case "networkAclBypassResourceIds": - err = unpopulate(val, "NetworkACLBypassResourceIDs", &d.NetworkACLBypassResourceIDs) - delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &d.PublicNetworkAccess) - delete(rawMsg, key) - case "restoreParameters": - err = unpopulate(val, "RestoreParameters", &d.RestoreParameters) - delete(rawMsg, key) - case "virtualNetworkRules": - err = unpopulate(val, "VirtualNetworkRules", &d.VirtualNetworkRules) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DatabaseAccountGetProperties. -func (d DatabaseAccountGetProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "apiProperties", d.APIProperties) - populate(objectMap, "analyticalStorageConfiguration", d.AnalyticalStorageConfiguration) - populate(objectMap, "backupPolicy", d.BackupPolicy) - populate(objectMap, "capabilities", d.Capabilities) - populate(objectMap, "capacity", d.Capacity) - populate(objectMap, "connectorOffer", d.ConnectorOffer) - populate(objectMap, "consistencyPolicy", d.ConsistencyPolicy) - populate(objectMap, "cors", d.Cors) - populate(objectMap, "createMode", d.CreateMode) - objectMap["databaseAccountOfferType"] = "Standard" - populate(objectMap, "defaultIdentity", d.DefaultIdentity) - populate(objectMap, "diagnosticLogSettings", d.DiagnosticLogSettings) - populate(objectMap, "disableKeyBasedMetadataWriteAccess", d.DisableKeyBasedMetadataWriteAccess) - populate(objectMap, "disableLocalAuth", d.DisableLocalAuth) - populate(objectMap, "documentEndpoint", d.DocumentEndpoint) - populate(objectMap, "enableAnalyticalStorage", d.EnableAnalyticalStorage) - populate(objectMap, "enableAutomaticFailover", d.EnableAutomaticFailover) - populate(objectMap, "enableCassandraConnector", d.EnableCassandraConnector) - populate(objectMap, "enableFreeTier", d.EnableFreeTier) - populate(objectMap, "enableMaterializedViews", d.EnableMaterializedViews) - populate(objectMap, "enableMultipleWriteLocations", d.EnableMultipleWriteLocations) - populate(objectMap, "failoverPolicies", d.FailoverPolicies) - populate(objectMap, "ipRules", d.IPRules) - populate(objectMap, "instanceId", d.InstanceID) - populate(objectMap, "isVirtualNetworkFilterEnabled", d.IsVirtualNetworkFilterEnabled) - populate(objectMap, "keyVaultKeyUri", d.KeyVaultKeyURI) - populate(objectMap, "keysMetadata", d.KeysMetadata) - populate(objectMap, "locations", d.Locations) - populate(objectMap, "networkAclBypass", d.NetworkACLBypass) - populate(objectMap, "networkAclBypassResourceIds", d.NetworkACLBypassResourceIDs) - populate(objectMap, "privateEndpointConnections", d.PrivateEndpointConnections) - populate(objectMap, "provisioningState", d.ProvisioningState) - populate(objectMap, "publicNetworkAccess", d.PublicNetworkAccess) - populate(objectMap, "readLocations", d.ReadLocations) - populate(objectMap, "restoreParameters", d.RestoreParameters) - populate(objectMap, "virtualNetworkRules", d.VirtualNetworkRules) - populate(objectMap, "writeLocations", d.WriteLocations) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAccountGetProperties. -func (d *DatabaseAccountGetProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "apiProperties": - err = unpopulate(val, "APIProperties", &d.APIProperties) - delete(rawMsg, key) - case "analyticalStorageConfiguration": - err = unpopulate(val, "AnalyticalStorageConfiguration", &d.AnalyticalStorageConfiguration) - delete(rawMsg, key) - case "backupPolicy": - d.BackupPolicy, err = unmarshalBackupPolicyClassification(val) - delete(rawMsg, key) - case "capabilities": - err = unpopulate(val, "Capabilities", &d.Capabilities) - delete(rawMsg, key) - case "capacity": - err = unpopulate(val, "Capacity", &d.Capacity) - delete(rawMsg, key) - case "connectorOffer": - err = unpopulate(val, "ConnectorOffer", &d.ConnectorOffer) - delete(rawMsg, key) - case "consistencyPolicy": - err = unpopulate(val, "ConsistencyPolicy", &d.ConsistencyPolicy) - delete(rawMsg, key) - case "cors": - err = unpopulate(val, "Cors", &d.Cors) - delete(rawMsg, key) - case "createMode": - err = unpopulate(val, "CreateMode", &d.CreateMode) - delete(rawMsg, key) - case "databaseAccountOfferType": - err = unpopulate(val, "DatabaseAccountOfferType", &d.DatabaseAccountOfferType) - delete(rawMsg, key) - case "defaultIdentity": - err = unpopulate(val, "DefaultIdentity", &d.DefaultIdentity) - delete(rawMsg, key) - case "diagnosticLogSettings": - err = unpopulate(val, "DiagnosticLogSettings", &d.DiagnosticLogSettings) - delete(rawMsg, key) - case "disableKeyBasedMetadataWriteAccess": - err = unpopulate(val, "DisableKeyBasedMetadataWriteAccess", &d.DisableKeyBasedMetadataWriteAccess) - delete(rawMsg, key) - case "disableLocalAuth": - err = unpopulate(val, "DisableLocalAuth", &d.DisableLocalAuth) - delete(rawMsg, key) - case "documentEndpoint": - err = unpopulate(val, "DocumentEndpoint", &d.DocumentEndpoint) - delete(rawMsg, key) - case "enableAnalyticalStorage": - err = unpopulate(val, "EnableAnalyticalStorage", &d.EnableAnalyticalStorage) - delete(rawMsg, key) - case "enableAutomaticFailover": - err = unpopulate(val, "EnableAutomaticFailover", &d.EnableAutomaticFailover) - delete(rawMsg, key) - case "enableCassandraConnector": - err = unpopulate(val, "EnableCassandraConnector", &d.EnableCassandraConnector) - delete(rawMsg, key) - case "enableFreeTier": - err = unpopulate(val, "EnableFreeTier", &d.EnableFreeTier) - delete(rawMsg, key) - case "enableMaterializedViews": - err = unpopulate(val, "EnableMaterializedViews", &d.EnableMaterializedViews) - delete(rawMsg, key) - case "enableMultipleWriteLocations": - err = unpopulate(val, "EnableMultipleWriteLocations", &d.EnableMultipleWriteLocations) - delete(rawMsg, key) - case "failoverPolicies": - err = unpopulate(val, "FailoverPolicies", &d.FailoverPolicies) - delete(rawMsg, key) - case "ipRules": - err = unpopulate(val, "IPRules", &d.IPRules) - delete(rawMsg, key) - case "instanceId": - err = unpopulate(val, "InstanceID", &d.InstanceID) - delete(rawMsg, key) - case "isVirtualNetworkFilterEnabled": - err = unpopulate(val, "IsVirtualNetworkFilterEnabled", &d.IsVirtualNetworkFilterEnabled) - delete(rawMsg, key) - case "keyVaultKeyUri": - err = unpopulate(val, "KeyVaultKeyURI", &d.KeyVaultKeyURI) - delete(rawMsg, key) - case "keysMetadata": - err = unpopulate(val, "KeysMetadata", &d.KeysMetadata) - delete(rawMsg, key) - case "locations": - err = unpopulate(val, "Locations", &d.Locations) - delete(rawMsg, key) - case "networkAclBypass": - err = unpopulate(val, "NetworkACLBypass", &d.NetworkACLBypass) - delete(rawMsg, key) - case "networkAclBypassResourceIds": - err = unpopulate(val, "NetworkACLBypassResourceIDs", &d.NetworkACLBypassResourceIDs) - delete(rawMsg, key) - case "privateEndpointConnections": - err = unpopulate(val, "PrivateEndpointConnections", &d.PrivateEndpointConnections) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) - delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &d.PublicNetworkAccess) - delete(rawMsg, key) - case "readLocations": - err = unpopulate(val, "ReadLocations", &d.ReadLocations) - delete(rawMsg, key) - case "restoreParameters": - err = unpopulate(val, "RestoreParameters", &d.RestoreParameters) - delete(rawMsg, key) - case "virtualNetworkRules": - err = unpopulate(val, "VirtualNetworkRules", &d.VirtualNetworkRules) - delete(rawMsg, key) - case "writeLocations": - err = unpopulate(val, "WriteLocations", &d.WriteLocations) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DatabaseAccountGetResults. -func (d DatabaseAccountGetResults) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", d.ID) - populate(objectMap, "identity", d.Identity) - populate(objectMap, "kind", d.Kind) - populate(objectMap, "location", d.Location) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "systemData", d.SystemData) - populate(objectMap, "tags", d.Tags) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAccountGetResults. -func (d *DatabaseAccountGetResults) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &d.Identity) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &d.Kind) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &d.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &d.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &d.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DatabaseAccountKeysMetadata. -func (d DatabaseAccountKeysMetadata) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "primaryMasterKey", d.PrimaryMasterKey) - populate(objectMap, "primaryReadonlyMasterKey", d.PrimaryReadonlyMasterKey) - populate(objectMap, "secondaryMasterKey", d.SecondaryMasterKey) - populate(objectMap, "secondaryReadonlyMasterKey", d.SecondaryReadonlyMasterKey) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAccountKeysMetadata. -func (d *DatabaseAccountKeysMetadata) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "primaryMasterKey": - err = unpopulate(val, "PrimaryMasterKey", &d.PrimaryMasterKey) - delete(rawMsg, key) - case "primaryReadonlyMasterKey": - err = unpopulate(val, "PrimaryReadonlyMasterKey", &d.PrimaryReadonlyMasterKey) - delete(rawMsg, key) - case "secondaryMasterKey": - err = unpopulate(val, "SecondaryMasterKey", &d.SecondaryMasterKey) - delete(rawMsg, key) - case "secondaryReadonlyMasterKey": - err = unpopulate(val, "SecondaryReadonlyMasterKey", &d.SecondaryReadonlyMasterKey) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DatabaseAccountListConnectionStringsResult. -func (d DatabaseAccountListConnectionStringsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "connectionStrings", d.ConnectionStrings) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAccountListConnectionStringsResult. -func (d *DatabaseAccountListConnectionStringsResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "connectionStrings": - err = unpopulate(val, "ConnectionStrings", &d.ConnectionStrings) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DatabaseAccountListKeysResult. -func (d DatabaseAccountListKeysResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "primaryMasterKey", d.PrimaryMasterKey) - populate(objectMap, "primaryReadonlyMasterKey", d.PrimaryReadonlyMasterKey) - populate(objectMap, "secondaryMasterKey", d.SecondaryMasterKey) - populate(objectMap, "secondaryReadonlyMasterKey", d.SecondaryReadonlyMasterKey) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAccountListKeysResult. -func (d *DatabaseAccountListKeysResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "primaryMasterKey": - err = unpopulate(val, "PrimaryMasterKey", &d.PrimaryMasterKey) - delete(rawMsg, key) - case "primaryReadonlyMasterKey": - err = unpopulate(val, "PrimaryReadonlyMasterKey", &d.PrimaryReadonlyMasterKey) - delete(rawMsg, key) - case "secondaryMasterKey": - err = unpopulate(val, "SecondaryMasterKey", &d.SecondaryMasterKey) - delete(rawMsg, key) - case "secondaryReadonlyMasterKey": - err = unpopulate(val, "SecondaryReadonlyMasterKey", &d.SecondaryReadonlyMasterKey) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DatabaseAccountListReadOnlyKeysResult. -func (d DatabaseAccountListReadOnlyKeysResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "primaryReadonlyMasterKey", d.PrimaryReadonlyMasterKey) - populate(objectMap, "secondaryReadonlyMasterKey", d.SecondaryReadonlyMasterKey) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAccountListReadOnlyKeysResult. -func (d *DatabaseAccountListReadOnlyKeysResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "primaryReadonlyMasterKey": - err = unpopulate(val, "PrimaryReadonlyMasterKey", &d.PrimaryReadonlyMasterKey) - delete(rawMsg, key) - case "secondaryReadonlyMasterKey": - err = unpopulate(val, "SecondaryReadonlyMasterKey", &d.SecondaryReadonlyMasterKey) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DatabaseAccountRegenerateKeyParameters. -func (d DatabaseAccountRegenerateKeyParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "keyKind", d.KeyKind) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAccountRegenerateKeyParameters. -func (d *DatabaseAccountRegenerateKeyParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "keyKind": - err = unpopulate(val, "KeyKind", &d.KeyKind) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DatabaseAccountUpdateParameters. -func (d DatabaseAccountUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "identity", d.Identity) - populate(objectMap, "location", d.Location) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "tags", d.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAccountUpdateParameters. -func (d *DatabaseAccountUpdateParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "identity": - err = unpopulate(val, "Identity", &d.Identity) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &d.Location) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &d.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DatabaseAccountUpdateProperties. -func (d DatabaseAccountUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "apiProperties", d.APIProperties) - populate(objectMap, "analyticalStorageConfiguration", d.AnalyticalStorageConfiguration) - populate(objectMap, "backupPolicy", d.BackupPolicy) - populate(objectMap, "capabilities", d.Capabilities) - populate(objectMap, "capacity", d.Capacity) - populate(objectMap, "connectorOffer", d.ConnectorOffer) - populate(objectMap, "consistencyPolicy", d.ConsistencyPolicy) - populate(objectMap, "cors", d.Cors) - populate(objectMap, "defaultIdentity", d.DefaultIdentity) - populate(objectMap, "diagnosticLogSettings", d.DiagnosticLogSettings) - populate(objectMap, "disableKeyBasedMetadataWriteAccess", d.DisableKeyBasedMetadataWriteAccess) - populate(objectMap, "disableLocalAuth", d.DisableLocalAuth) - populate(objectMap, "enableAnalyticalStorage", d.EnableAnalyticalStorage) - populate(objectMap, "enableAutomaticFailover", d.EnableAutomaticFailover) - populate(objectMap, "enableCassandraConnector", d.EnableCassandraConnector) - populate(objectMap, "enableFreeTier", d.EnableFreeTier) - populate(objectMap, "enableMaterializedViews", d.EnableMaterializedViews) - populate(objectMap, "enableMultipleWriteLocations", d.EnableMultipleWriteLocations) - populate(objectMap, "ipRules", d.IPRules) - populate(objectMap, "isVirtualNetworkFilterEnabled", d.IsVirtualNetworkFilterEnabled) - populate(objectMap, "keyVaultKeyUri", d.KeyVaultKeyURI) - populate(objectMap, "keysMetadata", d.KeysMetadata) - populate(objectMap, "locations", d.Locations) - populate(objectMap, "networkAclBypass", d.NetworkACLBypass) - populate(objectMap, "networkAclBypassResourceIds", d.NetworkACLBypassResourceIDs) - populate(objectMap, "publicNetworkAccess", d.PublicNetworkAccess) - populate(objectMap, "virtualNetworkRules", d.VirtualNetworkRules) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAccountUpdateProperties. -func (d *DatabaseAccountUpdateProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "apiProperties": - err = unpopulate(val, "APIProperties", &d.APIProperties) - delete(rawMsg, key) - case "analyticalStorageConfiguration": - err = unpopulate(val, "AnalyticalStorageConfiguration", &d.AnalyticalStorageConfiguration) - delete(rawMsg, key) - case "backupPolicy": - d.BackupPolicy, err = unmarshalBackupPolicyClassification(val) - delete(rawMsg, key) - case "capabilities": - err = unpopulate(val, "Capabilities", &d.Capabilities) - delete(rawMsg, key) - case "capacity": - err = unpopulate(val, "Capacity", &d.Capacity) - delete(rawMsg, key) - case "connectorOffer": - err = unpopulate(val, "ConnectorOffer", &d.ConnectorOffer) - delete(rawMsg, key) - case "consistencyPolicy": - err = unpopulate(val, "ConsistencyPolicy", &d.ConsistencyPolicy) - delete(rawMsg, key) - case "cors": - err = unpopulate(val, "Cors", &d.Cors) - delete(rawMsg, key) - case "defaultIdentity": - err = unpopulate(val, "DefaultIdentity", &d.DefaultIdentity) - delete(rawMsg, key) - case "diagnosticLogSettings": - err = unpopulate(val, "DiagnosticLogSettings", &d.DiagnosticLogSettings) - delete(rawMsg, key) - case "disableKeyBasedMetadataWriteAccess": - err = unpopulate(val, "DisableKeyBasedMetadataWriteAccess", &d.DisableKeyBasedMetadataWriteAccess) - delete(rawMsg, key) - case "disableLocalAuth": - err = unpopulate(val, "DisableLocalAuth", &d.DisableLocalAuth) - delete(rawMsg, key) - case "enableAnalyticalStorage": - err = unpopulate(val, "EnableAnalyticalStorage", &d.EnableAnalyticalStorage) - delete(rawMsg, key) - case "enableAutomaticFailover": - err = unpopulate(val, "EnableAutomaticFailover", &d.EnableAutomaticFailover) - delete(rawMsg, key) - case "enableCassandraConnector": - err = unpopulate(val, "EnableCassandraConnector", &d.EnableCassandraConnector) - delete(rawMsg, key) - case "enableFreeTier": - err = unpopulate(val, "EnableFreeTier", &d.EnableFreeTier) - delete(rawMsg, key) - case "enableMaterializedViews": - err = unpopulate(val, "EnableMaterializedViews", &d.EnableMaterializedViews) - delete(rawMsg, key) - case "enableMultipleWriteLocations": - err = unpopulate(val, "EnableMultipleWriteLocations", &d.EnableMultipleWriteLocations) - delete(rawMsg, key) - case "ipRules": - err = unpopulate(val, "IPRules", &d.IPRules) - delete(rawMsg, key) - case "isVirtualNetworkFilterEnabled": - err = unpopulate(val, "IsVirtualNetworkFilterEnabled", &d.IsVirtualNetworkFilterEnabled) - delete(rawMsg, key) - case "keyVaultKeyUri": - err = unpopulate(val, "KeyVaultKeyURI", &d.KeyVaultKeyURI) - delete(rawMsg, key) - case "keysMetadata": - err = unpopulate(val, "KeysMetadata", &d.KeysMetadata) - delete(rawMsg, key) - case "locations": - err = unpopulate(val, "Locations", &d.Locations) - delete(rawMsg, key) - case "networkAclBypass": - err = unpopulate(val, "NetworkACLBypass", &d.NetworkACLBypass) - delete(rawMsg, key) - case "networkAclBypassResourceIds": - err = unpopulate(val, "NetworkACLBypassResourceIDs", &d.NetworkACLBypassResourceIDs) - delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &d.PublicNetworkAccess) - delete(rawMsg, key) - case "virtualNetworkRules": - err = unpopulate(val, "VirtualNetworkRules", &d.VirtualNetworkRules) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DatabaseAccountsListResult. -func (d DatabaseAccountsListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "value", d.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAccountsListResult. -func (d *DatabaseAccountsListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "value": - err = unpopulate(val, "Value", &d.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DatabaseRestoreResource. -func (d DatabaseRestoreResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "collectionNames", d.CollectionNames) - populate(objectMap, "databaseName", d.DatabaseName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseRestoreResource. -func (d *DatabaseRestoreResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "collectionNames": - err = unpopulate(val, "CollectionNames", &d.CollectionNames) - delete(rawMsg, key) - case "databaseName": - err = unpopulate(val, "DatabaseName", &d.DatabaseName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiagnosticLogSettings. -func (d DiagnosticLogSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "enableFullTextQuery", d.EnableFullTextQuery) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticLogSettings. -func (d *DiagnosticLogSettings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "enableFullTextQuery": - err = unpopulate(val, "EnableFullTextQuery", &d.EnableFullTextQuery) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ErrorResponse. -func (e ErrorResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "code", e.Code) - populate(objectMap, "message", e.Message) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse. -func (e *ErrorResponse) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "code": - err = unpopulate(val, "Code", &e.Code) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &e.Message) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExcludedPath. -func (e ExcludedPath) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "path", e.Path) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExcludedPath. -func (e *ExcludedPath) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "path": - err = unpopulate(val, "Path", &e.Path) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExtendedResourceProperties. -func (e ExtendedResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "_etag", e.Etag) - populate(objectMap, "_rid", e.Rid) - populate(objectMap, "_ts", e.Ts) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedResourceProperties. -func (e *ExtendedResourceProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "_etag": - err = unpopulate(val, "Etag", &e.Etag) - delete(rawMsg, key) - case "_rid": - err = unpopulate(val, "Rid", &e.Rid) - delete(rawMsg, key) - case "_ts": - err = unpopulate(val, "Ts", &e.Ts) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FailoverPolicies. -func (f FailoverPolicies) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "failoverPolicies", f.FailoverPolicies) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FailoverPolicies. -func (f *FailoverPolicies) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "failoverPolicies": - err = unpopulate(val, "FailoverPolicies", &f.FailoverPolicies) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FailoverPolicy. -func (f FailoverPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "failoverPriority", f.FailoverPriority) - populate(objectMap, "id", f.ID) - populate(objectMap, "locationName", f.LocationName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FailoverPolicy. -func (f *FailoverPolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "failoverPriority": - err = unpopulate(val, "FailoverPriority", &f.FailoverPriority) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &f.ID) - delete(rawMsg, key) - case "locationName": - err = unpopulate(val, "LocationName", &f.LocationName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GraphAPIComputeRegionalServiceResource. -func (g GraphAPIComputeRegionalServiceResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "graphApiComputeEndpoint", g.GraphAPIComputeEndpoint) - populate(objectMap, "location", g.Location) - populate(objectMap, "name", g.Name) - populate(objectMap, "status", g.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GraphAPIComputeRegionalServiceResource. -func (g *GraphAPIComputeRegionalServiceResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "graphApiComputeEndpoint": - err = unpopulate(val, "GraphAPIComputeEndpoint", &g.GraphAPIComputeEndpoint) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &g.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &g.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GraphAPIComputeServiceResource. -func (g GraphAPIComputeServiceResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", g.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GraphAPIComputeServiceResource. -func (g *GraphAPIComputeServiceResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &g.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GraphAPIComputeServiceResourceProperties. -func (g GraphAPIComputeServiceResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "creationTime", g.CreationTime) - populate(objectMap, "graphApiComputeEndpoint", g.GraphAPIComputeEndpoint) - populate(objectMap, "instanceCount", g.InstanceCount) - populate(objectMap, "instanceSize", g.InstanceSize) - populate(objectMap, "locations", g.Locations) - objectMap["serviceType"] = ServiceTypeGraphAPICompute - populate(objectMap, "status", g.Status) - if g.AdditionalProperties != nil { - for key, val := range g.AdditionalProperties { - objectMap[key] = val - } - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GraphAPIComputeServiceResourceProperties. -func (g *GraphAPIComputeServiceResourceProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "creationTime": - err = unpopulateTimeRFC3339(val, "CreationTime", &g.CreationTime) - delete(rawMsg, key) - case "graphApiComputeEndpoint": - err = unpopulate(val, "GraphAPIComputeEndpoint", &g.GraphAPIComputeEndpoint) - delete(rawMsg, key) - case "instanceCount": - err = unpopulate(val, "InstanceCount", &g.InstanceCount) - delete(rawMsg, key) - case "instanceSize": - err = unpopulate(val, "InstanceSize", &g.InstanceSize) - delete(rawMsg, key) - case "locations": - err = unpopulate(val, "Locations", &g.Locations) - delete(rawMsg, key) - case "serviceType": - err = unpopulate(val, "ServiceType", &g.ServiceType) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &g.Status) - delete(rawMsg, key) - default: - if g.AdditionalProperties == nil { - g.AdditionalProperties = map[string]interface{}{} - } - if val != nil { - var aux interface{} - err = json.Unmarshal(val, &aux) - g.AdditionalProperties[key] = aux - } - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GraphResource. -func (g GraphResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", g.ID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GraphResource. -func (g *GraphResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GraphResourceCreateUpdateParameters. -func (g GraphResourceCreateUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", g.ID) - populate(objectMap, "identity", g.Identity) - populate(objectMap, "location", g.Location) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GraphResourceCreateUpdateParameters. -func (g *GraphResourceCreateUpdateParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &g.Identity) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &g.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &g.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &g.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GraphResourceCreateUpdateProperties. -func (g GraphResourceCreateUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "options", g.Options) - populate(objectMap, "resource", g.Resource) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GraphResourceCreateUpdateProperties. -func (g *GraphResourceCreateUpdateProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "options": - err = unpopulate(val, "Options", &g.Options) - delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &g.Resource) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GraphResourceGetProperties. -func (g GraphResourceGetProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "options", g.Options) - populate(objectMap, "resource", g.Resource) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GraphResourceGetProperties. -func (g *GraphResourceGetProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "options": - err = unpopulate(val, "Options", &g.Options) - delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &g.Resource) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GraphResourceGetPropertiesOptions. -func (g GraphResourceGetPropertiesOptions) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "autoscaleSettings", g.AutoscaleSettings) - populate(objectMap, "throughput", g.Throughput) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GraphResourceGetPropertiesOptions. -func (g *GraphResourceGetPropertiesOptions) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "autoscaleSettings": - err = unpopulate(val, "AutoscaleSettings", &g.AutoscaleSettings) - delete(rawMsg, key) - case "throughput": - err = unpopulate(val, "Throughput", &g.Throughput) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GraphResourceGetPropertiesResource. -func (g GraphResourceGetPropertiesResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", g.ID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GraphResourceGetPropertiesResource. -func (g *GraphResourceGetPropertiesResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GraphResourceGetResults. -func (g GraphResourceGetResults) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", g.ID) - populate(objectMap, "identity", g.Identity) - populate(objectMap, "location", g.Location) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GraphResourceGetResults. -func (g *GraphResourceGetResults) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &g.Identity) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &g.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &g.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &g.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GraphResourcesListResult. -func (g GraphResourcesListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "value", g.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GraphResourcesListResult. -func (g *GraphResourcesListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "value": - err = unpopulate(val, "Value", &g.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GremlinDatabaseCreateUpdateParameters. -func (g GremlinDatabaseCreateUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", g.ID) - populate(objectMap, "identity", g.Identity) - populate(objectMap, "location", g.Location) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GremlinDatabaseCreateUpdateParameters. -func (g *GremlinDatabaseCreateUpdateParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &g.Identity) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &g.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &g.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &g.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GremlinDatabaseCreateUpdateProperties. -func (g GremlinDatabaseCreateUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "options", g.Options) - populate(objectMap, "resource", g.Resource) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GremlinDatabaseCreateUpdateProperties. -func (g *GremlinDatabaseCreateUpdateProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "options": - err = unpopulate(val, "Options", &g.Options) - delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &g.Resource) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GremlinDatabaseGetProperties. -func (g GremlinDatabaseGetProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "options", g.Options) - populate(objectMap, "resource", g.Resource) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GremlinDatabaseGetProperties. -func (g *GremlinDatabaseGetProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "options": - err = unpopulate(val, "Options", &g.Options) - delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &g.Resource) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GremlinDatabaseGetPropertiesOptions. -func (g GremlinDatabaseGetPropertiesOptions) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "autoscaleSettings", g.AutoscaleSettings) - populate(objectMap, "throughput", g.Throughput) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GremlinDatabaseGetPropertiesOptions. -func (g *GremlinDatabaseGetPropertiesOptions) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "autoscaleSettings": - err = unpopulate(val, "AutoscaleSettings", &g.AutoscaleSettings) - delete(rawMsg, key) - case "throughput": - err = unpopulate(val, "Throughput", &g.Throughput) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GremlinDatabaseGetPropertiesResource. -func (g GremlinDatabaseGetPropertiesResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "_etag", g.Etag) - populate(objectMap, "id", g.ID) - populate(objectMap, "_rid", g.Rid) - populate(objectMap, "_ts", g.Ts) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GremlinDatabaseGetPropertiesResource. -func (g *GremlinDatabaseGetPropertiesResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "_etag": - err = unpopulate(val, "Etag", &g.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - case "_rid": - err = unpopulate(val, "Rid", &g.Rid) - delete(rawMsg, key) - case "_ts": - err = unpopulate(val, "Ts", &g.Ts) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GremlinDatabaseGetResults. -func (g GremlinDatabaseGetResults) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", g.ID) - populate(objectMap, "identity", g.Identity) - populate(objectMap, "location", g.Location) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GremlinDatabaseGetResults. -func (g *GremlinDatabaseGetResults) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &g.Identity) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &g.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &g.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &g.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GremlinDatabaseListResult. -func (g GremlinDatabaseListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "value", g.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GremlinDatabaseListResult. -func (g *GremlinDatabaseListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "value": - err = unpopulate(val, "Value", &g.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GremlinDatabaseResource. -func (g GremlinDatabaseResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", g.ID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GremlinDatabaseResource. -func (g *GremlinDatabaseResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GremlinDatabaseRestoreResource. -func (g GremlinDatabaseRestoreResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "databaseName", g.DatabaseName) - populate(objectMap, "graphNames", g.GraphNames) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GremlinDatabaseRestoreResource. -func (g *GremlinDatabaseRestoreResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "databaseName": - err = unpopulate(val, "DatabaseName", &g.DatabaseName) - delete(rawMsg, key) - case "graphNames": - err = unpopulate(val, "GraphNames", &g.GraphNames) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GremlinGraphCreateUpdateParameters. -func (g GremlinGraphCreateUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", g.ID) - populate(objectMap, "identity", g.Identity) - populate(objectMap, "location", g.Location) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GremlinGraphCreateUpdateParameters. -func (g *GremlinGraphCreateUpdateParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &g.Identity) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &g.Location) + case "enableMultipleWriteLocations": + err = unpopulate(val, "EnableMultipleWriteLocations", &d.EnableMultipleWriteLocations) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) + case "enablePartitionMerge": + err = unpopulate(val, "EnablePartitionMerge", &d.EnablePartitionMerge) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &g.Properties) + case "ipRules": + err = unpopulate(val, "IPRules", &d.IPRules) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &g.Tags) + case "isVirtualNetworkFilterEnabled": + err = unpopulate(val, "IsVirtualNetworkFilterEnabled", &d.IsVirtualNetworkFilterEnabled) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) + case "keyVaultKeyUri": + err = unpopulate(val, "KeyVaultKeyURI", &d.KeyVaultKeyURI) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GremlinGraphCreateUpdateProperties. -func (g GremlinGraphCreateUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "options", g.Options) - populate(objectMap, "resource", g.Resource) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GremlinGraphCreateUpdateProperties. -func (g *GremlinGraphCreateUpdateProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "options": - err = unpopulate(val, "Options", &g.Options) + case "keysMetadata": + err = unpopulate(val, "KeysMetadata", &d.KeysMetadata) delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &g.Resource) + case "locations": + err = unpopulate(val, "Locations", &d.Locations) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GremlinGraphGetProperties. -func (g GremlinGraphGetProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "options", g.Options) - populate(objectMap, "resource", g.Resource) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GremlinGraphGetProperties. -func (g *GremlinGraphGetProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "options": - err = unpopulate(val, "Options", &g.Options) + case "networkAclBypass": + err = unpopulate(val, "NetworkACLBypass", &d.NetworkACLBypass) delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &g.Resource) + case "networkAclBypassResourceIds": + err = unpopulate(val, "NetworkACLBypassResourceIDs", &d.NetworkACLBypassResourceIDs) + delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &d.PublicNetworkAccess) + delete(rawMsg, key) + case "restoreParameters": + err = unpopulate(val, "RestoreParameters", &d.RestoreParameters) + delete(rawMsg, key) + case "virtualNetworkRules": + err = unpopulate(val, "VirtualNetworkRules", &d.VirtualNetworkRules) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GremlinGraphGetPropertiesOptions. -func (g GremlinGraphGetPropertiesOptions) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseAccountGetProperties. +func (d DatabaseAccountGetProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "autoscaleSettings", g.AutoscaleSettings) - populate(objectMap, "throughput", g.Throughput) + populate(objectMap, "apiProperties", d.APIProperties) + populate(objectMap, "analyticalStorageConfiguration", d.AnalyticalStorageConfiguration) + populate(objectMap, "backupPolicy", d.BackupPolicy) + populate(objectMap, "capabilities", d.Capabilities) + populate(objectMap, "capacity", d.Capacity) + populate(objectMap, "connectorOffer", d.ConnectorOffer) + populate(objectMap, "consistencyPolicy", d.ConsistencyPolicy) + populate(objectMap, "cors", d.Cors) + populate(objectMap, "createMode", d.CreateMode) + objectMap["databaseAccountOfferType"] = "Standard" + populate(objectMap, "defaultIdentity", d.DefaultIdentity) + populate(objectMap, "disableKeyBasedMetadataWriteAccess", d.DisableKeyBasedMetadataWriteAccess) + populate(objectMap, "disableLocalAuth", d.DisableLocalAuth) + populate(objectMap, "documentEndpoint", d.DocumentEndpoint) + populate(objectMap, "enableAnalyticalStorage", d.EnableAnalyticalStorage) + populate(objectMap, "enableAutomaticFailover", d.EnableAutomaticFailover) + populate(objectMap, "enableCassandraConnector", d.EnableCassandraConnector) + populate(objectMap, "enableFreeTier", d.EnableFreeTier) + populate(objectMap, "enableMultipleWriteLocations", d.EnableMultipleWriteLocations) + populate(objectMap, "enablePartitionMerge", d.EnablePartitionMerge) + populate(objectMap, "failoverPolicies", d.FailoverPolicies) + populate(objectMap, "ipRules", d.IPRules) + populate(objectMap, "instanceId", d.InstanceID) + populate(objectMap, "isVirtualNetworkFilterEnabled", d.IsVirtualNetworkFilterEnabled) + populate(objectMap, "keyVaultKeyUri", d.KeyVaultKeyURI) + populate(objectMap, "keysMetadata", d.KeysMetadata) + populate(objectMap, "locations", d.Locations) + populate(objectMap, "networkAclBypass", d.NetworkACLBypass) + populate(objectMap, "networkAclBypassResourceIds", d.NetworkACLBypassResourceIDs) + populate(objectMap, "privateEndpointConnections", d.PrivateEndpointConnections) + populate(objectMap, "provisioningState", d.ProvisioningState) + populate(objectMap, "publicNetworkAccess", d.PublicNetworkAccess) + populate(objectMap, "readLocations", d.ReadLocations) + populate(objectMap, "restoreParameters", d.RestoreParameters) + populate(objectMap, "virtualNetworkRules", d.VirtualNetworkRules) + populate(objectMap, "writeLocations", d.WriteLocations) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GremlinGraphGetPropertiesOptions. -func (g *GremlinGraphGetPropertiesOptions) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAccountGetProperties. +func (d *DatabaseAccountGetProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "autoscaleSettings": - err = unpopulate(val, "AutoscaleSettings", &g.AutoscaleSettings) + case "apiProperties": + err = unpopulate(val, "APIProperties", &d.APIProperties) delete(rawMsg, key) - case "throughput": - err = unpopulate(val, "Throughput", &g.Throughput) + case "analyticalStorageConfiguration": + err = unpopulate(val, "AnalyticalStorageConfiguration", &d.AnalyticalStorageConfiguration) + delete(rawMsg, key) + case "backupPolicy": + d.BackupPolicy, err = unmarshalBackupPolicyClassification(val) + delete(rawMsg, key) + case "capabilities": + err = unpopulate(val, "Capabilities", &d.Capabilities) + delete(rawMsg, key) + case "capacity": + err = unpopulate(val, "Capacity", &d.Capacity) + delete(rawMsg, key) + case "connectorOffer": + err = unpopulate(val, "ConnectorOffer", &d.ConnectorOffer) + delete(rawMsg, key) + case "consistencyPolicy": + err = unpopulate(val, "ConsistencyPolicy", &d.ConsistencyPolicy) + delete(rawMsg, key) + case "cors": + err = unpopulate(val, "Cors", &d.Cors) + delete(rawMsg, key) + case "createMode": + err = unpopulate(val, "CreateMode", &d.CreateMode) + delete(rawMsg, key) + case "databaseAccountOfferType": + err = unpopulate(val, "DatabaseAccountOfferType", &d.DatabaseAccountOfferType) + delete(rawMsg, key) + case "defaultIdentity": + err = unpopulate(val, "DefaultIdentity", &d.DefaultIdentity) + delete(rawMsg, key) + case "disableKeyBasedMetadataWriteAccess": + err = unpopulate(val, "DisableKeyBasedMetadataWriteAccess", &d.DisableKeyBasedMetadataWriteAccess) + delete(rawMsg, key) + case "disableLocalAuth": + err = unpopulate(val, "DisableLocalAuth", &d.DisableLocalAuth) + delete(rawMsg, key) + case "documentEndpoint": + err = unpopulate(val, "DocumentEndpoint", &d.DocumentEndpoint) + delete(rawMsg, key) + case "enableAnalyticalStorage": + err = unpopulate(val, "EnableAnalyticalStorage", &d.EnableAnalyticalStorage) + delete(rawMsg, key) + case "enableAutomaticFailover": + err = unpopulate(val, "EnableAutomaticFailover", &d.EnableAutomaticFailover) + delete(rawMsg, key) + case "enableCassandraConnector": + err = unpopulate(val, "EnableCassandraConnector", &d.EnableCassandraConnector) + delete(rawMsg, key) + case "enableFreeTier": + err = unpopulate(val, "EnableFreeTier", &d.EnableFreeTier) + delete(rawMsg, key) + case "enableMultipleWriteLocations": + err = unpopulate(val, "EnableMultipleWriteLocations", &d.EnableMultipleWriteLocations) + delete(rawMsg, key) + case "enablePartitionMerge": + err = unpopulate(val, "EnablePartitionMerge", &d.EnablePartitionMerge) + delete(rawMsg, key) + case "failoverPolicies": + err = unpopulate(val, "FailoverPolicies", &d.FailoverPolicies) + delete(rawMsg, key) + case "ipRules": + err = unpopulate(val, "IPRules", &d.IPRules) + delete(rawMsg, key) + case "instanceId": + err = unpopulate(val, "InstanceID", &d.InstanceID) + delete(rawMsg, key) + case "isVirtualNetworkFilterEnabled": + err = unpopulate(val, "IsVirtualNetworkFilterEnabled", &d.IsVirtualNetworkFilterEnabled) + delete(rawMsg, key) + case "keyVaultKeyUri": + err = unpopulate(val, "KeyVaultKeyURI", &d.KeyVaultKeyURI) + delete(rawMsg, key) + case "keysMetadata": + err = unpopulate(val, "KeysMetadata", &d.KeysMetadata) + delete(rawMsg, key) + case "locations": + err = unpopulate(val, "Locations", &d.Locations) + delete(rawMsg, key) + case "networkAclBypass": + err = unpopulate(val, "NetworkACLBypass", &d.NetworkACLBypass) + delete(rawMsg, key) + case "networkAclBypassResourceIds": + err = unpopulate(val, "NetworkACLBypassResourceIDs", &d.NetworkACLBypassResourceIDs) + delete(rawMsg, key) + case "privateEndpointConnections": + err = unpopulate(val, "PrivateEndpointConnections", &d.PrivateEndpointConnections) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) + delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &d.PublicNetworkAccess) + delete(rawMsg, key) + case "readLocations": + err = unpopulate(val, "ReadLocations", &d.ReadLocations) + delete(rawMsg, key) + case "restoreParameters": + err = unpopulate(val, "RestoreParameters", &d.RestoreParameters) + delete(rawMsg, key) + case "virtualNetworkRules": + err = unpopulate(val, "VirtualNetworkRules", &d.VirtualNetworkRules) + delete(rawMsg, key) + case "writeLocations": + err = unpopulate(val, "WriteLocations", &d.WriteLocations) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GremlinGraphGetPropertiesResource. -func (g GremlinGraphGetPropertiesResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseAccountGetResults. +func (d DatabaseAccountGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "analyticalStorageTtl", g.AnalyticalStorageTTL) - populate(objectMap, "conflictResolutionPolicy", g.ConflictResolutionPolicy) - populate(objectMap, "defaultTtl", g.DefaultTTL) - populate(objectMap, "_etag", g.Etag) - populate(objectMap, "id", g.ID) - populate(objectMap, "indexingPolicy", g.IndexingPolicy) - populate(objectMap, "partitionKey", g.PartitionKey) - populate(objectMap, "_rid", g.Rid) - populate(objectMap, "_ts", g.Ts) - populate(objectMap, "uniqueKeyPolicy", g.UniqueKeyPolicy) + populate(objectMap, "id", d.ID) + populate(objectMap, "identity", d.Identity) + populate(objectMap, "kind", d.Kind) + populate(objectMap, "location", d.Location) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "tags", d.Tags) + populate(objectMap, "type", d.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GremlinGraphGetPropertiesResource. -func (g *GremlinGraphGetPropertiesResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAccountGetResults. +func (d *DatabaseAccountGetResults) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "analyticalStorageTtl": - err = unpopulate(val, "AnalyticalStorageTTL", &g.AnalyticalStorageTTL) - delete(rawMsg, key) - case "conflictResolutionPolicy": - err = unpopulate(val, "ConflictResolutionPolicy", &g.ConflictResolutionPolicy) + case "id": + err = unpopulate(val, "ID", &d.ID) delete(rawMsg, key) - case "defaultTtl": - err = unpopulate(val, "DefaultTTL", &g.DefaultTTL) + case "identity": + err = unpopulate(val, "Identity", &d.Identity) delete(rawMsg, key) - case "_etag": - err = unpopulate(val, "Etag", &g.Etag) + case "kind": + err = unpopulate(val, "Kind", &d.Kind) delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &g.ID) + case "location": + err = unpopulate(val, "Location", &d.Location) delete(rawMsg, key) - case "indexingPolicy": - err = unpopulate(val, "IndexingPolicy", &g.IndexingPolicy) + case "name": + err = unpopulate(val, "Name", &d.Name) delete(rawMsg, key) - case "partitionKey": - err = unpopulate(val, "PartitionKey", &g.PartitionKey) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) delete(rawMsg, key) - case "_rid": - err = unpopulate(val, "Rid", &g.Rid) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) delete(rawMsg, key) - case "_ts": - err = unpopulate(val, "Ts", &g.Ts) + case "tags": + err = unpopulate(val, "Tags", &d.Tags) delete(rawMsg, key) - case "uniqueKeyPolicy": - err = unpopulate(val, "UniqueKeyPolicy", &g.UniqueKeyPolicy) + case "type": + err = unpopulate(val, "Type", &d.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GremlinGraphGetResults. -func (g GremlinGraphGetResults) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseAccountKeysMetadata. +func (d DatabaseAccountKeysMetadata) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "id", g.ID) - populate(objectMap, "identity", g.Identity) - populate(objectMap, "location", g.Location) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) + populate(objectMap, "primaryMasterKey", d.PrimaryMasterKey) + populate(objectMap, "primaryReadonlyMasterKey", d.PrimaryReadonlyMasterKey) + populate(objectMap, "secondaryMasterKey", d.SecondaryMasterKey) + populate(objectMap, "secondaryReadonlyMasterKey", d.SecondaryReadonlyMasterKey) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GremlinGraphGetResults. -func (g *GremlinGraphGetResults) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAccountKeysMetadata. +func (d *DatabaseAccountKeysMetadata) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &g.Identity) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &g.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) + case "primaryMasterKey": + err = unpopulate(val, "PrimaryMasterKey", &d.PrimaryMasterKey) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &g.Properties) + case "primaryReadonlyMasterKey": + err = unpopulate(val, "PrimaryReadonlyMasterKey", &d.PrimaryReadonlyMasterKey) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &g.Tags) + case "secondaryMasterKey": + err = unpopulate(val, "SecondaryMasterKey", &d.SecondaryMasterKey) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) + case "secondaryReadonlyMasterKey": + err = unpopulate(val, "SecondaryReadonlyMasterKey", &d.SecondaryReadonlyMasterKey) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GremlinGraphListResult. -func (g GremlinGraphListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseAccountListConnectionStringsResult. +func (d DatabaseAccountListConnectionStringsResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "value", g.Value) + populate(objectMap, "connectionStrings", d.ConnectionStrings) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GremlinGraphListResult. -func (g *GremlinGraphListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAccountListConnectionStringsResult. +func (d *DatabaseAccountListConnectionStringsResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &g.Value) + case "connectionStrings": + err = unpopulate(val, "ConnectionStrings", &d.ConnectionStrings) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GremlinGraphResource. -func (g GremlinGraphResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseAccountListKeysResult. +func (d DatabaseAccountListKeysResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "analyticalStorageTtl", g.AnalyticalStorageTTL) - populate(objectMap, "conflictResolutionPolicy", g.ConflictResolutionPolicy) - populate(objectMap, "defaultTtl", g.DefaultTTL) - populate(objectMap, "id", g.ID) - populate(objectMap, "indexingPolicy", g.IndexingPolicy) - populate(objectMap, "partitionKey", g.PartitionKey) - populate(objectMap, "uniqueKeyPolicy", g.UniqueKeyPolicy) + populate(objectMap, "primaryMasterKey", d.PrimaryMasterKey) + populate(objectMap, "primaryReadonlyMasterKey", d.PrimaryReadonlyMasterKey) + populate(objectMap, "secondaryMasterKey", d.SecondaryMasterKey) + populate(objectMap, "secondaryReadonlyMasterKey", d.SecondaryReadonlyMasterKey) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GremlinGraphResource. -func (g *GremlinGraphResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAccountListKeysResult. +func (d *DatabaseAccountListKeysResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "analyticalStorageTtl": - err = unpopulate(val, "AnalyticalStorageTTL", &g.AnalyticalStorageTTL) - delete(rawMsg, key) - case "conflictResolutionPolicy": - err = unpopulate(val, "ConflictResolutionPolicy", &g.ConflictResolutionPolicy) - delete(rawMsg, key) - case "defaultTtl": - err = unpopulate(val, "DefaultTTL", &g.DefaultTTL) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &g.ID) + case "primaryMasterKey": + err = unpopulate(val, "PrimaryMasterKey", &d.PrimaryMasterKey) delete(rawMsg, key) - case "indexingPolicy": - err = unpopulate(val, "IndexingPolicy", &g.IndexingPolicy) + case "primaryReadonlyMasterKey": + err = unpopulate(val, "PrimaryReadonlyMasterKey", &d.PrimaryReadonlyMasterKey) delete(rawMsg, key) - case "partitionKey": - err = unpopulate(val, "PartitionKey", &g.PartitionKey) + case "secondaryMasterKey": + err = unpopulate(val, "SecondaryMasterKey", &d.SecondaryMasterKey) delete(rawMsg, key) - case "uniqueKeyPolicy": - err = unpopulate(val, "UniqueKeyPolicy", &g.UniqueKeyPolicy) + case "secondaryReadonlyMasterKey": + err = unpopulate(val, "SecondaryReadonlyMasterKey", &d.SecondaryReadonlyMasterKey) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IPAddressOrRange. -func (i IPAddressOrRange) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseAccountListReadOnlyKeysResult. +func (d DatabaseAccountListReadOnlyKeysResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "ipAddressOrRange", i.IPAddressOrRange) + populate(objectMap, "primaryReadonlyMasterKey", d.PrimaryReadonlyMasterKey) + populate(objectMap, "secondaryReadonlyMasterKey", d.SecondaryReadonlyMasterKey) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IPAddressOrRange. -func (i *IPAddressOrRange) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAccountListReadOnlyKeysResult. +func (d *DatabaseAccountListReadOnlyKeysResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "ipAddressOrRange": - err = unpopulate(val, "IPAddressOrRange", &i.IPAddressOrRange) + case "primaryReadonlyMasterKey": + err = unpopulate(val, "PrimaryReadonlyMasterKey", &d.PrimaryReadonlyMasterKey) + delete(rawMsg, key) + case "secondaryReadonlyMasterKey": + err = unpopulate(val, "SecondaryReadonlyMasterKey", &d.SecondaryReadonlyMasterKey) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IncludedPath. -func (i IncludedPath) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseAccountRegenerateKeyParameters. +func (d DatabaseAccountRegenerateKeyParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "indexes", i.Indexes) - populate(objectMap, "path", i.Path) + populate(objectMap, "keyKind", d.KeyKind) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IncludedPath. -func (i *IncludedPath) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAccountRegenerateKeyParameters. +func (d *DatabaseAccountRegenerateKeyParameters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "indexes": - err = unpopulate(val, "Indexes", &i.Indexes) - delete(rawMsg, key) - case "path": - err = unpopulate(val, "Path", &i.Path) + case "keyKind": + err = unpopulate(val, "KeyKind", &d.KeyKind) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Indexes. -func (i Indexes) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseAccountUpdateParameters. +func (d DatabaseAccountUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "dataType", i.DataType) - populate(objectMap, "kind", i.Kind) - populate(objectMap, "precision", i.Precision) + populate(objectMap, "identity", d.Identity) + populate(objectMap, "location", d.Location) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "tags", d.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Indexes. -func (i *Indexes) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAccountUpdateParameters. +func (d *DatabaseAccountUpdateParameters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "dataType": - err = unpopulate(val, "DataType", &i.DataType) + case "identity": + err = unpopulate(val, "Identity", &d.Identity) delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &i.Kind) + case "location": + err = unpopulate(val, "Location", &d.Location) delete(rawMsg, key) - case "precision": - err = unpopulate(val, "Precision", &i.Precision) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &d.Tags) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IndexingPolicy. -func (i IndexingPolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseAccountUpdateProperties. +func (d DatabaseAccountUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "automatic", i.Automatic) - populate(objectMap, "compositeIndexes", i.CompositeIndexes) - populate(objectMap, "excludedPaths", i.ExcludedPaths) - populate(objectMap, "includedPaths", i.IncludedPaths) - populate(objectMap, "indexingMode", i.IndexingMode) - populate(objectMap, "spatialIndexes", i.SpatialIndexes) + populate(objectMap, "apiProperties", d.APIProperties) + populate(objectMap, "analyticalStorageConfiguration", d.AnalyticalStorageConfiguration) + populate(objectMap, "backupPolicy", d.BackupPolicy) + populate(objectMap, "capabilities", d.Capabilities) + populate(objectMap, "capacity", d.Capacity) + populate(objectMap, "connectorOffer", d.ConnectorOffer) + populate(objectMap, "consistencyPolicy", d.ConsistencyPolicy) + populate(objectMap, "cors", d.Cors) + populate(objectMap, "defaultIdentity", d.DefaultIdentity) + populate(objectMap, "disableKeyBasedMetadataWriteAccess", d.DisableKeyBasedMetadataWriteAccess) + populate(objectMap, "disableLocalAuth", d.DisableLocalAuth) + populate(objectMap, "enableAnalyticalStorage", d.EnableAnalyticalStorage) + populate(objectMap, "enableAutomaticFailover", d.EnableAutomaticFailover) + populate(objectMap, "enableCassandraConnector", d.EnableCassandraConnector) + populate(objectMap, "enableFreeTier", d.EnableFreeTier) + populate(objectMap, "enableMultipleWriteLocations", d.EnableMultipleWriteLocations) + populate(objectMap, "enablePartitionMerge", d.EnablePartitionMerge) + populate(objectMap, "ipRules", d.IPRules) + populate(objectMap, "isVirtualNetworkFilterEnabled", d.IsVirtualNetworkFilterEnabled) + populate(objectMap, "keyVaultKeyUri", d.KeyVaultKeyURI) + populate(objectMap, "keysMetadata", d.KeysMetadata) + populate(objectMap, "locations", d.Locations) + populate(objectMap, "networkAclBypass", d.NetworkACLBypass) + populate(objectMap, "networkAclBypassResourceIds", d.NetworkACLBypassResourceIDs) + populate(objectMap, "publicNetworkAccess", d.PublicNetworkAccess) + populate(objectMap, "virtualNetworkRules", d.VirtualNetworkRules) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IndexingPolicy. -func (i *IndexingPolicy) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAccountUpdateProperties. +func (d *DatabaseAccountUpdateProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "automatic": - err = unpopulate(val, "Automatic", &i.Automatic) + case "apiProperties": + err = unpopulate(val, "APIProperties", &d.APIProperties) + delete(rawMsg, key) + case "analyticalStorageConfiguration": + err = unpopulate(val, "AnalyticalStorageConfiguration", &d.AnalyticalStorageConfiguration) + delete(rawMsg, key) + case "backupPolicy": + d.BackupPolicy, err = unmarshalBackupPolicyClassification(val) + delete(rawMsg, key) + case "capabilities": + err = unpopulate(val, "Capabilities", &d.Capabilities) + delete(rawMsg, key) + case "capacity": + err = unpopulate(val, "Capacity", &d.Capacity) + delete(rawMsg, key) + case "connectorOffer": + err = unpopulate(val, "ConnectorOffer", &d.ConnectorOffer) + delete(rawMsg, key) + case "consistencyPolicy": + err = unpopulate(val, "ConsistencyPolicy", &d.ConsistencyPolicy) + delete(rawMsg, key) + case "cors": + err = unpopulate(val, "Cors", &d.Cors) + delete(rawMsg, key) + case "defaultIdentity": + err = unpopulate(val, "DefaultIdentity", &d.DefaultIdentity) + delete(rawMsg, key) + case "disableKeyBasedMetadataWriteAccess": + err = unpopulate(val, "DisableKeyBasedMetadataWriteAccess", &d.DisableKeyBasedMetadataWriteAccess) + delete(rawMsg, key) + case "disableLocalAuth": + err = unpopulate(val, "DisableLocalAuth", &d.DisableLocalAuth) + delete(rawMsg, key) + case "enableAnalyticalStorage": + err = unpopulate(val, "EnableAnalyticalStorage", &d.EnableAnalyticalStorage) + delete(rawMsg, key) + case "enableAutomaticFailover": + err = unpopulate(val, "EnableAutomaticFailover", &d.EnableAutomaticFailover) delete(rawMsg, key) - case "compositeIndexes": - err = unpopulate(val, "CompositeIndexes", &i.CompositeIndexes) + case "enableCassandraConnector": + err = unpopulate(val, "EnableCassandraConnector", &d.EnableCassandraConnector) delete(rawMsg, key) - case "excludedPaths": - err = unpopulate(val, "ExcludedPaths", &i.ExcludedPaths) + case "enableFreeTier": + err = unpopulate(val, "EnableFreeTier", &d.EnableFreeTier) delete(rawMsg, key) - case "includedPaths": - err = unpopulate(val, "IncludedPaths", &i.IncludedPaths) + case "enableMultipleWriteLocations": + err = unpopulate(val, "EnableMultipleWriteLocations", &d.EnableMultipleWriteLocations) delete(rawMsg, key) - case "indexingMode": - err = unpopulate(val, "IndexingMode", &i.IndexingMode) + case "enablePartitionMerge": + err = unpopulate(val, "EnablePartitionMerge", &d.EnablePartitionMerge) delete(rawMsg, key) - case "spatialIndexes": - err = unpopulate(val, "SpatialIndexes", &i.SpatialIndexes) + case "ipRules": + err = unpopulate(val, "IPRules", &d.IPRules) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type KeyWrapMetadata. -func (k KeyWrapMetadata) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "algorithm", k.Algorithm) - populate(objectMap, "name", k.Name) - populate(objectMap, "type", k.Type) - populate(objectMap, "value", k.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type KeyWrapMetadata. -func (k *KeyWrapMetadata) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "algorithm": - err = unpopulate(val, "Algorithm", &k.Algorithm) + case "isVirtualNetworkFilterEnabled": + err = unpopulate(val, "IsVirtualNetworkFilterEnabled", &d.IsVirtualNetworkFilterEnabled) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &k.Name) + case "keyVaultKeyUri": + err = unpopulate(val, "KeyVaultKeyURI", &d.KeyVaultKeyURI) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &k.Type) + case "keysMetadata": + err = unpopulate(val, "KeysMetadata", &d.KeysMetadata) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &k.Value) + case "locations": + err = unpopulate(val, "Locations", &d.Locations) + delete(rawMsg, key) + case "networkAclBypass": + err = unpopulate(val, "NetworkACLBypass", &d.NetworkACLBypass) + delete(rawMsg, key) + case "networkAclBypassResourceIds": + err = unpopulate(val, "NetworkACLBypassResourceIDs", &d.NetworkACLBypassResourceIDs) + delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &d.PublicNetworkAccess) + delete(rawMsg, key) + case "virtualNetworkRules": + err = unpopulate(val, "VirtualNetworkRules", &d.VirtualNetworkRules) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ListBackups. -func (l ListBackups) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseAccountsListResult. +func (d DatabaseAccountsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "value", l.Value) + populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ListBackups. -func (l *ListBackups) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAccountsListResult. +func (d *DatabaseAccountsListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { case "value": - err = unpopulate(val, "Value", &l.Value) + err = unpopulate(val, "Value", &d.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ListClusters. -func (l ListClusters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseRestoreResource. +func (d DatabaseRestoreResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "value", l.Value) + populate(objectMap, "collectionNames", d.CollectionNames) + populate(objectMap, "databaseName", d.DatabaseName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ListClusters. -func (l *ListClusters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseRestoreResource. +func (d *DatabaseRestoreResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &l.Value) + case "collectionNames": + err = unpopulate(val, "CollectionNames", &d.CollectionNames) + delete(rawMsg, key) + case "databaseName": + err = unpopulate(val, "DatabaseName", &d.DatabaseName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ListDataCenters. -func (l ListDataCenters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ErrorResponse. +func (e ErrorResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "value", l.Value) + populate(objectMap, "code", e.Code) + populate(objectMap, "message", e.Message) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ListDataCenters. -func (l *ListDataCenters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse. +func (e *ErrorResponse) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &l.Value) + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Location. -func (l Location) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ExcludedPath. +func (e ExcludedPath) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "documentEndpoint", l.DocumentEndpoint) - populate(objectMap, "failoverPriority", l.FailoverPriority) - populate(objectMap, "id", l.ID) - populate(objectMap, "isZoneRedundant", l.IsZoneRedundant) - populate(objectMap, "locationName", l.LocationName) - populate(objectMap, "provisioningState", l.ProvisioningState) + populate(objectMap, "path", e.Path) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Location. -func (l *Location) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ExcludedPath. +func (e *ExcludedPath) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "documentEndpoint": - err = unpopulate(val, "DocumentEndpoint", &l.DocumentEndpoint) - delete(rawMsg, key) - case "failoverPriority": - err = unpopulate(val, "FailoverPriority", &l.FailoverPriority) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &l.ID) - delete(rawMsg, key) - case "isZoneRedundant": - err = unpopulate(val, "IsZoneRedundant", &l.IsZoneRedundant) - delete(rawMsg, key) - case "locationName": - err = unpopulate(val, "LocationName", &l.LocationName) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &l.ProvisioningState) + case "path": + err = unpopulate(val, "Path", &e.Path) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LocationGetResult. -func (l LocationGetResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ExtendedResourceProperties. +func (e ExtendedResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "id", l.ID) - populate(objectMap, "name", l.Name) - populate(objectMap, "properties", l.Properties) - populate(objectMap, "type", l.Type) + populate(objectMap, "_etag", e.Etag) + populate(objectMap, "_rid", e.Rid) + populate(objectMap, "_ts", e.Ts) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LocationGetResult. -func (l *LocationGetResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedResourceProperties. +func (e *ExtendedResourceProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &l.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &l.Name) + case "_etag": + err = unpopulate(val, "Etag", &e.Etag) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &l.Properties) + case "_rid": + err = unpopulate(val, "Rid", &e.Rid) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &l.Type) + case "_ts": + err = unpopulate(val, "Ts", &e.Ts) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LocationListResult. -func (l LocationListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type FailoverPolicies. +func (f FailoverPolicies) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "value", l.Value) + populate(objectMap, "failoverPolicies", f.FailoverPolicies) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LocationListResult. -func (l *LocationListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type FailoverPolicies. +func (f *FailoverPolicies) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &l.Value) + case "failoverPolicies": + err = unpopulate(val, "FailoverPolicies", &f.FailoverPolicies) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LocationProperties. -func (l LocationProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type FailoverPolicy. +func (f FailoverPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "backupStorageRedundancies", l.BackupStorageRedundancies) - populate(objectMap, "isResidencyRestricted", l.IsResidencyRestricted) - populate(objectMap, "status", l.Status) - populate(objectMap, "supportsAvailabilityZone", l.SupportsAvailabilityZone) + populate(objectMap, "failoverPriority", f.FailoverPriority) + populate(objectMap, "id", f.ID) + populate(objectMap, "locationName", f.LocationName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LocationProperties. -func (l *LocationProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type FailoverPolicy. +func (f *FailoverPolicy) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } for key, val := range rawMsg { var err error switch key { - case "backupStorageRedundancies": - err = unpopulate(val, "BackupStorageRedundancies", &l.BackupStorageRedundancies) - delete(rawMsg, key) - case "isResidencyRestricted": - err = unpopulate(val, "IsResidencyRestricted", &l.IsResidencyRestricted) + case "failoverPriority": + err = unpopulate(val, "FailoverPriority", &f.FailoverPriority) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &l.Status) + case "id": + err = unpopulate(val, "ID", &f.ID) delete(rawMsg, key) - case "supportsAvailabilityZone": - err = unpopulate(val, "SupportsAvailabilityZone", &l.SupportsAvailabilityZone) + case "locationName": + err = unpopulate(val, "LocationName", &f.LocationName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedCassandraARMResourceProperties. -func (m ManagedCassandraARMResourceProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GraphAPIComputeRegionalServiceResource. +func (g GraphAPIComputeRegionalServiceResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "id", m.ID) - populate(objectMap, "identity", m.Identity) - populate(objectMap, "location", m.Location) - populate(objectMap, "name", m.Name) - populate(objectMap, "tags", m.Tags) - populate(objectMap, "type", m.Type) + populate(objectMap, "graphApiComputeEndpoint", g.GraphAPIComputeEndpoint) + populate(objectMap, "location", g.Location) + populate(objectMap, "name", g.Name) + populate(objectMap, "status", g.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedCassandraARMResourceProperties. -func (m *ManagedCassandraARMResourceProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GraphAPIComputeRegionalServiceResource. +func (g *GraphAPIComputeRegionalServiceResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &m.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &m.Identity) + case "graphApiComputeEndpoint": + err = unpopulate(val, "GraphAPIComputeEndpoint", &g.GraphAPIComputeEndpoint) delete(rawMsg, key) case "location": - err = unpopulate(val, "Location", &m.Location) + err = unpopulate(val, "Location", &g.Location) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &m.Name) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &m.Tags) + err = unpopulate(val, "Name", &g.Name) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + case "status": + err = unpopulate(val, "Status", &g.Status) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedCassandraManagedServiceIdentity. -func (m ManagedCassandraManagedServiceIdentity) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GraphAPIComputeServiceResource. +func (g GraphAPIComputeServiceResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "principalId", m.PrincipalID) - populate(objectMap, "tenantId", m.TenantID) - populate(objectMap, "type", m.Type) + populate(objectMap, "properties", g.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedCassandraManagedServiceIdentity. -func (m *ManagedCassandraManagedServiceIdentity) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GraphAPIComputeServiceResource. +func (g *GraphAPIComputeServiceResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "principalId": - err = unpopulate(val, "PrincipalID", &m.PrincipalID) - delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, "TenantID", &m.TenantID) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + case "properties": + err = unpopulate(val, "Properties", &g.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedCassandraReaperStatus. -func (m ManagedCassandraReaperStatus) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GraphAPIComputeServiceResourceProperties. +func (g GraphAPIComputeServiceResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "healthy", m.Healthy) - populate(objectMap, "repairRunIds", m.RepairRunIDs) - populate(objectMap, "repairSchedules", m.RepairSchedules) + populateTimeRFC3339(objectMap, "creationTime", g.CreationTime) + populate(objectMap, "graphApiComputeEndpoint", g.GraphAPIComputeEndpoint) + populate(objectMap, "instanceCount", g.InstanceCount) + populate(objectMap, "instanceSize", g.InstanceSize) + populate(objectMap, "locations", g.Locations) + objectMap["serviceType"] = ServiceTypeGraphAPICompute + populate(objectMap, "status", g.Status) + if g.AdditionalProperties != nil { + for key, val := range g.AdditionalProperties { + objectMap[key] = val + } + } return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedCassandraReaperStatus. -func (m *ManagedCassandraReaperStatus) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GraphAPIComputeServiceResourceProperties. +func (g *GraphAPIComputeServiceResourceProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "healthy": - err = unpopulate(val, "Healthy", &m.Healthy) + case "creationTime": + err = unpopulateTimeRFC3339(val, "CreationTime", &g.CreationTime) delete(rawMsg, key) - case "repairRunIds": - err = unpopulate(val, "RepairRunIDs", &m.RepairRunIDs) + case "graphApiComputeEndpoint": + err = unpopulate(val, "GraphAPIComputeEndpoint", &g.GraphAPIComputeEndpoint) delete(rawMsg, key) - case "repairSchedules": - err = unpopulate(val, "RepairSchedules", &m.RepairSchedules) + case "instanceCount": + err = unpopulate(val, "InstanceCount", &g.InstanceCount) + delete(rawMsg, key) + case "instanceSize": + err = unpopulate(val, "InstanceSize", &g.InstanceSize) + delete(rawMsg, key) + case "locations": + err = unpopulate(val, "Locations", &g.Locations) + delete(rawMsg, key) + case "serviceType": + err = unpopulate(val, "ServiceType", &g.ServiceType) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &g.Status) + delete(rawMsg, key) + default: + if g.AdditionalProperties == nil { + g.AdditionalProperties = map[string]interface{}{} + } + if val != nil { + var aux interface{} + err = json.Unmarshal(val, &aux) + g.AdditionalProperties[key] = aux + } delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedServiceIdentity. -func (m ManagedServiceIdentity) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GremlinDatabaseCreateUpdateParameters. +func (g GremlinDatabaseCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "principalId", m.PrincipalID) - populate(objectMap, "tenantId", m.TenantID) - populate(objectMap, "type", m.Type) - populate(objectMap, "userAssignedIdentities", m.UserAssignedIdentities) + populate(objectMap, "id", g.ID) + populate(objectMap, "location", g.Location) + populate(objectMap, "name", g.Name) + populate(objectMap, "properties", g.Properties) + populate(objectMap, "tags", g.Tags) + populate(objectMap, "type", g.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServiceIdentity. -func (m *ManagedServiceIdentity) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GremlinDatabaseCreateUpdateParameters. +func (g *GremlinDatabaseCreateUpdateParameters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "principalId": - err = unpopulate(val, "PrincipalID", &m.PrincipalID) + case "id": + err = unpopulate(val, "ID", &g.ID) delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, "TenantID", &m.TenantID) + case "location": + err = unpopulate(val, "Location", &g.Location) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + case "name": + err = unpopulate(val, "Name", &g.Name) delete(rawMsg, key) - case "userAssignedIdentities": - err = unpopulate(val, "UserAssignedIdentities", &m.UserAssignedIdentities) + case "properties": + err = unpopulate(val, "Properties", &g.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &g.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &g.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MaterializedViewsBuilderRegionalServiceResource. -func (m MaterializedViewsBuilderRegionalServiceResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GremlinDatabaseCreateUpdateProperties. +func (g GremlinDatabaseCreateUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "location", m.Location) - populate(objectMap, "name", m.Name) - populate(objectMap, "status", m.Status) + populate(objectMap, "options", g.Options) + populate(objectMap, "resource", g.Resource) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MaterializedViewsBuilderRegionalServiceResource. -func (m *MaterializedViewsBuilderRegionalServiceResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GremlinDatabaseCreateUpdateProperties. +func (g *GremlinDatabaseCreateUpdateProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "location": - err = unpopulate(val, "Location", &m.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) + case "options": + err = unpopulate(val, "Options", &g.Options) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &m.Status) + case "resource": + err = unpopulate(val, "Resource", &g.Resource) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MaterializedViewsBuilderServiceResource. -func (m MaterializedViewsBuilderServiceResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GremlinDatabaseGetProperties. +func (g GremlinDatabaseGetProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "properties", m.Properties) + populate(objectMap, "options", g.Options) + populate(objectMap, "resource", g.Resource) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MaterializedViewsBuilderServiceResource. -func (m *MaterializedViewsBuilderServiceResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GremlinDatabaseGetProperties. +func (g *GremlinDatabaseGetProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &m.Properties) + case "options": + err = unpopulate(val, "Options", &g.Options) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &g.Resource) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MaterializedViewsBuilderServiceResourceProperties. -func (m MaterializedViewsBuilderServiceResourceProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GremlinDatabaseGetPropertiesOptions. +func (g GremlinDatabaseGetPropertiesOptions) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "creationTime", m.CreationTime) - populate(objectMap, "instanceCount", m.InstanceCount) - populate(objectMap, "instanceSize", m.InstanceSize) - populate(objectMap, "locations", m.Locations) - objectMap["serviceType"] = ServiceTypeMaterializedViewsBuilder - populate(objectMap, "status", m.Status) - if m.AdditionalProperties != nil { - for key, val := range m.AdditionalProperties { - objectMap[key] = val - } - } + populate(objectMap, "autoscaleSettings", g.AutoscaleSettings) + populate(objectMap, "throughput", g.Throughput) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MaterializedViewsBuilderServiceResourceProperties. -func (m *MaterializedViewsBuilderServiceResourceProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GremlinDatabaseGetPropertiesOptions. +func (g *GremlinDatabaseGetPropertiesOptions) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "creationTime": - err = unpopulateTimeRFC3339(val, "CreationTime", &m.CreationTime) - delete(rawMsg, key) - case "instanceCount": - err = unpopulate(val, "InstanceCount", &m.InstanceCount) - delete(rawMsg, key) - case "instanceSize": - err = unpopulate(val, "InstanceSize", &m.InstanceSize) - delete(rawMsg, key) - case "locations": - err = unpopulate(val, "Locations", &m.Locations) - delete(rawMsg, key) - case "serviceType": - err = unpopulate(val, "ServiceType", &m.ServiceType) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &m.Status) - delete(rawMsg, key) - default: - if m.AdditionalProperties == nil { - m.AdditionalProperties = map[string]interface{}{} - } - if val != nil { - var aux interface{} - err = json.Unmarshal(val, &aux) - m.AdditionalProperties[key] = aux - } + case "autoscaleSettings": + err = unpopulate(val, "AutoscaleSettings", &g.AutoscaleSettings) + delete(rawMsg, key) + case "throughput": + err = unpopulate(val, "Throughput", &g.Throughput) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MergeParameters. -func (m MergeParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GremlinDatabaseGetPropertiesResource. +func (g GremlinDatabaseGetPropertiesResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "isDryRun", m.IsDryRun) + populate(objectMap, "_etag", g.Etag) + populate(objectMap, "id", g.ID) + populate(objectMap, "_rid", g.Rid) + populate(objectMap, "_ts", g.Ts) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MergeParameters. -func (m *MergeParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GremlinDatabaseGetPropertiesResource. +func (g *GremlinDatabaseGetPropertiesResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "isDryRun": - err = unpopulate(val, "IsDryRun", &m.IsDryRun) + case "_etag": + err = unpopulate(val, "Etag", &g.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &g.ID) + delete(rawMsg, key) + case "_rid": + err = unpopulate(val, "Rid", &g.Rid) + delete(rawMsg, key) + case "_ts": + err = unpopulate(val, "Ts", &g.Ts) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Metric. -func (m Metric) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GremlinDatabaseGetResults. +func (g GremlinDatabaseGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "endTime", m.EndTime) - populate(objectMap, "metricValues", m.MetricValues) - populate(objectMap, "name", m.Name) - populateTimeRFC3339(objectMap, "startTime", m.StartTime) - populate(objectMap, "timeGrain", m.TimeGrain) - populate(objectMap, "unit", m.Unit) + populate(objectMap, "id", g.ID) + populate(objectMap, "location", g.Location) + populate(objectMap, "name", g.Name) + populate(objectMap, "properties", g.Properties) + populate(objectMap, "tags", g.Tags) + populate(objectMap, "type", g.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Metric. -func (m *Metric) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GremlinDatabaseGetResults. +func (g *GremlinDatabaseGetResults) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &m.EndTime) + case "id": + err = unpopulate(val, "ID", &g.ID) delete(rawMsg, key) - case "metricValues": - err = unpopulate(val, "MetricValues", &m.MetricValues) + case "location": + err = unpopulate(val, "Location", &g.Location) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &m.Name) + err = unpopulate(val, "Name", &g.Name) delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &m.StartTime) + case "properties": + err = unpopulate(val, "Properties", &g.Properties) delete(rawMsg, key) - case "timeGrain": - err = unpopulate(val, "TimeGrain", &m.TimeGrain) + case "tags": + err = unpopulate(val, "Tags", &g.Tags) delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &m.Unit) + case "type": + err = unpopulate(val, "Type", &g.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MetricAvailability. -func (m MetricAvailability) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GremlinDatabaseListResult. +func (g GremlinDatabaseListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "retention", m.Retention) - populate(objectMap, "timeGrain", m.TimeGrain) + populate(objectMap, "value", g.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MetricAvailability. -func (m *MetricAvailability) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GremlinDatabaseListResult. +func (g *GremlinDatabaseListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "retention": - err = unpopulate(val, "Retention", &m.Retention) + case "value": + err = unpopulate(val, "Value", &g.Value) delete(rawMsg, key) - case "timeGrain": - err = unpopulate(val, "TimeGrain", &m.TimeGrain) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GremlinDatabaseResource. +func (g GremlinDatabaseResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", g.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GremlinDatabaseResource. +func (g *GremlinDatabaseResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &g.ID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MetricDefinition. -func (m MetricDefinition) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GremlinGraphCreateUpdateParameters. +func (g GremlinGraphCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "metricAvailabilities", m.MetricAvailabilities) - populate(objectMap, "name", m.Name) - populate(objectMap, "primaryAggregationType", m.PrimaryAggregationType) - populate(objectMap, "resourceUri", m.ResourceURI) - populate(objectMap, "unit", m.Unit) + populate(objectMap, "id", g.ID) + populate(objectMap, "location", g.Location) + populate(objectMap, "name", g.Name) + populate(objectMap, "properties", g.Properties) + populate(objectMap, "tags", g.Tags) + populate(objectMap, "type", g.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MetricDefinition. -func (m *MetricDefinition) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GremlinGraphCreateUpdateParameters. +func (g *GremlinGraphCreateUpdateParameters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "metricAvailabilities": - err = unpopulate(val, "MetricAvailabilities", &m.MetricAvailabilities) + case "id": + err = unpopulate(val, "ID", &g.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &g.Location) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &m.Name) + err = unpopulate(val, "Name", &g.Name) delete(rawMsg, key) - case "primaryAggregationType": - err = unpopulate(val, "PrimaryAggregationType", &m.PrimaryAggregationType) + case "properties": + err = unpopulate(val, "Properties", &g.Properties) delete(rawMsg, key) - case "resourceUri": - err = unpopulate(val, "ResourceURI", &m.ResourceURI) + case "tags": + err = unpopulate(val, "Tags", &g.Tags) delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &m.Unit) + case "type": + err = unpopulate(val, "Type", &g.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MetricDefinitionsListResult. -func (m MetricDefinitionsListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GremlinGraphCreateUpdateProperties. +func (g GremlinGraphCreateUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "value", m.Value) + populate(objectMap, "options", g.Options) + populate(objectMap, "resource", g.Resource) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MetricDefinitionsListResult. -func (m *MetricDefinitionsListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GremlinGraphCreateUpdateProperties. +func (g *GremlinGraphCreateUpdateProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &m.Value) + case "options": + err = unpopulate(val, "Options", &g.Options) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &g.Resource) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MetricListResult. -func (m MetricListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GremlinGraphGetProperties. +func (g GremlinGraphGetProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "value", m.Value) + populate(objectMap, "options", g.Options) + populate(objectMap, "resource", g.Resource) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MetricListResult. -func (m *MetricListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GremlinGraphGetProperties. +func (g *GremlinGraphGetProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &m.Value) + case "options": + err = unpopulate(val, "Options", &g.Options) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &g.Resource) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MetricName. -func (m MetricName) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GremlinGraphGetPropertiesOptions. +func (g GremlinGraphGetPropertiesOptions) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "localizedValue", m.LocalizedValue) - populate(objectMap, "value", m.Value) + populate(objectMap, "autoscaleSettings", g.AutoscaleSettings) + populate(objectMap, "throughput", g.Throughput) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MetricName. -func (m *MetricName) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GremlinGraphGetPropertiesOptions. +func (g *GremlinGraphGetPropertiesOptions) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "localizedValue": - err = unpopulate(val, "LocalizedValue", &m.LocalizedValue) + case "autoscaleSettings": + err = unpopulate(val, "AutoscaleSettings", &g.AutoscaleSettings) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &m.Value) + case "throughput": + err = unpopulate(val, "Throughput", &g.Throughput) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MetricValue. -func (m MetricValue) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GremlinGraphGetPropertiesResource. +func (g GremlinGraphGetPropertiesResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "average", m.Average) - populate(objectMap, "_count", m.Count) - populate(objectMap, "maximum", m.Maximum) - populate(objectMap, "minimum", m.Minimum) - populateTimeRFC3339(objectMap, "timestamp", m.Timestamp) - populate(objectMap, "total", m.Total) + populate(objectMap, "analyticalStorageTtl", g.AnalyticalStorageTTL) + populate(objectMap, "conflictResolutionPolicy", g.ConflictResolutionPolicy) + populate(objectMap, "defaultTtl", g.DefaultTTL) + populate(objectMap, "_etag", g.Etag) + populate(objectMap, "id", g.ID) + populate(objectMap, "indexingPolicy", g.IndexingPolicy) + populate(objectMap, "partitionKey", g.PartitionKey) + populate(objectMap, "_rid", g.Rid) + populate(objectMap, "_ts", g.Ts) + populate(objectMap, "uniqueKeyPolicy", g.UniqueKeyPolicy) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MetricValue. -func (m *MetricValue) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GremlinGraphGetPropertiesResource. +func (g *GremlinGraphGetPropertiesResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "average": - err = unpopulate(val, "Average", &m.Average) + case "analyticalStorageTtl": + err = unpopulate(val, "AnalyticalStorageTTL", &g.AnalyticalStorageTTL) delete(rawMsg, key) - case "_count": - err = unpopulate(val, "Count", &m.Count) + case "conflictResolutionPolicy": + err = unpopulate(val, "ConflictResolutionPolicy", &g.ConflictResolutionPolicy) delete(rawMsg, key) - case "maximum": - err = unpopulate(val, "Maximum", &m.Maximum) + case "defaultTtl": + err = unpopulate(val, "DefaultTTL", &g.DefaultTTL) delete(rawMsg, key) - case "minimum": - err = unpopulate(val, "Minimum", &m.Minimum) + case "_etag": + err = unpopulate(val, "Etag", &g.Etag) delete(rawMsg, key) - case "timestamp": - err = unpopulateTimeRFC3339(val, "Timestamp", &m.Timestamp) + case "id": + err = unpopulate(val, "ID", &g.ID) delete(rawMsg, key) - case "total": - err = unpopulate(val, "Total", &m.Total) + case "indexingPolicy": + err = unpopulate(val, "IndexingPolicy", &g.IndexingPolicy) + delete(rawMsg, key) + case "partitionKey": + err = unpopulate(val, "PartitionKey", &g.PartitionKey) + delete(rawMsg, key) + case "_rid": + err = unpopulate(val, "Rid", &g.Rid) + delete(rawMsg, key) + case "_ts": + err = unpopulate(val, "Ts", &g.Ts) + delete(rawMsg, key) + case "uniqueKeyPolicy": + err = unpopulate(val, "UniqueKeyPolicy", &g.UniqueKeyPolicy) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoDBCollectionCreateUpdateParameters. -func (m MongoDBCollectionCreateUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GremlinGraphGetResults. +func (g GremlinGraphGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "id", m.ID) - populate(objectMap, "identity", m.Identity) - populate(objectMap, "location", m.Location) - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "tags", m.Tags) - populate(objectMap, "type", m.Type) + populate(objectMap, "id", g.ID) + populate(objectMap, "location", g.Location) + populate(objectMap, "name", g.Name) + populate(objectMap, "properties", g.Properties) + populate(objectMap, "tags", g.Tags) + populate(objectMap, "type", g.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBCollectionCreateUpdateParameters. -func (m *MongoDBCollectionCreateUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GremlinGraphGetResults. +func (g *GremlinGraphGetResults) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { case "id": - err = unpopulate(val, "ID", &m.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &m.Identity) + err = unpopulate(val, "ID", &g.ID) delete(rawMsg, key) case "location": - err = unpopulate(val, "Location", &m.Location) + err = unpopulate(val, "Location", &g.Location) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &m.Name) + err = unpopulate(val, "Name", &g.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &m.Properties) + err = unpopulate(val, "Properties", &g.Properties) delete(rawMsg, key) case "tags": - err = unpopulate(val, "Tags", &m.Tags) + err = unpopulate(val, "Tags", &g.Tags) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &m.Type) + err = unpopulate(val, "Type", &g.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoDBCollectionCreateUpdateProperties. -func (m MongoDBCollectionCreateUpdateProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GremlinGraphListResult. +func (g GremlinGraphListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "options", m.Options) - populate(objectMap, "resource", m.Resource) + populate(objectMap, "value", g.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBCollectionCreateUpdateProperties. -func (m *MongoDBCollectionCreateUpdateProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GremlinGraphListResult. +func (g *GremlinGraphListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "options": - err = unpopulate(val, "Options", &m.Options) - delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &m.Resource) + case "value": + err = unpopulate(val, "Value", &g.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoDBCollectionGetProperties. -func (m MongoDBCollectionGetProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GremlinGraphResource. +func (g GremlinGraphResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "options", m.Options) - populate(objectMap, "resource", m.Resource) + populate(objectMap, "analyticalStorageTtl", g.AnalyticalStorageTTL) + populate(objectMap, "conflictResolutionPolicy", g.ConflictResolutionPolicy) + populate(objectMap, "defaultTtl", g.DefaultTTL) + populate(objectMap, "id", g.ID) + populate(objectMap, "indexingPolicy", g.IndexingPolicy) + populate(objectMap, "partitionKey", g.PartitionKey) + populate(objectMap, "uniqueKeyPolicy", g.UniqueKeyPolicy) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBCollectionGetProperties. -func (m *MongoDBCollectionGetProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GremlinGraphResource. +func (g *GremlinGraphResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "options": - err = unpopulate(val, "Options", &m.Options) + case "analyticalStorageTtl": + err = unpopulate(val, "AnalyticalStorageTTL", &g.AnalyticalStorageTTL) delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &m.Resource) + case "conflictResolutionPolicy": + err = unpopulate(val, "ConflictResolutionPolicy", &g.ConflictResolutionPolicy) + delete(rawMsg, key) + case "defaultTtl": + err = unpopulate(val, "DefaultTTL", &g.DefaultTTL) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &g.ID) + delete(rawMsg, key) + case "indexingPolicy": + err = unpopulate(val, "IndexingPolicy", &g.IndexingPolicy) + delete(rawMsg, key) + case "partitionKey": + err = unpopulate(val, "PartitionKey", &g.PartitionKey) + delete(rawMsg, key) + case "uniqueKeyPolicy": + err = unpopulate(val, "UniqueKeyPolicy", &g.UniqueKeyPolicy) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoDBCollectionGetPropertiesOptions. -func (m MongoDBCollectionGetPropertiesOptions) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IPAddressOrRange. +func (i IPAddressOrRange) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "autoscaleSettings", m.AutoscaleSettings) - populate(objectMap, "throughput", m.Throughput) + populate(objectMap, "ipAddressOrRange", i.IPAddressOrRange) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBCollectionGetPropertiesOptions. -func (m *MongoDBCollectionGetPropertiesOptions) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IPAddressOrRange. +func (i *IPAddressOrRange) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "autoscaleSettings": - err = unpopulate(val, "AutoscaleSettings", &m.AutoscaleSettings) - delete(rawMsg, key) - case "throughput": - err = unpopulate(val, "Throughput", &m.Throughput) + case "ipAddressOrRange": + err = unpopulate(val, "IPAddressOrRange", &i.IPAddressOrRange) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoDBCollectionGetPropertiesResource. -func (m MongoDBCollectionGetPropertiesResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IncludedPath. +func (i IncludedPath) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "analyticalStorageTtl", m.AnalyticalStorageTTL) - populate(objectMap, "_etag", m.Etag) - populate(objectMap, "id", m.ID) - populate(objectMap, "indexes", m.Indexes) - populate(objectMap, "_rid", m.Rid) - populate(objectMap, "shardKey", m.ShardKey) - populate(objectMap, "_ts", m.Ts) + populate(objectMap, "indexes", i.Indexes) + populate(objectMap, "path", i.Path) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBCollectionGetPropertiesResource. -func (m *MongoDBCollectionGetPropertiesResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IncludedPath. +func (i *IncludedPath) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "analyticalStorageTtl": - err = unpopulate(val, "AnalyticalStorageTTL", &m.AnalyticalStorageTTL) - delete(rawMsg, key) - case "_etag": - err = unpopulate(val, "Etag", &m.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &m.ID) - delete(rawMsg, key) case "indexes": - err = unpopulate(val, "Indexes", &m.Indexes) - delete(rawMsg, key) - case "_rid": - err = unpopulate(val, "Rid", &m.Rid) - delete(rawMsg, key) - case "shardKey": - err = unpopulate(val, "ShardKey", &m.ShardKey) + err = unpopulate(val, "Indexes", &i.Indexes) delete(rawMsg, key) - case "_ts": - err = unpopulate(val, "Ts", &m.Ts) + case "path": + err = unpopulate(val, "Path", &i.Path) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoDBCollectionGetResults. -func (m MongoDBCollectionGetResults) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Indexes. +func (i Indexes) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "id", m.ID) - populate(objectMap, "identity", m.Identity) - populate(objectMap, "location", m.Location) - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "tags", m.Tags) - populate(objectMap, "type", m.Type) + populate(objectMap, "dataType", i.DataType) + populate(objectMap, "kind", i.Kind) + populate(objectMap, "precision", i.Precision) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBCollectionGetResults. -func (m *MongoDBCollectionGetResults) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Indexes. +func (i *Indexes) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &m.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &m.Identity) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &m.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &m.Properties) + case "dataType": + err = unpopulate(val, "DataType", &i.DataType) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &m.Tags) + case "kind": + err = unpopulate(val, "Kind", &i.Kind) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + case "precision": + err = unpopulate(val, "Precision", &i.Precision) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoDBCollectionListResult. -func (m MongoDBCollectionListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IndexingPolicy. +func (i IndexingPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "value", m.Value) + populate(objectMap, "automatic", i.Automatic) + populate(objectMap, "compositeIndexes", i.CompositeIndexes) + populate(objectMap, "excludedPaths", i.ExcludedPaths) + populate(objectMap, "includedPaths", i.IncludedPaths) + populate(objectMap, "indexingMode", i.IndexingMode) + populate(objectMap, "spatialIndexes", i.SpatialIndexes) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBCollectionListResult. -func (m *MongoDBCollectionListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IndexingPolicy. +func (i *IndexingPolicy) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &m.Value) + case "automatic": + err = unpopulate(val, "Automatic", &i.Automatic) + delete(rawMsg, key) + case "compositeIndexes": + err = unpopulate(val, "CompositeIndexes", &i.CompositeIndexes) + delete(rawMsg, key) + case "excludedPaths": + err = unpopulate(val, "ExcludedPaths", &i.ExcludedPaths) + delete(rawMsg, key) + case "includedPaths": + err = unpopulate(val, "IncludedPaths", &i.IncludedPaths) + delete(rawMsg, key) + case "indexingMode": + err = unpopulate(val, "IndexingMode", &i.IndexingMode) + delete(rawMsg, key) + case "spatialIndexes": + err = unpopulate(val, "SpatialIndexes", &i.SpatialIndexes) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoDBCollectionResource. -func (m MongoDBCollectionResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ListClusters. +func (l ListClusters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "analyticalStorageTtl", m.AnalyticalStorageTTL) - populate(objectMap, "id", m.ID) - populate(objectMap, "indexes", m.Indexes) - populate(objectMap, "shardKey", m.ShardKey) + populate(objectMap, "value", l.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBCollectionResource. -func (m *MongoDBCollectionResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ListClusters. +func (l *ListClusters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "analyticalStorageTtl": - err = unpopulate(val, "AnalyticalStorageTTL", &m.AnalyticalStorageTTL) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &m.ID) - delete(rawMsg, key) - case "indexes": - err = unpopulate(val, "Indexes", &m.Indexes) - delete(rawMsg, key) - case "shardKey": - err = unpopulate(val, "ShardKey", &m.ShardKey) + case "value": + err = unpopulate(val, "Value", &l.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoDBDatabaseCreateUpdateParameters. -func (m MongoDBDatabaseCreateUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ListDataCenters. +func (l ListDataCenters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "id", m.ID) - populate(objectMap, "identity", m.Identity) - populate(objectMap, "location", m.Location) - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "tags", m.Tags) - populate(objectMap, "type", m.Type) + populate(objectMap, "value", l.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBDatabaseCreateUpdateParameters. -func (m *MongoDBDatabaseCreateUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ListDataCenters. +func (l *ListDataCenters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &m.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &m.Identity) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &m.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &m.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &m.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + case "value": + err = unpopulate(val, "Value", &l.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoDBDatabaseCreateUpdateProperties. -func (m MongoDBDatabaseCreateUpdateProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Location. +func (l Location) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "options", m.Options) - populate(objectMap, "resource", m.Resource) + populate(objectMap, "documentEndpoint", l.DocumentEndpoint) + populate(objectMap, "failoverPriority", l.FailoverPriority) + populate(objectMap, "id", l.ID) + populate(objectMap, "isZoneRedundant", l.IsZoneRedundant) + populate(objectMap, "locationName", l.LocationName) + populate(objectMap, "provisioningState", l.ProvisioningState) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBDatabaseCreateUpdateProperties. -func (m *MongoDBDatabaseCreateUpdateProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Location. +func (l *Location) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "options": - err = unpopulate(val, "Options", &m.Options) + case "documentEndpoint": + err = unpopulate(val, "DocumentEndpoint", &l.DocumentEndpoint) delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &m.Resource) + case "failoverPriority": + err = unpopulate(val, "FailoverPriority", &l.FailoverPriority) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &l.ID) + delete(rawMsg, key) + case "isZoneRedundant": + err = unpopulate(val, "IsZoneRedundant", &l.IsZoneRedundant) + delete(rawMsg, key) + case "locationName": + err = unpopulate(val, "LocationName", &l.LocationName) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &l.ProvisioningState) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoDBDatabaseGetProperties. -func (m MongoDBDatabaseGetProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LocationGetResult. +func (l LocationGetResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "options", m.Options) - populate(objectMap, "resource", m.Resource) + populate(objectMap, "id", l.ID) + populate(objectMap, "name", l.Name) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "type", l.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBDatabaseGetProperties. -func (m *MongoDBDatabaseGetProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LocationGetResult. +func (l *LocationGetResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "options": - err = unpopulate(val, "Options", &m.Options) + case "id": + err = unpopulate(val, "ID", &l.ID) delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &m.Resource) + case "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &l.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &l.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoDBDatabaseGetPropertiesOptions. -func (m MongoDBDatabaseGetPropertiesOptions) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LocationListResult. +func (l LocationListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "autoscaleSettings", m.AutoscaleSettings) - populate(objectMap, "throughput", m.Throughput) + populate(objectMap, "value", l.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBDatabaseGetPropertiesOptions. -func (m *MongoDBDatabaseGetPropertiesOptions) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LocationListResult. +func (l *LocationListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "autoscaleSettings": - err = unpopulate(val, "AutoscaleSettings", &m.AutoscaleSettings) - delete(rawMsg, key) - case "throughput": - err = unpopulate(val, "Throughput", &m.Throughput) + case "value": + err = unpopulate(val, "Value", &l.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoDBDatabaseGetPropertiesResource. -func (m MongoDBDatabaseGetPropertiesResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LocationProperties. +func (l LocationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "_etag", m.Etag) - populate(objectMap, "id", m.ID) - populate(objectMap, "_rid", m.Rid) - populate(objectMap, "_ts", m.Ts) + populate(objectMap, "backupStorageRedundancies", l.BackupStorageRedundancies) + populate(objectMap, "isResidencyRestricted", l.IsResidencyRestricted) + populate(objectMap, "supportsAvailabilityZone", l.SupportsAvailabilityZone) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBDatabaseGetPropertiesResource. -func (m *MongoDBDatabaseGetPropertiesResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LocationProperties. +func (l *LocationProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "_etag": - err = unpopulate(val, "Etag", &m.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &m.ID) + case "backupStorageRedundancies": + err = unpopulate(val, "BackupStorageRedundancies", &l.BackupStorageRedundancies) delete(rawMsg, key) - case "_rid": - err = unpopulate(val, "Rid", &m.Rid) + case "isResidencyRestricted": + err = unpopulate(val, "IsResidencyRestricted", &l.IsResidencyRestricted) delete(rawMsg, key) - case "_ts": - err = unpopulate(val, "Ts", &m.Ts) + case "supportsAvailabilityZone": + err = unpopulate(val, "SupportsAvailabilityZone", &l.SupportsAvailabilityZone) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoDBDatabaseGetResults. -func (m MongoDBDatabaseGetResults) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedCassandraARMResourceProperties. +func (m ManagedCassandraARMResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", m.ID) populate(objectMap, "identity", m.Identity) populate(objectMap, "location", m.Location) populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) populate(objectMap, "tags", m.Tags) populate(objectMap, "type", m.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBDatabaseGetResults. -func (m *MongoDBDatabaseGetResults) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedCassandraARMResourceProperties. +func (m *ManagedCassandraARMResourceProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -6790,9 +4261,6 @@ func (m *MongoDBDatabaseGetResults) UnmarshalJSON(data []byte) error { case "name": err = unpopulate(val, "Name", &m.Name) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &m.Properties) - delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &m.Tags) delete(rawMsg, key) @@ -6807,15 +4275,17 @@ func (m *MongoDBDatabaseGetResults) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoDBDatabaseListResult. -func (m MongoDBDatabaseListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedCassandraManagedServiceIdentity. +func (m ManagedCassandraManagedServiceIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "value", m.Value) + populate(objectMap, "principalId", m.PrincipalID) + populate(objectMap, "tenantId", m.TenantID) + populate(objectMap, "type", m.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBDatabaseListResult. -func (m *MongoDBDatabaseListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedCassandraManagedServiceIdentity. +func (m *ManagedCassandraManagedServiceIdentity) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -6823,8 +4293,14 @@ func (m *MongoDBDatabaseListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &m.Value) + case "principalId": + err = unpopulate(val, "PrincipalID", &m.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &m.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) delete(rawMsg, key) } if err != nil { @@ -6834,15 +4310,17 @@ func (m *MongoDBDatabaseListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoDBDatabaseResource. -func (m MongoDBDatabaseResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedCassandraReaperStatus. +func (m ManagedCassandraReaperStatus) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "id", m.ID) + populate(objectMap, "healthy", m.Healthy) + populate(objectMap, "repairRunIds", m.RepairRunIDs) + populate(objectMap, "repairSchedules", m.RepairSchedules) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBDatabaseResource. -func (m *MongoDBDatabaseResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedCassandraReaperStatus. +func (m *ManagedCassandraReaperStatus) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -6850,8 +4328,14 @@ func (m *MongoDBDatabaseResource) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &m.ID) + case "healthy": + err = unpopulate(val, "Healthy", &m.Healthy) + delete(rawMsg, key) + case "repairRunIds": + err = unpopulate(val, "RepairRunIDs", &m.RepairRunIDs) + delete(rawMsg, key) + case "repairSchedules": + err = unpopulate(val, "RepairSchedules", &m.RepairSchedules) delete(rawMsg, key) } if err != nil { @@ -6861,16 +4345,18 @@ func (m *MongoDBDatabaseResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoIndex. -func (m MongoIndex) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedServiceIdentity. +func (m ManagedServiceIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "key", m.Key) - populate(objectMap, "options", m.Options) + populate(objectMap, "principalId", m.PrincipalID) + populate(objectMap, "tenantId", m.TenantID) + populate(objectMap, "type", m.Type) + populate(objectMap, "userAssignedIdentities", m.UserAssignedIdentities) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoIndex. -func (m *MongoIndex) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServiceIdentity. +func (m *ManagedServiceIdentity) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -6878,11 +4364,17 @@ func (m *MongoIndex) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "key": - err = unpopulate(val, "Key", &m.Key) + case "principalId": + err = unpopulate(val, "PrincipalID", &m.PrincipalID) delete(rawMsg, key) - case "options": - err = unpopulate(val, "Options", &m.Options) + case "tenantId": + err = unpopulate(val, "TenantID", &m.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + case "userAssignedIdentities": + err = unpopulate(val, "UserAssignedIdentities", &m.UserAssignedIdentities) delete(rawMsg, key) } if err != nil { @@ -6892,15 +4384,17 @@ func (m *MongoIndex) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoIndexKeys. -func (m MongoIndexKeys) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MaterializedViewsBuilderRegionalServiceResource. +func (m MaterializedViewsBuilderRegionalServiceResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "keys", m.Keys) + populate(objectMap, "location", m.Location) + populate(objectMap, "name", m.Name) + populate(objectMap, "status", m.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoIndexKeys. -func (m *MongoIndexKeys) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MaterializedViewsBuilderRegionalServiceResource. +func (m *MaterializedViewsBuilderRegionalServiceResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -6908,8 +4402,14 @@ func (m *MongoIndexKeys) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "keys": - err = unpopulate(val, "Keys", &m.Keys) + case "location": + err = unpopulate(val, "Location", &m.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) delete(rawMsg, key) } if err != nil { @@ -6919,16 +4419,15 @@ func (m *MongoIndexKeys) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoIndexOptions. -func (m MongoIndexOptions) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MaterializedViewsBuilderServiceResource. +func (m MaterializedViewsBuilderServiceResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "expireAfterSeconds", m.ExpireAfterSeconds) - populate(objectMap, "unique", m.Unique) + populate(objectMap, "properties", m.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoIndexOptions. -func (m *MongoIndexOptions) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MaterializedViewsBuilderServiceResource. +func (m *MaterializedViewsBuilderServiceResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -6936,11 +4435,8 @@ func (m *MongoIndexOptions) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "expireAfterSeconds": - err = unpopulate(val, "ExpireAfterSeconds", &m.ExpireAfterSeconds) - delete(rawMsg, key) - case "unique": - err = unpopulate(val, "Unique", &m.Unique) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) delete(rawMsg, key) } if err != nil { @@ -6950,15 +4446,25 @@ func (m *MongoIndexOptions) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoRoleDefinitionCreateUpdateParameters. -func (m MongoRoleDefinitionCreateUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MaterializedViewsBuilderServiceResourceProperties. +func (m MaterializedViewsBuilderServiceResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "properties", m.Properties) + populateTimeRFC3339(objectMap, "creationTime", m.CreationTime) + populate(objectMap, "instanceCount", m.InstanceCount) + populate(objectMap, "instanceSize", m.InstanceSize) + populate(objectMap, "locations", m.Locations) + objectMap["serviceType"] = ServiceTypeMaterializedViewsBuilder + populate(objectMap, "status", m.Status) + if m.AdditionalProperties != nil { + for key, val := range m.AdditionalProperties { + objectMap[key] = val + } + } return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoRoleDefinitionCreateUpdateParameters. -func (m *MongoRoleDefinitionCreateUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MaterializedViewsBuilderServiceResourceProperties. +func (m *MaterializedViewsBuilderServiceResourceProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -6966,8 +4472,33 @@ func (m *MongoRoleDefinitionCreateUpdateParameters) UnmarshalJSON(data []byte) e for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &m.Properties) + case "creationTime": + err = unpopulateTimeRFC3339(val, "CreationTime", &m.CreationTime) + delete(rawMsg, key) + case "instanceCount": + err = unpopulate(val, "InstanceCount", &m.InstanceCount) + delete(rawMsg, key) + case "instanceSize": + err = unpopulate(val, "InstanceSize", &m.InstanceSize) + delete(rawMsg, key) + case "locations": + err = unpopulate(val, "Locations", &m.Locations) + delete(rawMsg, key) + case "serviceType": + err = unpopulate(val, "ServiceType", &m.ServiceType) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) + delete(rawMsg, key) + default: + if m.AdditionalProperties == nil { + m.AdditionalProperties = map[string]interface{}{} + } + if val != nil { + var aux interface{} + err = json.Unmarshal(val, &aux) + m.AdditionalProperties[key] = aux + } delete(rawMsg, key) } if err != nil { @@ -6977,18 +4508,20 @@ func (m *MongoRoleDefinitionCreateUpdateParameters) UnmarshalJSON(data []byte) e return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoRoleDefinitionGetResults. -func (m MongoRoleDefinitionGetResults) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Metric. +func (m Metric) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "id", m.ID) + populateTimeRFC3339(objectMap, "endTime", m.EndTime) + populate(objectMap, "metricValues", m.MetricValues) populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "type", m.Type) + populateTimeRFC3339(objectMap, "startTime", m.StartTime) + populate(objectMap, "timeGrain", m.TimeGrain) + populate(objectMap, "unit", m.Unit) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoRoleDefinitionGetResults. -func (m *MongoRoleDefinitionGetResults) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Metric. +func (m *Metric) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -6996,17 +4529,23 @@ func (m *MongoRoleDefinitionGetResults) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &m.ID) + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &m.EndTime) + delete(rawMsg, key) + case "metricValues": + err = unpopulate(val, "MetricValues", &m.MetricValues) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &m.Name) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &m.Properties) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &m.StartTime) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + case "timeGrain": + err = unpopulate(val, "TimeGrain", &m.TimeGrain) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &m.Unit) delete(rawMsg, key) } if err != nil { @@ -7016,15 +4555,16 @@ func (m *MongoRoleDefinitionGetResults) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoRoleDefinitionListResult. -func (m MongoRoleDefinitionListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MetricAvailability. +func (m MetricAvailability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "value", m.Value) + populate(objectMap, "retention", m.Retention) + populate(objectMap, "timeGrain", m.TimeGrain) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoRoleDefinitionListResult. -func (m *MongoRoleDefinitionListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MetricAvailability. +func (m *MetricAvailability) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -7032,8 +4572,11 @@ func (m *MongoRoleDefinitionListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &m.Value) + case "retention": + err = unpopulate(val, "Retention", &m.Retention) + delete(rawMsg, key) + case "timeGrain": + err = unpopulate(val, "TimeGrain", &m.TimeGrain) delete(rawMsg, key) } if err != nil { @@ -7043,19 +4586,19 @@ func (m *MongoRoleDefinitionListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoRoleDefinitionResource. -func (m MongoRoleDefinitionResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MetricDefinition. +func (m MetricDefinition) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "databaseName", m.DatabaseName) - populate(objectMap, "privileges", m.Privileges) - populate(objectMap, "roleName", m.RoleName) - populate(objectMap, "roles", m.Roles) - populate(objectMap, "type", m.Type) + populate(objectMap, "metricAvailabilities", m.MetricAvailabilities) + populate(objectMap, "name", m.Name) + populate(objectMap, "primaryAggregationType", m.PrimaryAggregationType) + populate(objectMap, "resourceUri", m.ResourceURI) + populate(objectMap, "unit", m.Unit) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoRoleDefinitionResource. -func (m *MongoRoleDefinitionResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MetricDefinition. +func (m *MetricDefinition) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -7063,20 +4606,20 @@ func (m *MongoRoleDefinitionResource) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "databaseName": - err = unpopulate(val, "DatabaseName", &m.DatabaseName) + case "metricAvailabilities": + err = unpopulate(val, "MetricAvailabilities", &m.MetricAvailabilities) delete(rawMsg, key) - case "privileges": - err = unpopulate(val, "Privileges", &m.Privileges) + case "name": + err = unpopulate(val, "Name", &m.Name) delete(rawMsg, key) - case "roleName": - err = unpopulate(val, "RoleName", &m.RoleName) + case "primaryAggregationType": + err = unpopulate(val, "PrimaryAggregationType", &m.PrimaryAggregationType) delete(rawMsg, key) - case "roles": - err = unpopulate(val, "Roles", &m.Roles) + case "resourceUri": + err = unpopulate(val, "ResourceURI", &m.ResourceURI) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + case "unit": + err = unpopulate(val, "Unit", &m.Unit) delete(rawMsg, key) } if err != nil { @@ -7086,15 +4629,15 @@ func (m *MongoRoleDefinitionResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoUserDefinitionCreateUpdateParameters. -func (m MongoUserDefinitionCreateUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MetricDefinitionsListResult. +func (m MetricDefinitionsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "properties", m.Properties) + populate(objectMap, "value", m.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoUserDefinitionCreateUpdateParameters. -func (m *MongoUserDefinitionCreateUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MetricDefinitionsListResult. +func (m *MetricDefinitionsListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -7102,8 +4645,8 @@ func (m *MongoUserDefinitionCreateUpdateParameters) UnmarshalJSON(data []byte) e for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &m.Properties) + case "value": + err = unpopulate(val, "Value", &m.Value) delete(rawMsg, key) } if err != nil { @@ -7113,18 +4656,15 @@ func (m *MongoUserDefinitionCreateUpdateParameters) UnmarshalJSON(data []byte) e return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoUserDefinitionGetResults. -func (m MongoUserDefinitionGetResults) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MetricListResult. +func (m MetricListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "id", m.ID) - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "type", m.Type) + populate(objectMap, "value", m.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoUserDefinitionGetResults. -func (m *MongoUserDefinitionGetResults) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MetricListResult. +func (m *MetricListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -7132,17 +4672,8 @@ func (m *MongoUserDefinitionGetResults) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &m.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &m.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + case "value": + err = unpopulate(val, "Value", &m.Value) delete(rawMsg, key) } if err != nil { @@ -7152,15 +4683,16 @@ func (m *MongoUserDefinitionGetResults) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoUserDefinitionListResult. -func (m MongoUserDefinitionListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MetricName. +func (m MetricName) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + populate(objectMap, "localizedValue", m.LocalizedValue) populate(objectMap, "value", m.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoUserDefinitionListResult. -func (m *MongoUserDefinitionListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MetricName. +func (m *MetricName) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -7168,6 +4700,9 @@ func (m *MongoUserDefinitionListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "localizedValue": + err = unpopulate(val, "LocalizedValue", &m.LocalizedValue) + delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &m.Value) delete(rawMsg, key) @@ -7179,20 +4714,20 @@ func (m *MongoUserDefinitionListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MongoUserDefinitionResource. -func (m MongoUserDefinitionResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MetricValue. +func (m MetricValue) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "customData", m.CustomData) - populate(objectMap, "databaseName", m.DatabaseName) - populate(objectMap, "mechanisms", m.Mechanisms) - populate(objectMap, "password", m.Password) - populate(objectMap, "roles", m.Roles) - populate(objectMap, "userName", m.UserName) + populate(objectMap, "average", m.Average) + populate(objectMap, "_count", m.Count) + populate(objectMap, "maximum", m.Maximum) + populate(objectMap, "minimum", m.Minimum) + populateTimeRFC3339(objectMap, "timestamp", m.Timestamp) + populate(objectMap, "total", m.Total) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoUserDefinitionResource. -func (m *MongoUserDefinitionResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MetricValue. +func (m *MetricValue) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -7200,23 +4735,23 @@ func (m *MongoUserDefinitionResource) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "customData": - err = unpopulate(val, "CustomData", &m.CustomData) + case "average": + err = unpopulate(val, "Average", &m.Average) delete(rawMsg, key) - case "databaseName": - err = unpopulate(val, "DatabaseName", &m.DatabaseName) + case "_count": + err = unpopulate(val, "Count", &m.Count) delete(rawMsg, key) - case "mechanisms": - err = unpopulate(val, "Mechanisms", &m.Mechanisms) + case "maximum": + err = unpopulate(val, "Maximum", &m.Maximum) delete(rawMsg, key) - case "password": - err = unpopulate(val, "Password", &m.Password) + case "minimum": + err = unpopulate(val, "Minimum", &m.Minimum) delete(rawMsg, key) - case "roles": - err = unpopulate(val, "Roles", &m.Roles) + case "timestamp": + err = unpopulateTimeRFC3339(val, "Timestamp", &m.Timestamp) delete(rawMsg, key) - case "userName": - err = unpopulate(val, "UserName", &m.UserName) + case "total": + err = unpopulate(val, "Total", &m.Total) delete(rawMsg, key) } if err != nil { @@ -7226,1237 +4761,1266 @@ func (m *MongoUserDefinitionResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NotebookWorkspace. -func (n NotebookWorkspace) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoDBCollectionCreateUpdateParameters. +func (m MongoDBCollectionCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "id", n.ID) - populate(objectMap, "name", n.Name) - populate(objectMap, "properties", n.Properties) - populate(objectMap, "type", n.Type) + populate(objectMap, "id", m.ID) + populate(objectMap, "location", m.Location) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "tags", m.Tags) + populate(objectMap, "type", m.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NotebookWorkspace. -func (n *NotebookWorkspace) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBCollectionCreateUpdateParameters. +func (m *MongoDBCollectionCreateUpdateParameters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { case "id": - err = unpopulate(val, "ID", &n.ID) + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &m.Location) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &n.Name) + err = unpopulate(val, "Name", &m.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &n.Properties) + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &m.Tags) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &n.Type) + err = unpopulate(val, "Type", &m.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NotebookWorkspaceConnectionInfoResult. -func (n NotebookWorkspaceConnectionInfoResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoDBCollectionCreateUpdateProperties. +func (m MongoDBCollectionCreateUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "authToken", n.AuthToken) - populate(objectMap, "notebookServerEndpoint", n.NotebookServerEndpoint) + populate(objectMap, "options", m.Options) + populate(objectMap, "resource", m.Resource) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NotebookWorkspaceConnectionInfoResult. -func (n *NotebookWorkspaceConnectionInfoResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBCollectionCreateUpdateProperties. +func (m *MongoDBCollectionCreateUpdateProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "authToken": - err = unpopulate(val, "AuthToken", &n.AuthToken) + case "options": + err = unpopulate(val, "Options", &m.Options) delete(rawMsg, key) - case "notebookServerEndpoint": - err = unpopulate(val, "NotebookServerEndpoint", &n.NotebookServerEndpoint) + case "resource": + err = unpopulate(val, "Resource", &m.Resource) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NotebookWorkspaceCreateUpdateParameters. -func (n NotebookWorkspaceCreateUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoDBCollectionGetProperties. +func (m MongoDBCollectionGetProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "id", n.ID) - populate(objectMap, "name", n.Name) - populate(objectMap, "type", n.Type) + populate(objectMap, "options", m.Options) + populate(objectMap, "resource", m.Resource) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NotebookWorkspaceCreateUpdateParameters. -func (n *NotebookWorkspaceCreateUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBCollectionGetProperties. +func (m *MongoDBCollectionGetProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &n.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &n.Name) + case "options": + err = unpopulate(val, "Options", &m.Options) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &n.Type) + case "resource": + err = unpopulate(val, "Resource", &m.Resource) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NotebookWorkspaceListResult. -func (n NotebookWorkspaceListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoDBCollectionGetPropertiesOptions. +func (m MongoDBCollectionGetPropertiesOptions) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "value", n.Value) + populate(objectMap, "autoscaleSettings", m.AutoscaleSettings) + populate(objectMap, "throughput", m.Throughput) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NotebookWorkspaceListResult. -func (n *NotebookWorkspaceListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBCollectionGetPropertiesOptions. +func (m *MongoDBCollectionGetPropertiesOptions) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &n.Value) + case "autoscaleSettings": + err = unpopulate(val, "AutoscaleSettings", &m.AutoscaleSettings) + delete(rawMsg, key) + case "throughput": + err = unpopulate(val, "Throughput", &m.Throughput) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NotebookWorkspaceProperties. -func (n NotebookWorkspaceProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoDBCollectionGetPropertiesResource. +func (m MongoDBCollectionGetPropertiesResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "notebookServerEndpoint", n.NotebookServerEndpoint) - populate(objectMap, "status", n.Status) + populate(objectMap, "analyticalStorageTtl", m.AnalyticalStorageTTL) + populate(objectMap, "_etag", m.Etag) + populate(objectMap, "id", m.ID) + populate(objectMap, "indexes", m.Indexes) + populate(objectMap, "_rid", m.Rid) + populate(objectMap, "shardKey", m.ShardKey) + populate(objectMap, "_ts", m.Ts) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NotebookWorkspaceProperties. -func (n *NotebookWorkspaceProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBCollectionGetPropertiesResource. +func (m *MongoDBCollectionGetPropertiesResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "notebookServerEndpoint": - err = unpopulate(val, "NotebookServerEndpoint", &n.NotebookServerEndpoint) + case "analyticalStorageTtl": + err = unpopulate(val, "AnalyticalStorageTTL", &m.AnalyticalStorageTTL) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &n.Status) + case "_etag": + err = unpopulate(val, "Etag", &m.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "indexes": + err = unpopulate(val, "Indexes", &m.Indexes) + delete(rawMsg, key) + case "_rid": + err = unpopulate(val, "Rid", &m.Rid) + delete(rawMsg, key) + case "shardKey": + err = unpopulate(val, "ShardKey", &m.ShardKey) + delete(rawMsg, key) + case "_ts": + err = unpopulate(val, "Ts", &m.Ts) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Operation. -func (o Operation) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoDBCollectionGetResults. +func (m MongoDBCollectionGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "display", o.Display) - populate(objectMap, "name", o.Name) + populate(objectMap, "id", m.ID) + populate(objectMap, "location", m.Location) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "tags", m.Tags) + populate(objectMap, "type", m.Type) return json.Marshal(objectMap) } - -// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. -func (o *Operation) UnmarshalJSON(data []byte) error { + +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBCollectionGetResults. +func (m *MongoDBCollectionGetResults) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "display": - err = unpopulate(val, "Display", &o.Display) + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &m.Location) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &o.Name) + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &m.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. -func (o OperationDisplay) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoDBCollectionListResult. +func (m MongoDBCollectionListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "Description", o.Description) - populate(objectMap, "Operation", o.Operation) - populate(objectMap, "Provider", o.Provider) - populate(objectMap, "Resource", o.Resource) + populate(objectMap, "value", m.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. -func (o *OperationDisplay) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBCollectionListResult. +func (m *MongoDBCollectionListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "Description": - err = unpopulate(val, "Description", &o.Description) - delete(rawMsg, key) - case "Operation": - err = unpopulate(val, "Operation", &o.Operation) - delete(rawMsg, key) - case "Provider": - err = unpopulate(val, "Provider", &o.Provider) - delete(rawMsg, key) - case "Resource": - err = unpopulate(val, "Resource", &o.Resource) + case "value": + err = unpopulate(val, "Value", &m.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationListResult. -func (o OperationListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoDBCollectionResource. +func (m MongoDBCollectionResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", o.NextLink) - populate(objectMap, "value", o.Value) + populate(objectMap, "analyticalStorageTtl", m.AnalyticalStorageTTL) + populate(objectMap, "id", m.ID) + populate(objectMap, "indexes", m.Indexes) + populate(objectMap, "shardKey", m.ShardKey) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. -func (o *OperationListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBCollectionResource. +func (m *MongoDBCollectionResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &o.NextLink) + case "analyticalStorageTtl": + err = unpopulate(val, "AnalyticalStorageTTL", &m.AnalyticalStorageTTL) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &o.Value) + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "indexes": + err = unpopulate(val, "Indexes", &m.Indexes) + delete(rawMsg, key) + case "shardKey": + err = unpopulate(val, "ShardKey", &m.ShardKey) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OptionsResource. -func (o OptionsResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoDBDatabaseCreateUpdateParameters. +func (m MongoDBDatabaseCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "autoscaleSettings", o.AutoscaleSettings) - populate(objectMap, "throughput", o.Throughput) + populate(objectMap, "id", m.ID) + populate(objectMap, "location", m.Location) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "tags", m.Tags) + populate(objectMap, "type", m.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OptionsResource. -func (o *OptionsResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBDatabaseCreateUpdateParameters. +func (m *MongoDBDatabaseCreateUpdateParameters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "autoscaleSettings": - err = unpopulate(val, "AutoscaleSettings", &o.AutoscaleSettings) + case "id": + err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) - case "throughput": - err = unpopulate(val, "Throughput", &o.Throughput) + case "location": + err = unpopulate(val, "Location", &m.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &m.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PartitionMetric. -func (p PartitionMetric) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoDBDatabaseCreateUpdateProperties. +func (m MongoDBDatabaseCreateUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "endTime", p.EndTime) - populate(objectMap, "metricValues", p.MetricValues) - populate(objectMap, "name", p.Name) - populate(objectMap, "partitionId", p.PartitionID) - populate(objectMap, "partitionKeyRangeId", p.PartitionKeyRangeID) - populateTimeRFC3339(objectMap, "startTime", p.StartTime) - populate(objectMap, "timeGrain", p.TimeGrain) - populate(objectMap, "unit", p.Unit) + populate(objectMap, "options", m.Options) + populate(objectMap, "resource", m.Resource) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PartitionMetric. -func (p *PartitionMetric) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBDatabaseCreateUpdateProperties. +func (m *MongoDBDatabaseCreateUpdateProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &p.EndTime) - delete(rawMsg, key) - case "metricValues": - err = unpopulate(val, "MetricValues", &p.MetricValues) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "partitionId": - err = unpopulate(val, "PartitionID", &p.PartitionID) - delete(rawMsg, key) - case "partitionKeyRangeId": - err = unpopulate(val, "PartitionKeyRangeID", &p.PartitionKeyRangeID) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &p.StartTime) - delete(rawMsg, key) - case "timeGrain": - err = unpopulate(val, "TimeGrain", &p.TimeGrain) + case "options": + err = unpopulate(val, "Options", &m.Options) delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &p.Unit) + case "resource": + err = unpopulate(val, "Resource", &m.Resource) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PartitionMetricListResult. -func (p PartitionMetricListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoDBDatabaseGetProperties. +func (m MongoDBDatabaseGetProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "value", p.Value) + populate(objectMap, "options", m.Options) + populate(objectMap, "resource", m.Resource) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PartitionMetricListResult. -func (p *PartitionMetricListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBDatabaseGetProperties. +func (m *MongoDBDatabaseGetProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &p.Value) + case "options": + err = unpopulate(val, "Options", &m.Options) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &m.Resource) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PartitionUsage. -func (p PartitionUsage) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoDBDatabaseGetPropertiesOptions. +func (m MongoDBDatabaseGetPropertiesOptions) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "currentValue", p.CurrentValue) - populate(objectMap, "limit", p.Limit) - populate(objectMap, "name", p.Name) - populate(objectMap, "partitionId", p.PartitionID) - populate(objectMap, "partitionKeyRangeId", p.PartitionKeyRangeID) - populate(objectMap, "quotaPeriod", p.QuotaPeriod) - populate(objectMap, "unit", p.Unit) + populate(objectMap, "autoscaleSettings", m.AutoscaleSettings) + populate(objectMap, "throughput", m.Throughput) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PartitionUsage. -func (p *PartitionUsage) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBDatabaseGetPropertiesOptions. +func (m *MongoDBDatabaseGetPropertiesOptions) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "currentValue": - err = unpopulate(val, "CurrentValue", &p.CurrentValue) - delete(rawMsg, key) - case "limit": - err = unpopulate(val, "Limit", &p.Limit) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "partitionId": - err = unpopulate(val, "PartitionID", &p.PartitionID) - delete(rawMsg, key) - case "partitionKeyRangeId": - err = unpopulate(val, "PartitionKeyRangeID", &p.PartitionKeyRangeID) - delete(rawMsg, key) - case "quotaPeriod": - err = unpopulate(val, "QuotaPeriod", &p.QuotaPeriod) + case "autoscaleSettings": + err = unpopulate(val, "AutoscaleSettings", &m.AutoscaleSettings) delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &p.Unit) + case "throughput": + err = unpopulate(val, "Throughput", &m.Throughput) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PartitionUsagesResult. -func (p PartitionUsagesResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoDBDatabaseGetPropertiesResource. +func (m MongoDBDatabaseGetPropertiesResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "value", p.Value) + populate(objectMap, "_etag", m.Etag) + populate(objectMap, "id", m.ID) + populate(objectMap, "_rid", m.Rid) + populate(objectMap, "_ts", m.Ts) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PartitionUsagesResult. -func (p *PartitionUsagesResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBDatabaseGetPropertiesResource. +func (m *MongoDBDatabaseGetPropertiesResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &p.Value) + case "_etag": + err = unpopulate(val, "Etag", &m.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "_rid": + err = unpopulate(val, "Rid", &m.Rid) + delete(rawMsg, key) + case "_ts": + err = unpopulate(val, "Ts", &m.Ts) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PercentileMetric. -func (p PercentileMetric) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoDBDatabaseGetResults. +func (m MongoDBDatabaseGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "endTime", p.EndTime) - populate(objectMap, "metricValues", p.MetricValues) - populate(objectMap, "name", p.Name) - populateTimeRFC3339(objectMap, "startTime", p.StartTime) - populate(objectMap, "timeGrain", p.TimeGrain) - populate(objectMap, "unit", p.Unit) + populate(objectMap, "id", m.ID) + populate(objectMap, "location", m.Location) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "tags", m.Tags) + populate(objectMap, "type", m.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PercentileMetric. -func (p *PercentileMetric) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBDatabaseGetResults. +func (m *MongoDBDatabaseGetResults) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &p.EndTime) + case "id": + err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) - case "metricValues": - err = unpopulate(val, "MetricValues", &p.MetricValues) + case "location": + err = unpopulate(val, "Location", &m.Location) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &p.Name) + err = unpopulate(val, "Name", &m.Name) delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &p.StartTime) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) delete(rawMsg, key) - case "timeGrain": - err = unpopulate(val, "TimeGrain", &p.TimeGrain) + case "tags": + err = unpopulate(val, "Tags", &m.Tags) delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &p.Unit) + case "type": + err = unpopulate(val, "Type", &m.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PercentileMetricListResult. -func (p PercentileMetricListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoDBDatabaseListResult. +func (m MongoDBDatabaseListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "value", p.Value) + populate(objectMap, "value", m.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PercentileMetricListResult. -func (p *PercentileMetricListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBDatabaseListResult. +func (m *MongoDBDatabaseListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { case "value": - err = unpopulate(val, "Value", &p.Value) + err = unpopulate(val, "Value", &m.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PercentileMetricValue. -func (p PercentileMetricValue) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoDBDatabaseResource. +func (m MongoDBDatabaseResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "average", p.Average) - populate(objectMap, "_count", p.Count) - populate(objectMap, "maximum", p.Maximum) - populate(objectMap, "minimum", p.Minimum) - populate(objectMap, "P10", p.P10) - populate(objectMap, "P25", p.P25) - populate(objectMap, "P50", p.P50) - populate(objectMap, "P75", p.P75) - populate(objectMap, "P90", p.P90) - populate(objectMap, "P95", p.P95) - populate(objectMap, "P99", p.P99) - populateTimeRFC3339(objectMap, "timestamp", p.Timestamp) - populate(objectMap, "total", p.Total) + populate(objectMap, "id", m.ID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PercentileMetricValue. -func (p *PercentileMetricValue) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDBDatabaseResource. +func (m *MongoDBDatabaseResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "average": - err = unpopulate(val, "Average", &p.Average) - delete(rawMsg, key) - case "_count": - err = unpopulate(val, "Count", &p.Count) - delete(rawMsg, key) - case "maximum": - err = unpopulate(val, "Maximum", &p.Maximum) - delete(rawMsg, key) - case "minimum": - err = unpopulate(val, "Minimum", &p.Minimum) - delete(rawMsg, key) - case "P10": - err = unpopulate(val, "P10", &p.P10) - delete(rawMsg, key) - case "P25": - err = unpopulate(val, "P25", &p.P25) - delete(rawMsg, key) - case "P50": - err = unpopulate(val, "P50", &p.P50) - delete(rawMsg, key) - case "P75": - err = unpopulate(val, "P75", &p.P75) - delete(rawMsg, key) - case "P90": - err = unpopulate(val, "P90", &p.P90) - delete(rawMsg, key) - case "P95": - err = unpopulate(val, "P95", &p.P95) - delete(rawMsg, key) - case "P99": - err = unpopulate(val, "P99", &p.P99) - delete(rawMsg, key) - case "timestamp": - err = unpopulateTimeRFC3339(val, "Timestamp", &p.Timestamp) - delete(rawMsg, key) - case "total": - err = unpopulate(val, "Total", &p.Total) + case "id": + err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PeriodicModeBackupPolicy. -func (p PeriodicModeBackupPolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoIndex. +func (m MongoIndex) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "migrationState", p.MigrationState) - populate(objectMap, "periodicModeProperties", p.PeriodicModeProperties) - objectMap["type"] = BackupPolicyTypePeriodic + populate(objectMap, "key", m.Key) + populate(objectMap, "options", m.Options) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PeriodicModeBackupPolicy. -func (p *PeriodicModeBackupPolicy) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoIndex. +func (m *MongoIndex) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "migrationState": - err = unpopulate(val, "MigrationState", &p.MigrationState) - delete(rawMsg, key) - case "periodicModeProperties": - err = unpopulate(val, "PeriodicModeProperties", &p.PeriodicModeProperties) + case "key": + err = unpopulate(val, "Key", &m.Key) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + case "options": + err = unpopulate(val, "Options", &m.Options) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PeriodicModeProperties. -func (p PeriodicModeProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoIndexKeys. +func (m MongoIndexKeys) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "backupIntervalInMinutes", p.BackupIntervalInMinutes) - populate(objectMap, "backupRetentionIntervalInHours", p.BackupRetentionIntervalInHours) - populate(objectMap, "backupStorageRedundancy", p.BackupStorageRedundancy) + populate(objectMap, "keys", m.Keys) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PeriodicModeProperties. -func (p *PeriodicModeProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoIndexKeys. +func (m *MongoIndexKeys) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "backupIntervalInMinutes": - err = unpopulate(val, "BackupIntervalInMinutes", &p.BackupIntervalInMinutes) - delete(rawMsg, key) - case "backupRetentionIntervalInHours": - err = unpopulate(val, "BackupRetentionIntervalInHours", &p.BackupRetentionIntervalInHours) - delete(rawMsg, key) - case "backupStorageRedundancy": - err = unpopulate(val, "BackupStorageRedundancy", &p.BackupStorageRedundancy) + case "keys": + err = unpopulate(val, "Keys", &m.Keys) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Permission. -func (p Permission) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoIndexOptions. +func (m MongoIndexOptions) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "dataActions", p.DataActions) - populate(objectMap, "notDataActions", p.NotDataActions) + populate(objectMap, "expireAfterSeconds", m.ExpireAfterSeconds) + populate(objectMap, "unique", m.Unique) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Permission. -func (p *Permission) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoIndexOptions. +func (m *MongoIndexOptions) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "dataActions": - err = unpopulate(val, "DataActions", &p.DataActions) + case "expireAfterSeconds": + err = unpopulate(val, "ExpireAfterSeconds", &m.ExpireAfterSeconds) delete(rawMsg, key) - case "notDataActions": - err = unpopulate(val, "NotDataActions", &p.NotDataActions) + case "unique": + err = unpopulate(val, "Unique", &m.Unique) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PhysicalPartitionID. -func (p PhysicalPartitionID) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoRoleDefinitionCreateUpdateParameters. +func (m MongoRoleDefinitionCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "id", p.ID) + populate(objectMap, "properties", m.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PhysicalPartitionID. -func (p *PhysicalPartitionID) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoRoleDefinitionCreateUpdateParameters. +func (m *MongoRoleDefinitionCreateUpdateParameters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PhysicalPartitionStorageInfo. -func (p PhysicalPartitionStorageInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoRoleDefinitionGetResults. +func (m MongoRoleDefinitionGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "id", p.ID) - populate(objectMap, "storageInKB", p.StorageInKB) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PhysicalPartitionStorageInfo. -func (p *PhysicalPartitionStorageInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoRoleDefinitionGetResults. +func (m *MongoRoleDefinitionGetResults) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { case "id": - err = unpopulate(val, "ID", &p.ID) + err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) - case "storageInKB": - err = unpopulate(val, "StorageInKB", &p.StorageInKB) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PhysicalPartitionStorageInfoCollection. -func (p PhysicalPartitionStorageInfoCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoRoleDefinitionListResult. +func (m MongoRoleDefinitionListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "physicalPartitionStorageInfoCollection", p.PhysicalPartitionStorageInfoCollection) + populate(objectMap, "value", m.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PhysicalPartitionStorageInfoCollection. -func (p *PhysicalPartitionStorageInfoCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoRoleDefinitionListResult. +func (m *MongoRoleDefinitionListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "physicalPartitionStorageInfoCollection": - err = unpopulate(val, "PhysicalPartitionStorageInfoCollection", &p.PhysicalPartitionStorageInfoCollection) + case "value": + err = unpopulate(val, "Value", &m.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PhysicalPartitionThroughputInfoProperties. -func (p PhysicalPartitionThroughputInfoProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoRoleDefinitionResource. +func (m MongoRoleDefinitionResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "physicalPartitionThroughputInfo", p.PhysicalPartitionThroughputInfo) + populate(objectMap, "databaseName", m.DatabaseName) + populate(objectMap, "privileges", m.Privileges) + populate(objectMap, "roleName", m.RoleName) + populate(objectMap, "roles", m.Roles) + populate(objectMap, "type", m.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PhysicalPartitionThroughputInfoProperties. -func (p *PhysicalPartitionThroughputInfoProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoRoleDefinitionResource. +func (m *MongoRoleDefinitionResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "physicalPartitionThroughputInfo": - err = unpopulate(val, "PhysicalPartitionThroughputInfo", &p.PhysicalPartitionThroughputInfo) + case "databaseName": + err = unpopulate(val, "DatabaseName", &m.DatabaseName) + delete(rawMsg, key) + case "privileges": + err = unpopulate(val, "Privileges", &m.Privileges) + delete(rawMsg, key) + case "roleName": + err = unpopulate(val, "RoleName", &m.RoleName) + delete(rawMsg, key) + case "roles": + err = unpopulate(val, "Roles", &m.Roles) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PhysicalPartitionThroughputInfoResource. -func (p PhysicalPartitionThroughputInfoResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoUserDefinitionCreateUpdateParameters. +func (m MongoUserDefinitionCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "id", p.ID) - populate(objectMap, "throughput", p.Throughput) + populate(objectMap, "properties", m.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PhysicalPartitionThroughputInfoResource. -func (p *PhysicalPartitionThroughputInfoResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoUserDefinitionCreateUpdateParameters. +func (m *MongoUserDefinitionCreateUpdateParameters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "throughput": - err = unpopulate(val, "Throughput", &p.Throughput) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PhysicalPartitionThroughputInfoResult. -func (p PhysicalPartitionThroughputInfoResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoUserDefinitionGetResults. +func (m MongoUserDefinitionGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "id", p.ID) - populate(objectMap, "identity", p.Identity) - populate(objectMap, "location", p.Location) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "tags", p.Tags) - populate(objectMap, "type", p.Type) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PhysicalPartitionThroughputInfoResult. -func (p *PhysicalPartitionThroughputInfoResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoUserDefinitionGetResults. +func (m *MongoUserDefinitionGetResults) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &p.Identity) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &p.Location) + err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &p.Name) + err = unpopulate(val, "Name", &m.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &p.Tags) + err = unpopulate(val, "Properties", &m.Properties) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &p.Type) + err = unpopulate(val, "Type", &m.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PhysicalPartitionThroughputInfoResultProperties. -func (p PhysicalPartitionThroughputInfoResultProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoUserDefinitionListResult. +func (m MongoUserDefinitionListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "resource", p.Resource) + populate(objectMap, "value", m.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PhysicalPartitionThroughputInfoResultProperties. -func (p *PhysicalPartitionThroughputInfoResultProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoUserDefinitionListResult. +func (m *MongoUserDefinitionListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "resource": - err = unpopulate(val, "Resource", &p.Resource) + case "value": + err = unpopulate(val, "Value", &m.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PhysicalPartitionThroughputInfoResultPropertiesResource. -func (p PhysicalPartitionThroughputInfoResultPropertiesResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MongoUserDefinitionResource. +func (m MongoUserDefinitionResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "physicalPartitionThroughputInfo", p.PhysicalPartitionThroughputInfo) + populate(objectMap, "customData", m.CustomData) + populate(objectMap, "databaseName", m.DatabaseName) + populate(objectMap, "mechanisms", m.Mechanisms) + populate(objectMap, "password", m.Password) + populate(objectMap, "roles", m.Roles) + populate(objectMap, "userName", m.UserName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PhysicalPartitionThroughputInfoResultPropertiesResource. -func (p *PhysicalPartitionThroughputInfoResultPropertiesResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoUserDefinitionResource. +func (m *MongoUserDefinitionResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "physicalPartitionThroughputInfo": - err = unpopulate(val, "PhysicalPartitionThroughputInfo", &p.PhysicalPartitionThroughputInfo) + case "customData": + err = unpopulate(val, "CustomData", &m.CustomData) + delete(rawMsg, key) + case "databaseName": + err = unpopulate(val, "DatabaseName", &m.DatabaseName) + delete(rawMsg, key) + case "mechanisms": + err = unpopulate(val, "Mechanisms", &m.Mechanisms) + delete(rawMsg, key) + case "password": + err = unpopulate(val, "Password", &m.Password) + delete(rawMsg, key) + case "roles": + err = unpopulate(val, "Roles", &m.Roles) + delete(rawMsg, key) + case "userName": + err = unpopulate(val, "UserName", &m.UserName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection. -func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NotebookWorkspace. +func (n NotebookWorkspace) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "type", p.Type) + populate(objectMap, "id", n.ID) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "type", n.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection. -func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NotebookWorkspace. +func (n *NotebookWorkspace) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { case "id": - err = unpopulate(val, "ID", &p.ID) + err = unpopulate(val, "ID", &n.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &p.Name) + err = unpopulate(val, "Name", &n.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &p.Properties) + err = unpopulate(val, "Properties", &n.Properties) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &p.Type) + err = unpopulate(val, "Type", &n.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult. -func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NotebookWorkspaceConnectionInfoResult. +func (n NotebookWorkspaceConnectionInfoResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "value", p.Value) + populate(objectMap, "authToken", n.AuthToken) + populate(objectMap, "notebookServerEndpoint", n.NotebookServerEndpoint) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionListResult. -func (p *PrivateEndpointConnectionListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NotebookWorkspaceConnectionInfoResult. +func (n *NotebookWorkspaceConnectionInfoResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &p.Value) + case "authToken": + err = unpopulate(val, "AuthToken", &n.AuthToken) + delete(rawMsg, key) + case "notebookServerEndpoint": + err = unpopulate(val, "NotebookServerEndpoint", &n.NotebookServerEndpoint) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties. -func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NotebookWorkspaceCreateUpdateParameters. +func (n NotebookWorkspaceCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "groupId", p.GroupID) - populate(objectMap, "privateEndpoint", p.PrivateEndpoint) - populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) - populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "id", n.ID) + populate(objectMap, "name", n.Name) + populate(objectMap, "type", n.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionProperties. -func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NotebookWorkspaceCreateUpdateParameters. +func (n *NotebookWorkspaceCreateUpdateParameters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "groupId": - err = unpopulate(val, "GroupID", &p.GroupID) - delete(rawMsg, key) - case "privateEndpoint": - err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) + case "id": + err = unpopulate(val, "ID", &n.ID) delete(rawMsg, key) - case "privateLinkServiceConnectionState": - err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) + case "name": + err = unpopulate(val, "Name", &n.Name) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + case "type": + err = unpopulate(val, "Type", &n.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointProperty. -func (p PrivateEndpointProperty) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NotebookWorkspaceListResult. +func (n NotebookWorkspaceListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "id", p.ID) + populate(objectMap, "value", n.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointProperty. -func (p *PrivateEndpointProperty) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NotebookWorkspaceListResult. +func (n *NotebookWorkspaceListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) + case "value": + err = unpopulate(val, "Value", &n.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NotebookWorkspaceProperties. +func (n NotebookWorkspaceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "notebookServerEndpoint", n.NotebookServerEndpoint) + populate(objectMap, "status", n.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NotebookWorkspaceProperties. +func (n *NotebookWorkspaceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "notebookServerEndpoint": + err = unpopulate(val, "NotebookServerEndpoint", &n.NotebookServerEndpoint) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &n.Status) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource. -func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Operation. +func (o Operation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "type", p.Type) + populate(objectMap, "display", o.Display) + populate(objectMap, "name", o.Name) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResource. -func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. +func (o *Operation) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) + case "display": + err = unpopulate(val, "Display", &o.Display) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + err = unpopulate(val, "Name", &o.Name) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult. -func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. +func (o OperationDisplay) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "value", p.Value) + populate(objectMap, "Description", o.Description) + populate(objectMap, "Operation", o.Operation) + populate(objectMap, "Provider", o.Provider) + populate(objectMap, "Resource", o.Resource) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceListResult. -func (p *PrivateLinkResourceListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. +func (o *OperationDisplay) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &p.Value) + case "Description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) + case "Operation": + err = unpopulate(val, "Operation", &o.Operation) + delete(rawMsg, key) + case "Provider": + err = unpopulate(val, "Provider", &o.Provider) + delete(rawMsg, key) + case "Resource": + err = unpopulate(val, "Resource", &o.Resource) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. -func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationListResult. +func (o OperationListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "groupId", p.GroupID) - populate(objectMap, "requiredMembers", p.RequiredMembers) - populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties. -func (p *PrivateLinkResourceProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. +func (o *OperationListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "groupId": - err = unpopulate(val, "GroupID", &p.GroupID) - delete(rawMsg, key) - case "requiredMembers": - err = unpopulate(val, "RequiredMembers", &p.RequiredMembers) + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) delete(rawMsg, key) - case "requiredZoneNames": - err = unpopulate(val, "RequiredZoneNames", &p.RequiredZoneNames) + case "value": + err = unpopulate(val, "Value", &o.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionStateProperty. -func (p PrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OptionsResource. +func (o OptionsResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "actionsRequired", p.ActionsRequired) - populate(objectMap, "description", p.Description) - populate(objectMap, "status", p.Status) + populate(objectMap, "autoscaleSettings", o.AutoscaleSettings) + populate(objectMap, "throughput", o.Throughput) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionStateProperty. -func (p *PrivateLinkServiceConnectionStateProperty) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OptionsResource. +func (o *OptionsResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "actionsRequired": - err = unpopulate(val, "ActionsRequired", &p.ActionsRequired) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &p.Description) + case "autoscaleSettings": + err = unpopulate(val, "AutoscaleSettings", &o.AutoscaleSettings) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &p.Status) + case "throughput": + err = unpopulate(val, "Throughput", &o.Throughput) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Privilege. -func (p Privilege) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartitionMetric. +func (p PartitionMetric) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "actions", p.Actions) - populate(objectMap, "resource", p.Resource) + populateTimeRFC3339(objectMap, "endTime", p.EndTime) + populate(objectMap, "metricValues", p.MetricValues) + populate(objectMap, "name", p.Name) + populate(objectMap, "partitionId", p.PartitionID) + populate(objectMap, "partitionKeyRangeId", p.PartitionKeyRangeID) + populateTimeRFC3339(objectMap, "startTime", p.StartTime) + populate(objectMap, "timeGrain", p.TimeGrain) + populate(objectMap, "unit", p.Unit) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Privilege. -func (p *Privilege) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PartitionMetric. +func (p *PartitionMetric) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -8464,11 +6028,29 @@ func (p *Privilege) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "actions": - err = unpopulate(val, "Actions", &p.Actions) + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &p.EndTime) delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &p.Resource) + case "metricValues": + err = unpopulate(val, "MetricValues", &p.MetricValues) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "partitionId": + err = unpopulate(val, "PartitionID", &p.PartitionID) + delete(rawMsg, key) + case "partitionKeyRangeId": + err = unpopulate(val, "PartitionKeyRangeID", &p.PartitionKeyRangeID) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &p.StartTime) + delete(rawMsg, key) + case "timeGrain": + err = unpopulate(val, "TimeGrain", &p.TimeGrain) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &p.Unit) delete(rawMsg, key) } if err != nil { @@ -8478,16 +6060,15 @@ func (p *Privilege) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivilegeResource. -func (p PrivilegeResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartitionMetricListResult. +func (p PartitionMetricListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "collection", p.Collection) - populate(objectMap, "db", p.Db) + populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivilegeResource. -func (p *PrivilegeResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PartitionMetricListResult. +func (p *PartitionMetricListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -8495,11 +6076,8 @@ func (p *PrivilegeResource) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "collection": - err = unpopulate(val, "Collection", &p.Collection) - delete(rawMsg, key) - case "db": - err = unpopulate(val, "Db", &p.Db) + case "value": + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { @@ -8509,17 +6087,21 @@ func (p *PrivilegeResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ProxyResource. -func (p ProxyResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartitionUsage. +func (p PartitionUsage) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "id", p.ID) + populate(objectMap, "currentValue", p.CurrentValue) + populate(objectMap, "limit", p.Limit) populate(objectMap, "name", p.Name) - populate(objectMap, "type", p.Type) + populate(objectMap, "partitionId", p.PartitionID) + populate(objectMap, "partitionKeyRangeId", p.PartitionKeyRangeID) + populate(objectMap, "quotaPeriod", p.QuotaPeriod) + populate(objectMap, "unit", p.Unit) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource. -func (p *ProxyResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PartitionUsage. +func (p *PartitionUsage) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -8527,14 +6109,26 @@ func (p *ProxyResource) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) + case "currentValue": + err = unpopulate(val, "CurrentValue", &p.CurrentValue) + delete(rawMsg, key) + case "limit": + err = unpopulate(val, "Limit", &p.Limit) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + case "partitionId": + err = unpopulate(val, "PartitionID", &p.PartitionID) + delete(rawMsg, key) + case "partitionKeyRangeId": + err = unpopulate(val, "PartitionKeyRangeID", &p.PartitionKeyRangeID) + delete(rawMsg, key) + case "quotaPeriod": + err = unpopulate(val, "QuotaPeriod", &p.QuotaPeriod) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &p.Unit) delete(rawMsg, key) } if err != nil { @@ -8544,639 +6138,666 @@ func (p *ProxyResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RedistributeThroughputParameters. -func (r RedistributeThroughputParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartitionUsagesResult. +func (p PartitionUsagesResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "id", r.ID) - populate(objectMap, "identity", r.Identity) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) + populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RedistributeThroughputParameters. -func (r *RedistributeThroughputParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &r.Identity) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &r.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &r.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &r.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) +// UnmarshalJSON implements the json.Unmarshaller interface for type PartitionUsagesResult. +func (p *PartitionUsagesResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RedistributeThroughputProperties. -func (r RedistributeThroughputProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PercentileMetric. +func (p PercentileMetric) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "resource", r.Resource) + populateTimeRFC3339(objectMap, "endTime", p.EndTime) + populate(objectMap, "metricValues", p.MetricValues) + populate(objectMap, "name", p.Name) + populateTimeRFC3339(objectMap, "startTime", p.StartTime) + populate(objectMap, "timeGrain", p.TimeGrain) + populate(objectMap, "unit", p.Unit) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RedistributeThroughputProperties. -func (r *RedistributeThroughputProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PercentileMetric. +func (p *PercentileMetric) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "resource": - err = unpopulate(val, "Resource", &r.Resource) + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &p.EndTime) + delete(rawMsg, key) + case "metricValues": + err = unpopulate(val, "MetricValues", &p.MetricValues) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &p.StartTime) + delete(rawMsg, key) + case "timeGrain": + err = unpopulate(val, "TimeGrain", &p.TimeGrain) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &p.Unit) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RedistributeThroughputPropertiesResource. -func (r RedistributeThroughputPropertiesResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PercentileMetricListResult. +func (p PercentileMetricListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "sourcePhysicalPartitionThroughputInfo", r.SourcePhysicalPartitionThroughputInfo) - populate(objectMap, "targetPhysicalPartitionThroughputInfo", r.TargetPhysicalPartitionThroughputInfo) - populate(objectMap, "throughputPolicy", r.ThroughputPolicy) + populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RedistributeThroughputPropertiesResource. -func (r *RedistributeThroughputPropertiesResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PercentileMetricListResult. +func (p *PercentileMetricListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "sourcePhysicalPartitionThroughputInfo": - err = unpopulate(val, "SourcePhysicalPartitionThroughputInfo", &r.SourcePhysicalPartitionThroughputInfo) - delete(rawMsg, key) - case "targetPhysicalPartitionThroughputInfo": - err = unpopulate(val, "TargetPhysicalPartitionThroughputInfo", &r.TargetPhysicalPartitionThroughputInfo) - delete(rawMsg, key) - case "throughputPolicy": - err = unpopulate(val, "ThroughputPolicy", &r.ThroughputPolicy) + case "value": + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RegionForOnlineOffline. -func (r RegionForOnlineOffline) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PercentileMetricValue. +func (p PercentileMetricValue) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "region", r.Region) + populate(objectMap, "average", p.Average) + populate(objectMap, "_count", p.Count) + populate(objectMap, "maximum", p.Maximum) + populate(objectMap, "minimum", p.Minimum) + populate(objectMap, "P10", p.P10) + populate(objectMap, "P25", p.P25) + populate(objectMap, "P50", p.P50) + populate(objectMap, "P75", p.P75) + populate(objectMap, "P90", p.P90) + populate(objectMap, "P95", p.P95) + populate(objectMap, "P99", p.P99) + populateTimeRFC3339(objectMap, "timestamp", p.Timestamp) + populate(objectMap, "total", p.Total) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RegionForOnlineOffline. -func (r *RegionForOnlineOffline) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PercentileMetricValue. +func (p *PercentileMetricValue) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "region": - err = unpopulate(val, "Region", &r.Region) + case "average": + err = unpopulate(val, "Average", &p.Average) + delete(rawMsg, key) + case "_count": + err = unpopulate(val, "Count", &p.Count) + delete(rawMsg, key) + case "maximum": + err = unpopulate(val, "Maximum", &p.Maximum) + delete(rawMsg, key) + case "minimum": + err = unpopulate(val, "Minimum", &p.Minimum) + delete(rawMsg, key) + case "P10": + err = unpopulate(val, "P10", &p.P10) + delete(rawMsg, key) + case "P25": + err = unpopulate(val, "P25", &p.P25) + delete(rawMsg, key) + case "P50": + err = unpopulate(val, "P50", &p.P50) + delete(rawMsg, key) + case "P75": + err = unpopulate(val, "P75", &p.P75) + delete(rawMsg, key) + case "P90": + err = unpopulate(val, "P90", &p.P90) + delete(rawMsg, key) + case "P95": + err = unpopulate(val, "P95", &p.P95) + delete(rawMsg, key) + case "P99": + err = unpopulate(val, "P99", &p.P99) + delete(rawMsg, key) + case "timestamp": + err = unpopulateTimeRFC3339(val, "Timestamp", &p.Timestamp) + delete(rawMsg, key) + case "total": + err = unpopulate(val, "Total", &p.Total) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RegionalServiceResource. -func (r RegionalServiceResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PeriodicModeBackupPolicy. +func (p PeriodicModeBackupPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "status", r.Status) + populate(objectMap, "migrationState", p.MigrationState) + populate(objectMap, "periodicModeProperties", p.PeriodicModeProperties) + objectMap["type"] = BackupPolicyTypePeriodic return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RegionalServiceResource. -func (r *RegionalServiceResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PeriodicModeBackupPolicy. +func (p *PeriodicModeBackupPolicy) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "location": - err = unpopulate(val, "Location", &r.Location) + case "migrationState": + err = unpopulate(val, "MigrationState", &p.MigrationState) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) + case "periodicModeProperties": + err = unpopulate(val, "PeriodicModeProperties", &p.PeriodicModeProperties) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &r.Status) + case "type": + err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Resource. -func (r Resource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PeriodicModeProperties. +func (p PeriodicModeProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "id", r.ID) - populate(objectMap, "name", r.Name) - populate(objectMap, "type", r.Type) + populate(objectMap, "backupIntervalInMinutes", p.BackupIntervalInMinutes) + populate(objectMap, "backupRetentionIntervalInHours", p.BackupRetentionIntervalInHours) + populate(objectMap, "backupStorageRedundancy", p.BackupStorageRedundancy) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. -func (r *Resource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PeriodicModeProperties. +func (p *PeriodicModeProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) + case "backupIntervalInMinutes": + err = unpopulate(val, "BackupIntervalInMinutes", &p.BackupIntervalInMinutes) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) + case "backupRetentionIntervalInHours": + err = unpopulate(val, "BackupRetentionIntervalInHours", &p.BackupRetentionIntervalInHours) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) + case "backupStorageRedundancy": + err = unpopulate(val, "BackupStorageRedundancy", &p.BackupStorageRedundancy) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableDatabaseAccountGetResult. -func (r RestorableDatabaseAccountGetResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Permission. +func (p Permission) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "type", r.Type) + populate(objectMap, "dataActions", p.DataActions) + populate(objectMap, "notDataActions", p.NotDataActions) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableDatabaseAccountGetResult. -func (r *RestorableDatabaseAccountGetResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Permission. +func (p *Permission) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &r.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &r.Properties) + case "dataActions": + err = unpopulate(val, "DataActions", &p.DataActions) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) + case "notDataActions": + err = unpopulate(val, "NotDataActions", &p.NotDataActions) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableDatabaseAccountProperties. -func (r RestorableDatabaseAccountProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection. +func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "apiType", r.APIType) - populate(objectMap, "accountName", r.AccountName) - populateTimeRFC3339(objectMap, "creationTime", r.CreationTime) - populateTimeRFC3339(objectMap, "deletionTime", r.DeletionTime) - populateTimeRFC3339(objectMap, "oldestRestorableTime", r.OldestRestorableTime) - populate(objectMap, "restorableLocations", r.RestorableLocations) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableDatabaseAccountProperties. -func (r *RestorableDatabaseAccountProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection. +func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "apiType": - err = unpopulate(val, "APIType", &r.APIType) - delete(rawMsg, key) - case "accountName": - err = unpopulate(val, "AccountName", &r.AccountName) - delete(rawMsg, key) - case "creationTime": - err = unpopulateTimeRFC3339(val, "CreationTime", &r.CreationTime) + case "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) - case "deletionTime": - err = unpopulateTimeRFC3339(val, "DeletionTime", &r.DeletionTime) + case "name": + err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) - case "oldestRestorableTime": - err = unpopulateTimeRFC3339(val, "OldestRestorableTime", &r.OldestRestorableTime) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) - case "restorableLocations": - err = unpopulate(val, "RestorableLocations", &r.RestorableLocations) + case "type": + err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableDatabaseAccountsListResult. -func (r RestorableDatabaseAccountsListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult. +func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "value", r.Value) + populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableDatabaseAccountsListResult. -func (r *RestorableDatabaseAccountsListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionListResult. +func (p *PrivateEndpointConnectionListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { case "value": - err = unpopulate(val, "Value", &r.Value) + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableGremlinDatabaseGetResult. -func (r RestorableGremlinDatabaseGetResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties. +func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "id", r.ID) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "type", r.Type) + populate(objectMap, "groupId", p.GroupID) + populate(objectMap, "privateEndpoint", p.PrivateEndpoint) + populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) + populate(objectMap, "provisioningState", p.ProvisioningState) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableGremlinDatabaseGetResult. -func (r *RestorableGremlinDatabaseGetResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionProperties. +func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) + case "groupId": + err = unpopulate(val, "GroupID", &p.GroupID) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) + case "privateEndpoint": + err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &r.Properties) + case "privateLinkServiceConnectionState": + err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableGremlinDatabaseProperties. -func (r RestorableGremlinDatabaseProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointProperty. +func (p PrivateEndpointProperty) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "resource", r.Resource) + populate(objectMap, "id", p.ID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableGremlinDatabaseProperties. -func (r *RestorableGremlinDatabaseProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointProperty. +func (p *PrivateEndpointProperty) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "resource": - err = unpopulate(val, "Resource", &r.Resource) + case "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableGremlinDatabasePropertiesResource. -func (r RestorableGremlinDatabasePropertiesResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource. +func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "eventTimestamp", r.EventTimestamp) - populate(objectMap, "operationType", r.OperationType) - populate(objectMap, "ownerId", r.OwnerID) - populate(objectMap, "ownerResourceId", r.OwnerResourceID) - populate(objectMap, "_rid", r.Rid) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableGremlinDatabasePropertiesResource. -func (r *RestorableGremlinDatabasePropertiesResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResource. +func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "eventTimestamp": - err = unpopulate(val, "EventTimestamp", &r.EventTimestamp) - delete(rawMsg, key) - case "operationType": - err = unpopulate(val, "OperationType", &r.OperationType) + case "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) - case "ownerId": - err = unpopulate(val, "OwnerID", &r.OwnerID) + case "name": + err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) - case "ownerResourceId": - err = unpopulate(val, "OwnerResourceID", &r.OwnerResourceID) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) - case "_rid": - err = unpopulate(val, "Rid", &r.Rid) + case "type": + err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableGremlinDatabasesListResult. -func (r RestorableGremlinDatabasesListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult. +func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "value", r.Value) + populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableGremlinDatabasesListResult. -func (r *RestorableGremlinDatabasesListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceListResult. +func (p *PrivateLinkResourceListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { case "value": - err = unpopulate(val, "Value", &r.Value) + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableGremlinGraphGetResult. -func (r RestorableGremlinGraphGetResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. +func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "id", r.ID) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "type", r.Type) + populate(objectMap, "groupId", p.GroupID) + populate(objectMap, "requiredMembers", p.RequiredMembers) + populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableGremlinGraphGetResult. -func (r *RestorableGremlinGraphGetResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties. +func (p *PrivateLinkResourceProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) + case "groupId": + err = unpopulate(val, "GroupID", &p.GroupID) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &r.Properties) + case "requiredMembers": + err = unpopulate(val, "RequiredMembers", &p.RequiredMembers) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) + case "requiredZoneNames": + err = unpopulate(val, "RequiredZoneNames", &p.RequiredZoneNames) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableGremlinGraphProperties. -func (r RestorableGremlinGraphProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionStateProperty. +func (p PrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "resource", r.Resource) + populate(objectMap, "actionsRequired", p.ActionsRequired) + populate(objectMap, "description", p.Description) + populate(objectMap, "status", p.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableGremlinGraphProperties. -func (r *RestorableGremlinGraphProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionStateProperty. +func (p *PrivateLinkServiceConnectionStateProperty) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "resource": - err = unpopulate(val, "Resource", &r.Resource) + case "actionsRequired": + err = unpopulate(val, "ActionsRequired", &p.ActionsRequired) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &p.Description) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &p.Status) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableGremlinGraphPropertiesResource. -func (r RestorableGremlinGraphPropertiesResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Privilege. +func (p Privilege) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "eventTimestamp", r.EventTimestamp) - populate(objectMap, "operationType", r.OperationType) - populate(objectMap, "ownerId", r.OwnerID) - populate(objectMap, "ownerResourceId", r.OwnerResourceID) - populate(objectMap, "_rid", r.Rid) + populate(objectMap, "actions", p.Actions) + populate(objectMap, "resource", p.Resource) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableGremlinGraphPropertiesResource. -func (r *RestorableGremlinGraphPropertiesResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Privilege. +func (p *Privilege) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "eventTimestamp": - err = unpopulate(val, "EventTimestamp", &r.EventTimestamp) - delete(rawMsg, key) - case "operationType": - err = unpopulate(val, "OperationType", &r.OperationType) - delete(rawMsg, key) - case "ownerId": - err = unpopulate(val, "OwnerID", &r.OwnerID) - delete(rawMsg, key) - case "ownerResourceId": - err = unpopulate(val, "OwnerResourceID", &r.OwnerResourceID) + case "actions": + err = unpopulate(val, "Actions", &p.Actions) delete(rawMsg, key) - case "_rid": - err = unpopulate(val, "Rid", &r.Rid) + case "resource": + err = unpopulate(val, "Resource", &p.Resource) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableGremlinGraphsListResult. -func (r RestorableGremlinGraphsListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivilegeResource. +func (p PrivilegeResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "value", r.Value) + populate(objectMap, "collection", p.Collection) + populate(objectMap, "db", p.Db) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableGremlinGraphsListResult. -func (r *RestorableGremlinGraphsListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivilegeResource. +func (p *PrivilegeResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &r.Value) + case "collection": + err = unpopulate(val, "Collection", &p.Collection) + delete(rawMsg, key) + case "db": + err = unpopulate(val, "Db", &p.Db) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableGremlinResourcesGetResult. -func (r RestorableGremlinResourcesGetResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ProxyResource. +func (p ProxyResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "databaseName", r.DatabaseName) - populate(objectMap, "graphNames", r.GraphNames) - populate(objectMap, "id", r.ID) - populate(objectMap, "name", r.Name) - populate(objectMap, "type", r.Type) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableGremlinResourcesGetResult. -func (r *RestorableGremlinResourcesGetResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource. +func (p *ProxyResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "databaseName": - err = unpopulate(val, "DatabaseName", &r.DatabaseName) - delete(rawMsg, key) - case "graphNames": - err = unpopulate(val, "GraphNames", &r.GraphNames) - delete(rawMsg, key) case "id": - err = unpopulate(val, "ID", &r.ID) + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &r.Name) + err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &r.Type) + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RegionForOnlineOffline. +func (r RegionForOnlineOffline) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "region", r.Region) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RegionForOnlineOffline. +func (r *RegionForOnlineOffline) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "region": + err = unpopulate(val, "Region", &r.Region) delete(rawMsg, key) } if err != nil { @@ -9186,15 +6807,17 @@ func (r *RestorableGremlinResourcesGetResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableGremlinResourcesListResult. -func (r RestorableGremlinResourcesListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RegionalServiceResource. +func (r RegionalServiceResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "value", r.Value) + populate(objectMap, "location", r.Location) + populate(objectMap, "name", r.Name) + populate(objectMap, "status", r.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableGremlinResourcesListResult. -func (r *RestorableGremlinResourcesListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RegionalServiceResource. +func (r *RegionalServiceResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -9202,8 +6825,14 @@ func (r *RestorableGremlinResourcesListResult) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &r.Value) + case "location": + err = unpopulate(val, "Location", &r.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &r.Status) delete(rawMsg, key) } if err != nil { @@ -9213,18 +6842,17 @@ func (r *RestorableGremlinResourcesListResult) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableLocationResource. -func (r RestorableLocationResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Resource. +func (r Resource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "creationTime", r.CreationTime) - populateTimeRFC3339(objectMap, "deletionTime", r.DeletionTime) - populate(objectMap, "locationName", r.LocationName) - populate(objectMap, "regionalDatabaseAccountInstanceId", r.RegionalDatabaseAccountInstanceID) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "type", r.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableLocationResource. -func (r *RestorableLocationResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. +func (r *Resource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -9232,17 +6860,14 @@ func (r *RestorableLocationResource) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "creationTime": - err = unpopulateTimeRFC3339(val, "CreationTime", &r.CreationTime) - delete(rawMsg, key) - case "deletionTime": - err = unpopulateTimeRFC3339(val, "DeletionTime", &r.DeletionTime) + case "id": + err = unpopulate(val, "ID", &r.ID) delete(rawMsg, key) - case "locationName": - err = unpopulate(val, "LocationName", &r.LocationName) + case "name": + err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) - case "regionalDatabaseAccountInstanceId": - err = unpopulate(val, "RegionalDatabaseAccountInstanceID", &r.RegionalDatabaseAccountInstanceID) + case "type": + err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) } if err != nil { @@ -9252,18 +6877,19 @@ func (r *RestorableLocationResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableMongodbCollectionGetResult. -func (r RestorableMongodbCollectionGetResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RestorableDatabaseAccountGetResult. +func (r RestorableDatabaseAccountGetResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", r.ID) + populate(objectMap, "location", r.Location) populate(objectMap, "name", r.Name) populate(objectMap, "properties", r.Properties) populate(objectMap, "type", r.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableMongodbCollectionGetResult. -func (r *RestorableMongodbCollectionGetResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableDatabaseAccountGetResult. +func (r *RestorableDatabaseAccountGetResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -9274,6 +6900,9 @@ func (r *RestorableMongodbCollectionGetResult) UnmarshalJSON(data []byte) error case "id": err = unpopulate(val, "ID", &r.ID) delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &r.Location) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) @@ -9291,15 +6920,19 @@ func (r *RestorableMongodbCollectionGetResult) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableMongodbCollectionProperties. -func (r RestorableMongodbCollectionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RestorableDatabaseAccountProperties. +func (r RestorableDatabaseAccountProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "resource", r.Resource) + populate(objectMap, "apiType", r.APIType) + populate(objectMap, "accountName", r.AccountName) + populateTimeRFC3339(objectMap, "creationTime", r.CreationTime) + populateTimeRFC3339(objectMap, "deletionTime", r.DeletionTime) + populate(objectMap, "restorableLocations", r.RestorableLocations) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableMongodbCollectionProperties. -func (r *RestorableMongodbCollectionProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableDatabaseAccountProperties. +func (r *RestorableDatabaseAccountProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -9307,8 +6940,20 @@ func (r *RestorableMongodbCollectionProperties) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { - case "resource": - err = unpopulate(val, "Resource", &r.Resource) + case "apiType": + err = unpopulate(val, "APIType", &r.APIType) + delete(rawMsg, key) + case "accountName": + err = unpopulate(val, "AccountName", &r.AccountName) + delete(rawMsg, key) + case "creationTime": + err = unpopulateTimeRFC3339(val, "CreationTime", &r.CreationTime) + delete(rawMsg, key) + case "deletionTime": + err = unpopulateTimeRFC3339(val, "DeletionTime", &r.DeletionTime) + delete(rawMsg, key) + case "restorableLocations": + err = unpopulate(val, "RestorableLocations", &r.RestorableLocations) delete(rawMsg, key) } if err != nil { @@ -9318,19 +6963,15 @@ func (r *RestorableMongodbCollectionProperties) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableMongodbCollectionPropertiesResource. -func (r RestorableMongodbCollectionPropertiesResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RestorableDatabaseAccountsListResult. +func (r RestorableDatabaseAccountsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "eventTimestamp", r.EventTimestamp) - populate(objectMap, "operationType", r.OperationType) - populate(objectMap, "ownerId", r.OwnerID) - populate(objectMap, "ownerResourceId", r.OwnerResourceID) - populate(objectMap, "_rid", r.Rid) + populate(objectMap, "value", r.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableMongodbCollectionPropertiesResource. -func (r *RestorableMongodbCollectionPropertiesResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableDatabaseAccountsListResult. +func (r *RestorableDatabaseAccountsListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -9338,20 +6979,8 @@ func (r *RestorableMongodbCollectionPropertiesResource) UnmarshalJSON(data []byt for key, val := range rawMsg { var err error switch key { - case "eventTimestamp": - err = unpopulate(val, "EventTimestamp", &r.EventTimestamp) - delete(rawMsg, key) - case "operationType": - err = unpopulate(val, "OperationType", &r.OperationType) - delete(rawMsg, key) - case "ownerId": - err = unpopulate(val, "OwnerID", &r.OwnerID) - delete(rawMsg, key) - case "ownerResourceId": - err = unpopulate(val, "OwnerResourceID", &r.OwnerResourceID) - delete(rawMsg, key) - case "_rid": - err = unpopulate(val, "Rid", &r.Rid) + case "value": + err = unpopulate(val, "Value", &r.Value) delete(rawMsg, key) } if err != nil { @@ -9361,15 +6990,18 @@ func (r *RestorableMongodbCollectionPropertiesResource) UnmarshalJSON(data []byt return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableMongodbCollectionsListResult. -func (r RestorableMongodbCollectionsListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RestorableLocationResource. +func (r RestorableLocationResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "value", r.Value) + populateTimeRFC3339(objectMap, "creationTime", r.CreationTime) + populateTimeRFC3339(objectMap, "deletionTime", r.DeletionTime) + populate(objectMap, "locationName", r.LocationName) + populate(objectMap, "regionalDatabaseAccountInstanceId", r.RegionalDatabaseAccountInstanceID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableMongodbCollectionsListResult. -func (r *RestorableMongodbCollectionsListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableLocationResource. +func (r *RestorableLocationResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -9377,8 +7009,17 @@ func (r *RestorableMongodbCollectionsListResult) UnmarshalJSON(data []byte) erro for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &r.Value) + case "creationTime": + err = unpopulateTimeRFC3339(val, "CreationTime", &r.CreationTime) + delete(rawMsg, key) + case "deletionTime": + err = unpopulateTimeRFC3339(val, "DeletionTime", &r.DeletionTime) + delete(rawMsg, key) + case "locationName": + err = unpopulate(val, "LocationName", &r.LocationName) + delete(rawMsg, key) + case "regionalDatabaseAccountInstanceId": + err = unpopulate(val, "RegionalDatabaseAccountInstanceID", &r.RegionalDatabaseAccountInstanceID) delete(rawMsg, key) } if err != nil { @@ -9388,8 +7029,8 @@ func (r *RestorableMongodbCollectionsListResult) UnmarshalJSON(data []byte) erro return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableMongodbDatabaseGetResult. -func (r RestorableMongodbDatabaseGetResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RestorableMongodbCollectionGetResult. +func (r RestorableMongodbCollectionGetResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", r.ID) populate(objectMap, "name", r.Name) @@ -9398,8 +7039,8 @@ func (r RestorableMongodbDatabaseGetResult) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableMongodbDatabaseGetResult. -func (r *RestorableMongodbDatabaseGetResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableMongodbCollectionGetResult. +func (r *RestorableMongodbCollectionGetResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -9427,15 +7068,15 @@ func (r *RestorableMongodbDatabaseGetResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableMongodbDatabaseProperties. -func (r RestorableMongodbDatabaseProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RestorableMongodbCollectionProperties. +func (r RestorableMongodbCollectionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "resource", r.Resource) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableMongodbDatabaseProperties. -func (r *RestorableMongodbDatabaseProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableMongodbCollectionProperties. +func (r *RestorableMongodbCollectionProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -9454,8 +7095,8 @@ func (r *RestorableMongodbDatabaseProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableMongodbDatabasePropertiesResource. -func (r RestorableMongodbDatabasePropertiesResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RestorableMongodbCollectionPropertiesResource. +func (r RestorableMongodbCollectionPropertiesResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "eventTimestamp", r.EventTimestamp) populate(objectMap, "operationType", r.OperationType) @@ -9465,8 +7106,8 @@ func (r RestorableMongodbDatabasePropertiesResource) MarshalJSON() ([]byte, erro return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableMongodbDatabasePropertiesResource. -func (r *RestorableMongodbDatabasePropertiesResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableMongodbCollectionPropertiesResource. +func (r *RestorableMongodbCollectionPropertiesResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -9497,85 +7138,15 @@ func (r *RestorableMongodbDatabasePropertiesResource) UnmarshalJSON(data []byte) return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableMongodbDatabasesListResult. -func (r RestorableMongodbDatabasesListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "value", r.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableMongodbDatabasesListResult. -func (r *RestorableMongodbDatabasesListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "value": - err = unpopulate(val, "Value", &r.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RestorableMongodbResourcesGetResult. -func (r RestorableMongodbResourcesGetResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "collectionNames", r.CollectionNames) - populate(objectMap, "databaseName", r.DatabaseName) - populate(objectMap, "id", r.ID) - populate(objectMap, "name", r.Name) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableMongodbResourcesGetResult. -func (r *RestorableMongodbResourcesGetResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "collectionNames": - err = unpopulate(val, "CollectionNames", &r.CollectionNames) - delete(rawMsg, key) - case "databaseName": - err = unpopulate(val, "DatabaseName", &r.DatabaseName) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RestorableMongodbResourcesListResult. -func (r RestorableMongodbResourcesListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RestorableMongodbCollectionsListResult. +func (r RestorableMongodbCollectionsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "value", r.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableMongodbResourcesListResult. -func (r *RestorableMongodbResourcesListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableMongodbCollectionsListResult. +func (r *RestorableMongodbCollectionsListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -9594,8 +7165,8 @@ func (r *RestorableMongodbResourcesListResult) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableSQLContainerGetResult. -func (r RestorableSQLContainerGetResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RestorableMongodbDatabaseGetResult. +func (r RestorableMongodbDatabaseGetResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", r.ID) populate(objectMap, "name", r.Name) @@ -9604,8 +7175,8 @@ func (r RestorableSQLContainerGetResult) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableSQLContainerGetResult. -func (r *RestorableSQLContainerGetResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableMongodbDatabaseGetResult. +func (r *RestorableMongodbDatabaseGetResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -9633,15 +7204,15 @@ func (r *RestorableSQLContainerGetResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableSQLContainerProperties. -func (r RestorableSQLContainerProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RestorableMongodbDatabaseProperties. +func (r RestorableMongodbDatabaseProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "resource", r.Resource) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableSQLContainerProperties. -func (r *RestorableSQLContainerProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableMongodbDatabaseProperties. +func (r *RestorableMongodbDatabaseProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -9660,10 +7231,9 @@ func (r *RestorableSQLContainerProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableSQLContainerPropertiesResource. -func (r RestorableSQLContainerPropertiesResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RestorableMongodbDatabasePropertiesResource. +func (r RestorableMongodbDatabasePropertiesResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "container", r.Container) populate(objectMap, "eventTimestamp", r.EventTimestamp) populate(objectMap, "operationType", r.OperationType) populate(objectMap, "ownerId", r.OwnerID) @@ -9672,8 +7242,8 @@ func (r RestorableSQLContainerPropertiesResource) MarshalJSON() ([]byte, error) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableSQLContainerPropertiesResource. -func (r *RestorableSQLContainerPropertiesResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableMongodbDatabasePropertiesResource. +func (r *RestorableMongodbDatabasePropertiesResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -9681,9 +7251,6 @@ func (r *RestorableSQLContainerPropertiesResource) UnmarshalJSON(data []byte) er for key, val := range rawMsg { var err error switch key { - case "container": - err = unpopulate(val, "Container", &r.Container) - delete(rawMsg, key) case "eventTimestamp": err = unpopulate(val, "EventTimestamp", &r.EventTimestamp) delete(rawMsg, key) @@ -9707,26 +7274,15 @@ func (r *RestorableSQLContainerPropertiesResource) UnmarshalJSON(data []byte) er return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableSQLContainerPropertiesResourceContainer. -func (r RestorableSQLContainerPropertiesResourceContainer) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RestorableMongodbDatabasesListResult. +func (r RestorableMongodbDatabasesListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "analyticalStorageTtl", r.AnalyticalStorageTTL) - populate(objectMap, "clientEncryptionPolicy", r.ClientEncryptionPolicy) - populate(objectMap, "conflictResolutionPolicy", r.ConflictResolutionPolicy) - populate(objectMap, "defaultTtl", r.DefaultTTL) - populate(objectMap, "_etag", r.Etag) - populate(objectMap, "id", r.ID) - populate(objectMap, "indexingPolicy", r.IndexingPolicy) - populate(objectMap, "partitionKey", r.PartitionKey) - populate(objectMap, "_rid", r.Rid) - populate(objectMap, "_self", r.Self) - populate(objectMap, "_ts", r.Ts) - populate(objectMap, "uniqueKeyPolicy", r.UniqueKeyPolicy) + populate(objectMap, "value", r.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableSQLContainerPropertiesResourceContainer. -func (r *RestorableSQLContainerPropertiesResourceContainer) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableMongodbDatabasesListResult. +func (r *RestorableMongodbDatabasesListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -9734,41 +7290,51 @@ func (r *RestorableSQLContainerPropertiesResourceContainer) UnmarshalJSON(data [ for key, val := range rawMsg { var err error switch key { - case "analyticalStorageTtl": - err = unpopulate(val, "AnalyticalStorageTTL", &r.AnalyticalStorageTTL) - delete(rawMsg, key) - case "clientEncryptionPolicy": - err = unpopulate(val, "ClientEncryptionPolicy", &r.ClientEncryptionPolicy) - delete(rawMsg, key) - case "conflictResolutionPolicy": - err = unpopulate(val, "ConflictResolutionPolicy", &r.ConflictResolutionPolicy) + case "value": + err = unpopulate(val, "Value", &r.Value) delete(rawMsg, key) - case "defaultTtl": - err = unpopulate(val, "DefaultTTL", &r.DefaultTTL) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RestorableMongodbResourcesGetResult. +func (r RestorableMongodbResourcesGetResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "collectionNames", r.CollectionNames) + populate(objectMap, "databaseName", r.DatabaseName) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableMongodbResourcesGetResult. +func (r *RestorableMongodbResourcesGetResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "collectionNames": + err = unpopulate(val, "CollectionNames", &r.CollectionNames) delete(rawMsg, key) - case "_etag": - err = unpopulate(val, "Etag", &r.Etag) + case "databaseName": + err = unpopulate(val, "DatabaseName", &r.DatabaseName) delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &r.ID) delete(rawMsg, key) - case "indexingPolicy": - err = unpopulate(val, "IndexingPolicy", &r.IndexingPolicy) - delete(rawMsg, key) - case "partitionKey": - err = unpopulate(val, "PartitionKey", &r.PartitionKey) - delete(rawMsg, key) - case "_rid": - err = unpopulate(val, "Rid", &r.Rid) - delete(rawMsg, key) - case "_self": - err = unpopulate(val, "Self", &r.Self) - delete(rawMsg, key) - case "_ts": - err = unpopulate(val, "Ts", &r.Ts) + case "name": + err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) - case "uniqueKeyPolicy": - err = unpopulate(val, "UniqueKeyPolicy", &r.UniqueKeyPolicy) + case "type": + err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) } if err != nil { @@ -9778,15 +7344,15 @@ func (r *RestorableSQLContainerPropertiesResourceContainer) UnmarshalJSON(data [ return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableSQLContainersListResult. -func (r RestorableSQLContainersListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RestorableMongodbResourcesListResult. +func (r RestorableMongodbResourcesListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "value", r.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableSQLContainersListResult. -func (r *RestorableSQLContainersListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableMongodbResourcesListResult. +func (r *RestorableMongodbResourcesListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -9805,8 +7371,8 @@ func (r *RestorableSQLContainersListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableSQLDatabaseGetResult. -func (r RestorableSQLDatabaseGetResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RestorableSQLContainerGetResult. +func (r RestorableSQLContainerGetResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", r.ID) populate(objectMap, "name", r.Name) @@ -9815,8 +7381,8 @@ func (r RestorableSQLDatabaseGetResult) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableSQLDatabaseGetResult. -func (r *RestorableSQLDatabaseGetResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableSQLContainerGetResult. +func (r *RestorableSQLContainerGetResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -9844,15 +7410,15 @@ func (r *RestorableSQLDatabaseGetResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableSQLDatabaseProperties. -func (r RestorableSQLDatabaseProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RestorableSQLContainerProperties. +func (r RestorableSQLContainerProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "resource", r.Resource) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableSQLDatabaseProperties. -func (r *RestorableSQLDatabaseProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableSQLContainerProperties. +func (r *RestorableSQLContainerProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -9871,10 +7437,10 @@ func (r *RestorableSQLDatabaseProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableSQLDatabasePropertiesResource. -func (r RestorableSQLDatabasePropertiesResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RestorableSQLContainerPropertiesResource. +func (r RestorableSQLContainerPropertiesResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "database", r.Database) + populate(objectMap, "container", r.Container) populate(objectMap, "eventTimestamp", r.EventTimestamp) populate(objectMap, "operationType", r.OperationType) populate(objectMap, "ownerId", r.OwnerID) @@ -9883,8 +7449,8 @@ func (r RestorableSQLDatabasePropertiesResource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableSQLDatabasePropertiesResource. -func (r *RestorableSQLDatabasePropertiesResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableSQLContainerPropertiesResource. +func (r *RestorableSQLContainerPropertiesResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -9892,8 +7458,8 @@ func (r *RestorableSQLDatabasePropertiesResource) UnmarshalJSON(data []byte) err for key, val := range rawMsg { var err error switch key { - case "database": - err = unpopulate(val, "Database", &r.Database) + case "container": + err = unpopulate(val, "Container", &r.Container) delete(rawMsg, key) case "eventTimestamp": err = unpopulate(val, "EventTimestamp", &r.EventTimestamp) @@ -9918,66 +7484,25 @@ func (r *RestorableSQLDatabasePropertiesResource) UnmarshalJSON(data []byte) err return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableSQLDatabasePropertiesResourceDatabase. -func (r RestorableSQLDatabasePropertiesResourceDatabase) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RestorableSQLContainerPropertiesResourceContainer. +func (r RestorableSQLContainerPropertiesResourceContainer) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "_colls", r.Colls) + populate(objectMap, "analyticalStorageTtl", r.AnalyticalStorageTTL) + populate(objectMap, "conflictResolutionPolicy", r.ConflictResolutionPolicy) + populate(objectMap, "defaultTtl", r.DefaultTTL) populate(objectMap, "_etag", r.Etag) populate(objectMap, "id", r.ID) + populate(objectMap, "indexingPolicy", r.IndexingPolicy) + populate(objectMap, "partitionKey", r.PartitionKey) populate(objectMap, "_rid", r.Rid) populate(objectMap, "_self", r.Self) populate(objectMap, "_ts", r.Ts) - populate(objectMap, "_users", r.Users) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableSQLDatabasePropertiesResourceDatabase. -func (r *RestorableSQLDatabasePropertiesResourceDatabase) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "_colls": - err = unpopulate(val, "Colls", &r.Colls) - delete(rawMsg, key) - case "_etag": - err = unpopulate(val, "Etag", &r.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "_rid": - err = unpopulate(val, "Rid", &r.Rid) - delete(rawMsg, key) - case "_self": - err = unpopulate(val, "Self", &r.Self) - delete(rawMsg, key) - case "_ts": - err = unpopulate(val, "Ts", &r.Ts) - delete(rawMsg, key) - case "_users": - err = unpopulate(val, "Users", &r.Users) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RestorableSQLDatabasesListResult. -func (r RestorableSQLDatabasesListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "value", r.Value) + populate(objectMap, "uniqueKeyPolicy", r.UniqueKeyPolicy) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableSQLDatabasesListResult. -func (r *RestorableSQLDatabasesListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableSQLContainerPropertiesResourceContainer. +func (r *RestorableSQLContainerPropertiesResourceContainer) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -9985,51 +7510,38 @@ func (r *RestorableSQLDatabasesListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &r.Value) + case "analyticalStorageTtl": + err = unpopulate(val, "AnalyticalStorageTTL", &r.AnalyticalStorageTTL) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RestorableSQLResourcesGetResult. -func (r RestorableSQLResourcesGetResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "collectionNames", r.CollectionNames) - populate(objectMap, "databaseName", r.DatabaseName) - populate(objectMap, "id", r.ID) - populate(objectMap, "name", r.Name) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableSQLResourcesGetResult. -func (r *RestorableSQLResourcesGetResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "collectionNames": - err = unpopulate(val, "CollectionNames", &r.CollectionNames) + case "conflictResolutionPolicy": + err = unpopulate(val, "ConflictResolutionPolicy", &r.ConflictResolutionPolicy) delete(rawMsg, key) - case "databaseName": - err = unpopulate(val, "DatabaseName", &r.DatabaseName) + case "defaultTtl": + err = unpopulate(val, "DefaultTTL", &r.DefaultTTL) + delete(rawMsg, key) + case "_etag": + err = unpopulate(val, "Etag", &r.Etag) delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &r.ID) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) + case "indexingPolicy": + err = unpopulate(val, "IndexingPolicy", &r.IndexingPolicy) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) + case "partitionKey": + err = unpopulate(val, "PartitionKey", &r.PartitionKey) + delete(rawMsg, key) + case "_rid": + err = unpopulate(val, "Rid", &r.Rid) + delete(rawMsg, key) + case "_self": + err = unpopulate(val, "Self", &r.Self) + delete(rawMsg, key) + case "_ts": + err = unpopulate(val, "Ts", &r.Ts) + delete(rawMsg, key) + case "uniqueKeyPolicy": + err = unpopulate(val, "UniqueKeyPolicy", &r.UniqueKeyPolicy) delete(rawMsg, key) } if err != nil { @@ -10039,15 +7551,15 @@ func (r *RestorableSQLResourcesGetResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableSQLResourcesListResult. -func (r RestorableSQLResourcesListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RestorableSQLContainersListResult. +func (r RestorableSQLContainersListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "value", r.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableSQLResourcesListResult. -func (r *RestorableSQLResourcesListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableSQLContainersListResult. +func (r *RestorableSQLContainersListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -10066,8 +7578,8 @@ func (r *RestorableSQLResourcesListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableTableGetResult. -func (r RestorableTableGetResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RestorableSQLDatabaseGetResult. +func (r RestorableSQLDatabaseGetResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", r.ID) populate(objectMap, "name", r.Name) @@ -10076,8 +7588,8 @@ func (r RestorableTableGetResult) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableTableGetResult. -func (r *RestorableTableGetResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableSQLDatabaseGetResult. +func (r *RestorableSQLDatabaseGetResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -10105,15 +7617,15 @@ func (r *RestorableTableGetResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableTableProperties. -func (r RestorableTableProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RestorableSQLDatabaseProperties. +func (r RestorableSQLDatabaseProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "resource", r.Resource) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableTableProperties. -func (r *RestorableTableProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableSQLDatabaseProperties. +func (r *RestorableSQLDatabaseProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -10132,9 +7644,10 @@ func (r *RestorableTableProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableTablePropertiesResource. -func (r RestorableTablePropertiesResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RestorableSQLDatabasePropertiesResource. +func (r RestorableSQLDatabasePropertiesResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + populate(objectMap, "database", r.Database) populate(objectMap, "eventTimestamp", r.EventTimestamp) populate(objectMap, "operationType", r.OperationType) populate(objectMap, "ownerId", r.OwnerID) @@ -10143,8 +7656,8 @@ func (r RestorableTablePropertiesResource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableTablePropertiesResource. -func (r *RestorableTablePropertiesResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableSQLDatabasePropertiesResource. +func (r *RestorableSQLDatabasePropertiesResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -10152,6 +7665,9 @@ func (r *RestorableTablePropertiesResource) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "database": + err = unpopulate(val, "Database", &r.Database) + delete(rawMsg, key) case "eventTimestamp": err = unpopulate(val, "EventTimestamp", &r.EventTimestamp) delete(rawMsg, key) @@ -10175,17 +7691,21 @@ func (r *RestorableTablePropertiesResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableTableResourcesGetResult. -func (r RestorableTableResourcesGetResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RestorableSQLDatabasePropertiesResourceDatabase. +func (r RestorableSQLDatabasePropertiesResourceDatabase) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + populate(objectMap, "_colls", r.Colls) + populate(objectMap, "_etag", r.Etag) populate(objectMap, "id", r.ID) - populate(objectMap, "name", r.Name) - populate(objectMap, "type", r.Type) + populate(objectMap, "_rid", r.Rid) + populate(objectMap, "_self", r.Self) + populate(objectMap, "_ts", r.Ts) + populate(objectMap, "_users", r.Users) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableTableResourcesGetResult. -func (r *RestorableTableResourcesGetResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableSQLDatabasePropertiesResourceDatabase. +func (r *RestorableSQLDatabasePropertiesResourceDatabase) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -10193,41 +7713,26 @@ func (r *RestorableTableResourcesGetResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "_colls": + err = unpopulate(val, "Colls", &r.Colls) + delete(rawMsg, key) + case "_etag": + err = unpopulate(val, "Etag", &r.Etag) + delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &r.ID) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) + case "_rid": + err = unpopulate(val, "Rid", &r.Rid) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) + case "_self": + err = unpopulate(val, "Self", &r.Self) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RestorableTableResourcesListResult. -func (r RestorableTableResourcesListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "value", r.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableTableResourcesListResult. -func (r *RestorableTableResourcesListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "value": - err = unpopulate(val, "Value", &r.Value) + case "_ts": + err = unpopulate(val, "Ts", &r.Ts) + delete(rawMsg, key) + case "_users": + err = unpopulate(val, "Users", &r.Users) delete(rawMsg, key) } if err != nil { @@ -10237,15 +7742,15 @@ func (r *RestorableTableResourcesListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RestorableTablesListResult. -func (r RestorableTablesListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RestorableSQLDatabasesListResult. +func (r RestorableSQLDatabasesListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "value", r.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableTablesListResult. -func (r *RestorableTablesListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableSQLDatabasesListResult. +func (r *RestorableSQLDatabasesListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -10264,68 +7769,19 @@ func (r *RestorableTablesListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RestoreParameters. -func (r RestoreParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "databasesToRestore", r.DatabasesToRestore) - populate(objectMap, "gremlinDatabasesToRestore", r.GremlinDatabasesToRestore) - populate(objectMap, "restoreMode", r.RestoreMode) - populate(objectMap, "restoreSource", r.RestoreSource) - populateTimeRFC3339(objectMap, "restoreTimestampInUtc", r.RestoreTimestampInUTC) - populate(objectMap, "tablesToRestore", r.TablesToRestore) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestoreParameters. -func (r *RestoreParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "databasesToRestore": - err = unpopulate(val, "DatabasesToRestore", &r.DatabasesToRestore) - delete(rawMsg, key) - case "gremlinDatabasesToRestore": - err = unpopulate(val, "GremlinDatabasesToRestore", &r.GremlinDatabasesToRestore) - delete(rawMsg, key) - case "restoreMode": - err = unpopulate(val, "RestoreMode", &r.RestoreMode) - delete(rawMsg, key) - case "restoreSource": - err = unpopulate(val, "RestoreSource", &r.RestoreSource) - delete(rawMsg, key) - case "restoreTimestampInUtc": - err = unpopulateTimeRFC3339(val, "RestoreTimestampInUTC", &r.RestoreTimestampInUTC) - delete(rawMsg, key) - case "tablesToRestore": - err = unpopulate(val, "TablesToRestore", &r.TablesToRestore) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RetrieveThroughputParameters. -func (r RetrieveThroughputParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RestorableSQLResourcesGetResult. +func (r RestorableSQLResourcesGetResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + populate(objectMap, "collectionNames", r.CollectionNames) + populate(objectMap, "databaseName", r.DatabaseName) populate(objectMap, "id", r.ID) - populate(objectMap, "identity", r.Identity) - populate(objectMap, "location", r.Location) populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "tags", r.Tags) populate(objectMap, "type", r.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RetrieveThroughputParameters. -func (r *RetrieveThroughputParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableSQLResourcesGetResult. +func (r *RestorableSQLResourcesGetResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -10333,24 +7789,18 @@ func (r *RetrieveThroughputParameters) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) + case "collectionNames": + err = unpopulate(val, "CollectionNames", &r.CollectionNames) delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &r.Identity) + case "databaseName": + err = unpopulate(val, "DatabaseName", &r.DatabaseName) delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &r.Location) + case "id": + err = unpopulate(val, "ID", &r.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &r.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &r.Tags) - delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) @@ -10362,15 +7812,15 @@ func (r *RetrieveThroughputParameters) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RetrieveThroughputProperties. -func (r RetrieveThroughputProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RestorableSQLResourcesListResult. +func (r RestorableSQLResourcesListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "resource", r.Resource) + populate(objectMap, "value", r.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RetrieveThroughputProperties. -func (r *RetrieveThroughputProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableSQLResourcesListResult. +func (r *RestorableSQLResourcesListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -10378,8 +7828,8 @@ func (r *RetrieveThroughputProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "resource": - err = unpopulate(val, "Resource", &r.Resource) + case "value": + err = unpopulate(val, "Value", &r.Value) delete(rawMsg, key) } if err != nil { @@ -10389,15 +7839,18 @@ func (r *RetrieveThroughputProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RetrieveThroughputPropertiesResource. -func (r RetrieveThroughputPropertiesResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RestoreParameters. +func (r RestoreParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "physicalPartitionIds", r.PhysicalPartitionIDs) + populate(objectMap, "databasesToRestore", r.DatabasesToRestore) + populate(objectMap, "restoreMode", r.RestoreMode) + populate(objectMap, "restoreSource", r.RestoreSource) + populateTimeRFC3339(objectMap, "restoreTimestampInUtc", r.RestoreTimestampInUTC) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RetrieveThroughputPropertiesResource. -func (r *RetrieveThroughputPropertiesResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RestoreParameters. +func (r *RestoreParameters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -10405,8 +7858,17 @@ func (r *RetrieveThroughputPropertiesResource) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { - case "physicalPartitionIds": - err = unpopulate(val, "PhysicalPartitionIDs", &r.PhysicalPartitionIDs) + case "databasesToRestore": + err = unpopulate(val, "DatabasesToRestore", &r.DatabasesToRestore) + delete(rawMsg, key) + case "restoreMode": + err = unpopulate(val, "RestoreMode", &r.RestoreMode) + delete(rawMsg, key) + case "restoreSource": + err = unpopulate(val, "RestoreSource", &r.RestoreSource) + delete(rawMsg, key) + case "restoreTimestampInUtc": + err = unpopulateTimeRFC3339(val, "RestoreTimestampInUTC", &r.RestoreTimestampInUTC) delete(rawMsg, key) } if err != nil { @@ -10451,7 +7913,6 @@ func (r *Role) UnmarshalJSON(data []byte) error { func (s SQLContainerCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", s.ID) - populate(objectMap, "identity", s.Identity) populate(objectMap, "location", s.Location) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) @@ -10472,9 +7933,6 @@ func (s *SQLContainerCreateUpdateParameters) UnmarshalJSON(data []byte) error { case "id": err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &s.Identity) - delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &s.Location) delete(rawMsg, key) @@ -10595,7 +8053,6 @@ func (s *SQLContainerGetPropertiesOptions) UnmarshalJSON(data []byte) error { func (s SQLContainerGetPropertiesResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "analyticalStorageTtl", s.AnalyticalStorageTTL) - populate(objectMap, "clientEncryptionPolicy", s.ClientEncryptionPolicy) populate(objectMap, "conflictResolutionPolicy", s.ConflictResolutionPolicy) populate(objectMap, "defaultTtl", s.DefaultTTL) populate(objectMap, "_etag", s.Etag) @@ -10620,9 +8077,6 @@ func (s *SQLContainerGetPropertiesResource) UnmarshalJSON(data []byte) error { case "analyticalStorageTtl": err = unpopulate(val, "AnalyticalStorageTTL", &s.AnalyticalStorageTTL) delete(rawMsg, key) - case "clientEncryptionPolicy": - err = unpopulate(val, "ClientEncryptionPolicy", &s.ClientEncryptionPolicy) - delete(rawMsg, key) case "conflictResolutionPolicy": err = unpopulate(val, "ConflictResolutionPolicy", &s.ConflictResolutionPolicy) delete(rawMsg, key) @@ -10662,7 +8116,6 @@ func (s *SQLContainerGetPropertiesResource) UnmarshalJSON(data []byte) error { func (s SQLContainerGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", s.ID) - populate(objectMap, "identity", s.Identity) populate(objectMap, "location", s.Location) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) @@ -10683,9 +8136,6 @@ func (s *SQLContainerGetResults) UnmarshalJSON(data []byte) error { case "id": err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &s.Identity) - delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &s.Location) delete(rawMsg, key) @@ -10740,7 +8190,6 @@ func (s *SQLContainerListResult) UnmarshalJSON(data []byte) error { func (s SQLContainerResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "analyticalStorageTtl", s.AnalyticalStorageTTL) - populate(objectMap, "clientEncryptionPolicy", s.ClientEncryptionPolicy) populate(objectMap, "conflictResolutionPolicy", s.ConflictResolutionPolicy) populate(objectMap, "defaultTtl", s.DefaultTTL) populate(objectMap, "id", s.ID) @@ -10762,9 +8211,6 @@ func (s *SQLContainerResource) UnmarshalJSON(data []byte) error { case "analyticalStorageTtl": err = unpopulate(val, "AnalyticalStorageTTL", &s.AnalyticalStorageTTL) delete(rawMsg, key) - case "clientEncryptionPolicy": - err = unpopulate(val, "ClientEncryptionPolicy", &s.ClientEncryptionPolicy) - delete(rawMsg, key) case "conflictResolutionPolicy": err = unpopulate(val, "ConflictResolutionPolicy", &s.ConflictResolutionPolicy) delete(rawMsg, key) @@ -10791,46 +8237,10 @@ func (s *SQLContainerResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SQLDataTransferDataSourceSink. -func (s SQLDataTransferDataSourceSink) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["component"] = DataTransferComponentCosmosDBSQL - populate(objectMap, "containerName", s.ContainerName) - populate(objectMap, "databaseName", s.DatabaseName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SQLDataTransferDataSourceSink. -func (s *SQLDataTransferDataSourceSink) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "component": - err = unpopulate(val, "Component", &s.Component) - delete(rawMsg, key) - case "containerName": - err = unpopulate(val, "ContainerName", &s.ContainerName) - delete(rawMsg, key) - case "databaseName": - err = unpopulate(val, "DatabaseName", &s.DatabaseName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type SQLDatabaseCreateUpdateParameters. func (s SQLDatabaseCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", s.ID) - populate(objectMap, "identity", s.Identity) populate(objectMap, "location", s.Location) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) @@ -10851,9 +8261,6 @@ func (s *SQLDatabaseCreateUpdateParameters) UnmarshalJSON(data []byte) error { case "id": err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &s.Identity) - delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &s.Location) delete(rawMsg, key) @@ -11021,7 +8428,6 @@ func (s *SQLDatabaseGetPropertiesResource) UnmarshalJSON(data []byte) error { func (s SQLDatabaseGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", s.ID) - populate(objectMap, "identity", s.Identity) populate(objectMap, "location", s.Location) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) @@ -11042,9 +8448,6 @@ func (s *SQLDatabaseGetResults) UnmarshalJSON(data []byte) error { case "id": err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &s.Identity) - delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &s.Location) delete(rawMsg, key) @@ -11518,7 +8921,6 @@ func (s *SQLRoleDefinitionResource) UnmarshalJSON(data []byte) error { func (s SQLStoredProcedureCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", s.ID) - populate(objectMap, "identity", s.Identity) populate(objectMap, "location", s.Location) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) @@ -11539,9 +8941,6 @@ func (s *SQLStoredProcedureCreateUpdateParameters) UnmarshalJSON(data []byte) er case "id": err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &s.Identity) - delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &s.Location) delete(rawMsg, key) @@ -11670,7 +9069,6 @@ func (s *SQLStoredProcedureGetPropertiesResource) UnmarshalJSON(data []byte) err func (s SQLStoredProcedureGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", s.ID) - populate(objectMap, "identity", s.Identity) populate(objectMap, "location", s.Location) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) @@ -11691,9 +9089,6 @@ func (s *SQLStoredProcedureGetResults) UnmarshalJSON(data []byte) error { case "id": err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &s.Identity) - delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &s.Location) delete(rawMsg, key) @@ -11779,7 +9174,6 @@ func (s *SQLStoredProcedureResource) UnmarshalJSON(data []byte) error { func (s SQLTriggerCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", s.ID) - populate(objectMap, "identity", s.Identity) populate(objectMap, "location", s.Location) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) @@ -11800,9 +9194,6 @@ func (s *SQLTriggerCreateUpdateParameters) UnmarshalJSON(data []byte) error { case "id": err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &s.Identity) - delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &s.Location) delete(rawMsg, key) @@ -11939,7 +9330,6 @@ func (s *SQLTriggerGetPropertiesResource) UnmarshalJSON(data []byte) error { func (s SQLTriggerGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", s.ID) - populate(objectMap, "identity", s.Identity) populate(objectMap, "location", s.Location) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) @@ -11960,9 +9350,6 @@ func (s *SQLTriggerGetResults) UnmarshalJSON(data []byte) error { case "id": err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &s.Identity) - delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &s.Location) delete(rawMsg, key) @@ -12056,7 +9443,6 @@ func (s *SQLTriggerResource) UnmarshalJSON(data []byte) error { func (s SQLUserDefinedFunctionCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", s.ID) - populate(objectMap, "identity", s.Identity) populate(objectMap, "location", s.Location) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) @@ -12077,9 +9463,6 @@ func (s *SQLUserDefinedFunctionCreateUpdateParameters) UnmarshalJSON(data []byte case "id": err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &s.Identity) - delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &s.Location) delete(rawMsg, key) @@ -12208,7 +9591,6 @@ func (s *SQLUserDefinedFunctionGetPropertiesResource) UnmarshalJSON(data []byte) func (s SQLUserDefinedFunctionGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", s.ID) - populate(objectMap, "identity", s.Identity) populate(objectMap, "location", s.Location) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) @@ -12229,9 +9611,6 @@ func (s *SQLUserDefinedFunctionGetResults) UnmarshalJSON(data []byte) error { case "id": err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &s.Identity) - delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &s.Location) delete(rawMsg, key) @@ -12608,7 +9987,6 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { func (t TableCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", t.ID) - populate(objectMap, "identity", t.Identity) populate(objectMap, "location", t.Location) populate(objectMap, "name", t.Name) populate(objectMap, "properties", t.Properties) @@ -12629,9 +10007,6 @@ func (t *TableCreateUpdateParameters) UnmarshalJSON(data []byte) error { case "id": err = unpopulate(val, "ID", &t.ID) delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &t.Identity) - delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &t.Location) delete(rawMsg, key) @@ -12791,7 +10166,6 @@ func (t *TableGetPropertiesResource) UnmarshalJSON(data []byte) error { func (t TableGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", t.ID) - populate(objectMap, "identity", t.Identity) populate(objectMap, "location", t.Location) populate(objectMap, "name", t.Name) populate(objectMap, "properties", t.Properties) @@ -12812,9 +10186,6 @@ func (t *TableGetResults) UnmarshalJSON(data []byte) error { case "id": err = unpopulate(val, "ID", &t.ID) delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &t.Identity) - delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &t.Location) delete(rawMsg, key) @@ -13005,7 +10376,6 @@ func (t *ThroughputSettingsGetPropertiesResource) UnmarshalJSON(data []byte) err func (t ThroughputSettingsGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", t.ID) - populate(objectMap, "identity", t.Identity) populate(objectMap, "location", t.Location) populate(objectMap, "name", t.Name) populate(objectMap, "properties", t.Properties) @@ -13026,9 +10396,6 @@ func (t *ThroughputSettingsGetResults) UnmarshalJSON(data []byte) error { case "id": err = unpopulate(val, "ID", &t.ID) delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &t.Identity) - delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &t.Location) delete(rawMsg, key) @@ -13095,7 +10462,6 @@ func (t *ThroughputSettingsResource) UnmarshalJSON(data []byte) error { func (t ThroughputSettingsUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", t.ID) - populate(objectMap, "identity", t.Identity) populate(objectMap, "location", t.Location) populate(objectMap, "name", t.Name) populate(objectMap, "properties", t.Properties) @@ -13116,9 +10482,6 @@ func (t *ThroughputSettingsUpdateParameters) UnmarshalJSON(data []byte) error { case "id": err = unpopulate(val, "ID", &t.ID) delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &t.Identity) - delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &t.Location) delete(rawMsg, key) @@ -13334,16 +10697,6 @@ func populate(m map[string]interface{}, k string, v interface{}) { } } -func populateByteArray(m map[string]interface{}, k string, b []byte, f runtime.Base64Encoding) { - if azcore.IsNullValue(b) { - m[k] = nil - } else if len(b) == 0 { - return - } else { - m[k] = runtime.EncodeByteArray(b, f) - } -} - func unpopulate(data json.RawMessage, fn string, v interface{}) error { if data == nil { return nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/mongodbresources_client.go b/sdk/resourcemanager/cosmos/armcosmos/mongodbresources_client.go index af2d646c9778..f39583bb1949 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/mongodbresources_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/mongodbresources_client.go @@ -57,7 +57,7 @@ func NewMongoDBResourcesClient(subscriptionID string, credential azcore.TokenCre // BeginCreateUpdateMongoDBCollection - Create or update an Azure Cosmos DB MongoDB Collection // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -79,7 +79,7 @@ func (client *MongoDBResourcesClient) BeginCreateUpdateMongoDBCollection(ctx con // CreateUpdateMongoDBCollection - Create or update an Azure Cosmos DB MongoDB Collection // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *MongoDBResourcesClient) createUpdateMongoDBCollection(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, createUpdateMongoDBCollectionParameters MongoDBCollectionCreateUpdateParameters, options *MongoDBResourcesClientBeginCreateUpdateMongoDBCollectionOptions) (*http.Response, error) { req, err := client.createUpdateMongoDBCollectionCreateRequest(ctx, resourceGroupName, accountName, databaseName, collectionName, createUpdateMongoDBCollectionParameters, options) if err != nil { @@ -123,7 +123,7 @@ func (client *MongoDBResourcesClient) createUpdateMongoDBCollectionCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, createUpdateMongoDBCollectionParameters) @@ -131,7 +131,7 @@ func (client *MongoDBResourcesClient) createUpdateMongoDBCollectionCreateRequest // BeginCreateUpdateMongoDBDatabase - Create or updates Azure Cosmos DB MongoDB database // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -152,7 +152,7 @@ func (client *MongoDBResourcesClient) BeginCreateUpdateMongoDBDatabase(ctx conte // CreateUpdateMongoDBDatabase - Create or updates Azure Cosmos DB MongoDB database // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *MongoDBResourcesClient) createUpdateMongoDBDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string, createUpdateMongoDBDatabaseParameters MongoDBDatabaseCreateUpdateParameters, options *MongoDBResourcesClientBeginCreateUpdateMongoDBDatabaseOptions) (*http.Response, error) { req, err := client.createUpdateMongoDBDatabaseCreateRequest(ctx, resourceGroupName, accountName, databaseName, createUpdateMongoDBDatabaseParameters, options) if err != nil { @@ -192,7 +192,7 @@ func (client *MongoDBResourcesClient) createUpdateMongoDBDatabaseCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, createUpdateMongoDBDatabaseParameters) @@ -200,7 +200,7 @@ func (client *MongoDBResourcesClient) createUpdateMongoDBDatabaseCreateRequest(c // BeginCreateUpdateMongoRoleDefinition - Creates or updates an Azure Cosmos DB Mongo Role Definition. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // mongoRoleDefinitionID - The ID for the Role Definition {dbName.roleName}. // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. @@ -221,7 +221,7 @@ func (client *MongoDBResourcesClient) BeginCreateUpdateMongoRoleDefinition(ctx c // CreateUpdateMongoRoleDefinition - Creates or updates an Azure Cosmos DB Mongo Role Definition. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *MongoDBResourcesClient) createUpdateMongoRoleDefinition(ctx context.Context, mongoRoleDefinitionID string, resourceGroupName string, accountName string, createUpdateMongoRoleDefinitionParameters MongoRoleDefinitionCreateUpdateParameters, options *MongoDBResourcesClientBeginCreateUpdateMongoRoleDefinitionOptions) (*http.Response, error) { req, err := client.createUpdateMongoRoleDefinitionCreateRequest(ctx, mongoRoleDefinitionID, resourceGroupName, accountName, createUpdateMongoRoleDefinitionParameters, options) if err != nil { @@ -261,7 +261,7 @@ func (client *MongoDBResourcesClient) createUpdateMongoRoleDefinitionCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, createUpdateMongoRoleDefinitionParameters) @@ -269,7 +269,7 @@ func (client *MongoDBResourcesClient) createUpdateMongoRoleDefinitionCreateReque // BeginCreateUpdateMongoUserDefinition - Creates or updates an Azure Cosmos DB Mongo User Definition. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // mongoUserDefinitionID - The ID for the User Definition {dbName.userName}. // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. @@ -290,7 +290,7 @@ func (client *MongoDBResourcesClient) BeginCreateUpdateMongoUserDefinition(ctx c // CreateUpdateMongoUserDefinition - Creates or updates an Azure Cosmos DB Mongo User Definition. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *MongoDBResourcesClient) createUpdateMongoUserDefinition(ctx context.Context, mongoUserDefinitionID string, resourceGroupName string, accountName string, createUpdateMongoUserDefinitionParameters MongoUserDefinitionCreateUpdateParameters, options *MongoDBResourcesClientBeginCreateUpdateMongoUserDefinitionOptions) (*http.Response, error) { req, err := client.createUpdateMongoUserDefinitionCreateRequest(ctx, mongoUserDefinitionID, resourceGroupName, accountName, createUpdateMongoUserDefinitionParameters, options) if err != nil { @@ -330,7 +330,7 @@ func (client *MongoDBResourcesClient) createUpdateMongoUserDefinitionCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, createUpdateMongoUserDefinitionParameters) @@ -338,7 +338,7 @@ func (client *MongoDBResourcesClient) createUpdateMongoUserDefinitionCreateReque // BeginDeleteMongoDBCollection - Deletes an existing Azure Cosmos DB MongoDB Collection. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -359,7 +359,7 @@ func (client *MongoDBResourcesClient) BeginDeleteMongoDBCollection(ctx context.C // DeleteMongoDBCollection - Deletes an existing Azure Cosmos DB MongoDB Collection. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *MongoDBResourcesClient) deleteMongoDBCollection(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, options *MongoDBResourcesClientBeginDeleteMongoDBCollectionOptions) (*http.Response, error) { req, err := client.deleteMongoDBCollectionCreateRequest(ctx, resourceGroupName, accountName, databaseName, collectionName, options) if err != nil { @@ -403,14 +403,14 @@ func (client *MongoDBResourcesClient) deleteMongoDBCollectionCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // BeginDeleteMongoDBDatabase - Deletes an existing Azure Cosmos DB MongoDB database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -430,7 +430,7 @@ func (client *MongoDBResourcesClient) BeginDeleteMongoDBDatabase(ctx context.Con // DeleteMongoDBDatabase - Deletes an existing Azure Cosmos DB MongoDB database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *MongoDBResourcesClient) deleteMongoDBDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *MongoDBResourcesClientBeginDeleteMongoDBDatabaseOptions) (*http.Response, error) { req, err := client.deleteMongoDBDatabaseCreateRequest(ctx, resourceGroupName, accountName, databaseName, options) if err != nil { @@ -470,14 +470,14 @@ func (client *MongoDBResourcesClient) deleteMongoDBDatabaseCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // BeginDeleteMongoRoleDefinition - Deletes an existing Azure Cosmos DB Mongo Role Definition. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // mongoRoleDefinitionID - The ID for the Role Definition {dbName.roleName}. // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. @@ -497,7 +497,7 @@ func (client *MongoDBResourcesClient) BeginDeleteMongoRoleDefinition(ctx context // DeleteMongoRoleDefinition - Deletes an existing Azure Cosmos DB Mongo Role Definition. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *MongoDBResourcesClient) deleteMongoRoleDefinition(ctx context.Context, mongoRoleDefinitionID string, resourceGroupName string, accountName string, options *MongoDBResourcesClientBeginDeleteMongoRoleDefinitionOptions) (*http.Response, error) { req, err := client.deleteMongoRoleDefinitionCreateRequest(ctx, mongoRoleDefinitionID, resourceGroupName, accountName, options) if err != nil { @@ -537,7 +537,7 @@ func (client *MongoDBResourcesClient) deleteMongoRoleDefinitionCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -545,7 +545,7 @@ func (client *MongoDBResourcesClient) deleteMongoRoleDefinitionCreateRequest(ctx // BeginDeleteMongoUserDefinition - Deletes an existing Azure Cosmos DB Mongo User Definition. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // mongoUserDefinitionID - The ID for the User Definition {dbName.userName}. // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. @@ -565,7 +565,7 @@ func (client *MongoDBResourcesClient) BeginDeleteMongoUserDefinition(ctx context // DeleteMongoUserDefinition - Deletes an existing Azure Cosmos DB Mongo User Definition. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *MongoDBResourcesClient) deleteMongoUserDefinition(ctx context.Context, mongoUserDefinitionID string, resourceGroupName string, accountName string, options *MongoDBResourcesClientBeginDeleteMongoUserDefinitionOptions) (*http.Response, error) { req, err := client.deleteMongoUserDefinitionCreateRequest(ctx, mongoUserDefinitionID, resourceGroupName, accountName, options) if err != nil { @@ -605,7 +605,7 @@ func (client *MongoDBResourcesClient) deleteMongoUserDefinitionCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -613,7 +613,7 @@ func (client *MongoDBResourcesClient) deleteMongoUserDefinitionCreateRequest(ctx // GetMongoDBCollection - Gets the MongoDB collection under an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -663,7 +663,7 @@ func (client *MongoDBResourcesClient) getMongoDBCollectionCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -681,7 +681,7 @@ func (client *MongoDBResourcesClient) getMongoDBCollectionHandleResponse(resp *h // GetMongoDBCollectionThroughput - Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database // account with the provided name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -731,7 +731,7 @@ func (client *MongoDBResourcesClient) getMongoDBCollectionThroughputCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -748,7 +748,7 @@ func (client *MongoDBResourcesClient) getMongoDBCollectionThroughputHandleRespon // GetMongoDBDatabase - Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -793,7 +793,7 @@ func (client *MongoDBResourcesClient) getMongoDBDatabaseCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -811,7 +811,7 @@ func (client *MongoDBResourcesClient) getMongoDBDatabaseHandleResponse(resp *htt // GetMongoDBDatabaseThroughput - Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database // account with the provided name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -856,7 +856,7 @@ func (client *MongoDBResourcesClient) getMongoDBDatabaseThroughputCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -873,7 +873,7 @@ func (client *MongoDBResourcesClient) getMongoDBDatabaseThroughputHandleResponse // GetMongoRoleDefinition - Retrieves the properties of an existing Azure Cosmos DB Mongo Role Definition with the given Id. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // mongoRoleDefinitionID - The ID for the Role Definition {dbName.roleName}. // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. @@ -918,7 +918,7 @@ func (client *MongoDBResourcesClient) getMongoRoleDefinitionCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -935,7 +935,7 @@ func (client *MongoDBResourcesClient) getMongoRoleDefinitionHandleResponse(resp // GetMongoUserDefinition - Retrieves the properties of an existing Azure Cosmos DB Mongo User Definition with the given Id. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // mongoUserDefinitionID - The ID for the User Definition {dbName.userName}. // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. @@ -980,7 +980,7 @@ func (client *MongoDBResourcesClient) getMongoUserDefinitionCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -995,85 +995,9 @@ func (client *MongoDBResourcesClient) getMongoUserDefinitionHandleResponse(resp return result, nil } -// BeginListMongoDBCollectionPartitionMerge - Merges the partitions of a MongoDB Collection -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// accountName - Cosmos DB database account name. -// databaseName - Cosmos DB database name. -// collectionName - Cosmos DB collection name. -// mergeParameters - The parameters for the merge operation. -// options - MongoDBResourcesClientBeginListMongoDBCollectionPartitionMergeOptions contains the optional parameters for the -// MongoDBResourcesClient.BeginListMongoDBCollectionPartitionMerge method. -func (client *MongoDBResourcesClient) BeginListMongoDBCollectionPartitionMerge(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, mergeParameters MergeParameters, options *MongoDBResourcesClientBeginListMongoDBCollectionPartitionMergeOptions) (*runtime.Poller[MongoDBResourcesClientListMongoDBCollectionPartitionMergeResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.listMongoDBCollectionPartitionMerge(ctx, resourceGroupName, accountName, databaseName, collectionName, mergeParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[MongoDBResourcesClientListMongoDBCollectionPartitionMergeResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[MongoDBResourcesClientListMongoDBCollectionPartitionMergeResponse](options.ResumeToken, client.pl, nil) - } -} - -// ListMongoDBCollectionPartitionMerge - Merges the partitions of a MongoDB Collection -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -func (client *MongoDBResourcesClient) listMongoDBCollectionPartitionMerge(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, mergeParameters MergeParameters, options *MongoDBResourcesClientBeginListMongoDBCollectionPartitionMergeOptions) (*http.Response, error) { - req, err := client.listMongoDBCollectionPartitionMergeCreateRequest(ctx, resourceGroupName, accountName, databaseName, collectionName, mergeParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// listMongoDBCollectionPartitionMergeCreateRequest creates the ListMongoDBCollectionPartitionMerge request. -func (client *MongoDBResourcesClient) listMongoDBCollectionPartitionMergeCreateRequest(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, mergeParameters MergeParameters, options *MongoDBResourcesClientBeginListMongoDBCollectionPartitionMergeOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/partitionMerge" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - if databaseName == "" { - return nil, errors.New("parameter databaseName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) - if collectionName == "" { - return nil, errors.New("parameter collectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{collectionName}", url.PathEscape(collectionName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, mergeParameters) -} - // NewListMongoDBCollectionsPager - Lists the MongoDB collection under an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -1125,7 +1049,7 @@ func (client *MongoDBResourcesClient) listMongoDBCollectionsCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1142,7 +1066,7 @@ func (client *MongoDBResourcesClient) listMongoDBCollectionsHandleResponse(resp // NewListMongoDBDatabasesPager - Lists the MongoDB databases under an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // options - MongoDBResourcesClientListMongoDBDatabasesOptions contains the optional parameters for the MongoDBResourcesClient.ListMongoDBDatabases @@ -1189,7 +1113,7 @@ func (client *MongoDBResourcesClient) listMongoDBDatabasesCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1206,7 +1130,7 @@ func (client *MongoDBResourcesClient) listMongoDBDatabasesHandleResponse(resp *h // NewListMongoRoleDefinitionsPager - Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // options - MongoDBResourcesClientListMongoRoleDefinitionsOptions contains the optional parameters for the MongoDBResourcesClient.ListMongoRoleDefinitions @@ -1253,7 +1177,7 @@ func (client *MongoDBResourcesClient) listMongoRoleDefinitionsCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1270,7 +1194,7 @@ func (client *MongoDBResourcesClient) listMongoRoleDefinitionsHandleResponse(res // NewListMongoUserDefinitionsPager - Retrieves the list of all Azure Cosmos DB Mongo User Definition. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // options - MongoDBResourcesClientListMongoUserDefinitionsOptions contains the optional parameters for the MongoDBResourcesClient.ListMongoUserDefinitions @@ -1317,7 +1241,7 @@ func (client *MongoDBResourcesClient) listMongoUserDefinitionsCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1334,7 +1258,7 @@ func (client *MongoDBResourcesClient) listMongoUserDefinitionsHandleResponse(res // BeginMigrateMongoDBCollectionToAutoscale - Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -1355,7 +1279,7 @@ func (client *MongoDBResourcesClient) BeginMigrateMongoDBCollectionToAutoscale(c // MigrateMongoDBCollectionToAutoscale - Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *MongoDBResourcesClient) migrateMongoDBCollectionToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, options *MongoDBResourcesClientBeginMigrateMongoDBCollectionToAutoscaleOptions) (*http.Response, error) { req, err := client.migrateMongoDBCollectionToAutoscaleCreateRequest(ctx, resourceGroupName, accountName, databaseName, collectionName, options) if err != nil { @@ -1399,7 +1323,7 @@ func (client *MongoDBResourcesClient) migrateMongoDBCollectionToAutoscaleCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1408,7 +1332,7 @@ func (client *MongoDBResourcesClient) migrateMongoDBCollectionToAutoscaleCreateR // BeginMigrateMongoDBCollectionToManualThroughput - Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual // throughput // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -1429,7 +1353,7 @@ func (client *MongoDBResourcesClient) BeginMigrateMongoDBCollectionToManualThrou // MigrateMongoDBCollectionToManualThroughput - Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *MongoDBResourcesClient) migrateMongoDBCollectionToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, options *MongoDBResourcesClientBeginMigrateMongoDBCollectionToManualThroughputOptions) (*http.Response, error) { req, err := client.migrateMongoDBCollectionToManualThroughputCreateRequest(ctx, resourceGroupName, accountName, databaseName, collectionName, options) if err != nil { @@ -1473,7 +1397,7 @@ func (client *MongoDBResourcesClient) migrateMongoDBCollectionToManualThroughput return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1481,7 +1405,7 @@ func (client *MongoDBResourcesClient) migrateMongoDBCollectionToManualThroughput // BeginMigrateMongoDBDatabaseToAutoscale - Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -1501,7 +1425,7 @@ func (client *MongoDBResourcesClient) BeginMigrateMongoDBDatabaseToAutoscale(ctx // MigrateMongoDBDatabaseToAutoscale - Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *MongoDBResourcesClient) migrateMongoDBDatabaseToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *MongoDBResourcesClientBeginMigrateMongoDBDatabaseToAutoscaleOptions) (*http.Response, error) { req, err := client.migrateMongoDBDatabaseToAutoscaleCreateRequest(ctx, resourceGroupName, accountName, databaseName, options) if err != nil { @@ -1541,7 +1465,7 @@ func (client *MongoDBResourcesClient) migrateMongoDBDatabaseToAutoscaleCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1549,7 +1473,7 @@ func (client *MongoDBResourcesClient) migrateMongoDBDatabaseToAutoscaleCreateReq // BeginMigrateMongoDBDatabaseToManualThroughput - Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -1569,7 +1493,7 @@ func (client *MongoDBResourcesClient) BeginMigrateMongoDBDatabaseToManualThrough // MigrateMongoDBDatabaseToManualThroughput - Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *MongoDBResourcesClient) migrateMongoDBDatabaseToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *MongoDBResourcesClientBeginMigrateMongoDBDatabaseToManualThroughputOptions) (*http.Response, error) { req, err := client.migrateMongoDBDatabaseToManualThroughputCreateRequest(ctx, resourceGroupName, accountName, databaseName, options) if err != nil { @@ -1609,168 +1533,15 @@ func (client *MongoDBResourcesClient) migrateMongoDBDatabaseToManualThroughputCr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// BeginMongoDBContainerRedistributeThroughput - Redistribute throughput for an Azure Cosmos DB MongoDB container -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// accountName - Cosmos DB database account name. -// databaseName - Cosmos DB database name. -// collectionName - Cosmos DB collection name. -// redistributeThroughputParameters - The parameters to provide for redistributing throughput for the current MongoDB container. -// options - MongoDBResourcesClientBeginMongoDBContainerRedistributeThroughputOptions contains the optional parameters for -// the MongoDBResourcesClient.BeginMongoDBContainerRedistributeThroughput method. -func (client *MongoDBResourcesClient) BeginMongoDBContainerRedistributeThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, redistributeThroughputParameters RedistributeThroughputParameters, options *MongoDBResourcesClientBeginMongoDBContainerRedistributeThroughputOptions) (*runtime.Poller[MongoDBResourcesClientMongoDBContainerRedistributeThroughputResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.mongoDBContainerRedistributeThroughput(ctx, resourceGroupName, accountName, databaseName, collectionName, redistributeThroughputParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[MongoDBResourcesClientMongoDBContainerRedistributeThroughputResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[MongoDBResourcesClientMongoDBContainerRedistributeThroughputResponse](options.ResumeToken, client.pl, nil) - } -} - -// MongoDBContainerRedistributeThroughput - Redistribute throughput for an Azure Cosmos DB MongoDB container -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -func (client *MongoDBResourcesClient) mongoDBContainerRedistributeThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, redistributeThroughputParameters RedistributeThroughputParameters, options *MongoDBResourcesClientBeginMongoDBContainerRedistributeThroughputOptions) (*http.Response, error) { - req, err := client.mongoDBContainerRedistributeThroughputCreateRequest(ctx, resourceGroupName, accountName, databaseName, collectionName, redistributeThroughputParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// mongoDBContainerRedistributeThroughputCreateRequest creates the MongoDBContainerRedistributeThroughput request. -func (client *MongoDBResourcesClient) mongoDBContainerRedistributeThroughputCreateRequest(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, redistributeThroughputParameters RedistributeThroughputParameters, options *MongoDBResourcesClientBeginMongoDBContainerRedistributeThroughputOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/redistributeThroughput" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - if databaseName == "" { - return nil, errors.New("parameter databaseName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) - if collectionName == "" { - return nil, errors.New("parameter collectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{collectionName}", url.PathEscape(collectionName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, redistributeThroughputParameters) -} - -// BeginMongoDBContainerRetrieveThroughputDistribution - Retrieve throughput distribution for an Azure Cosmos DB MongoDB container -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// accountName - Cosmos DB database account name. -// databaseName - Cosmos DB database name. -// collectionName - Cosmos DB collection name. -// retrieveThroughputParameters - The parameters to provide for retrieving throughput distribution for the current MongoDB -// container. -// options - MongoDBResourcesClientBeginMongoDBContainerRetrieveThroughputDistributionOptions contains the optional parameters -// for the MongoDBResourcesClient.BeginMongoDBContainerRetrieveThroughputDistribution method. -func (client *MongoDBResourcesClient) BeginMongoDBContainerRetrieveThroughputDistribution(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, retrieveThroughputParameters RetrieveThroughputParameters, options *MongoDBResourcesClientBeginMongoDBContainerRetrieveThroughputDistributionOptions) (*runtime.Poller[MongoDBResourcesClientMongoDBContainerRetrieveThroughputDistributionResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.mongoDBContainerRetrieveThroughputDistribution(ctx, resourceGroupName, accountName, databaseName, collectionName, retrieveThroughputParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[MongoDBResourcesClientMongoDBContainerRetrieveThroughputDistributionResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[MongoDBResourcesClientMongoDBContainerRetrieveThroughputDistributionResponse](options.ResumeToken, client.pl, nil) - } -} - -// MongoDBContainerRetrieveThroughputDistribution - Retrieve throughput distribution for an Azure Cosmos DB MongoDB container -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -func (client *MongoDBResourcesClient) mongoDBContainerRetrieveThroughputDistribution(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, retrieveThroughputParameters RetrieveThroughputParameters, options *MongoDBResourcesClientBeginMongoDBContainerRetrieveThroughputDistributionOptions) (*http.Response, error) { - req, err := client.mongoDBContainerRetrieveThroughputDistributionCreateRequest(ctx, resourceGroupName, accountName, databaseName, collectionName, retrieveThroughputParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// mongoDBContainerRetrieveThroughputDistributionCreateRequest creates the MongoDBContainerRetrieveThroughputDistribution request. -func (client *MongoDBResourcesClient) mongoDBContainerRetrieveThroughputDistributionCreateRequest(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, retrieveThroughputParameters RetrieveThroughputParameters, options *MongoDBResourcesClientBeginMongoDBContainerRetrieveThroughputDistributionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/retrieveThroughputDistribution" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - if databaseName == "" { - return nil, errors.New("parameter databaseName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) - if collectionName == "" { - return nil, errors.New("parameter collectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{collectionName}", url.PathEscape(collectionName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, retrieveThroughputParameters) -} - // BeginRetrieveContinuousBackupInformation - Retrieves continuous backup information for a Mongodb collection. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -1794,7 +1565,7 @@ func (client *MongoDBResourcesClient) BeginRetrieveContinuousBackupInformation(c // RetrieveContinuousBackupInformation - Retrieves continuous backup information for a Mongodb collection. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *MongoDBResourcesClient) retrieveContinuousBackupInformation(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, location ContinuousBackupRestoreLocation, options *MongoDBResourcesClientBeginRetrieveContinuousBackupInformationOptions) (*http.Response, error) { req, err := client.retrieveContinuousBackupInformationCreateRequest(ctx, resourceGroupName, accountName, databaseName, collectionName, location, options) if err != nil { @@ -1838,7 +1609,7 @@ func (client *MongoDBResourcesClient) retrieveContinuousBackupInformationCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, location) @@ -1846,7 +1617,7 @@ func (client *MongoDBResourcesClient) retrieveContinuousBackupInformationCreateR // BeginUpdateMongoDBCollectionThroughput - Update the RUs per second of an Azure Cosmos DB MongoDB collection // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -1868,7 +1639,7 @@ func (client *MongoDBResourcesClient) BeginUpdateMongoDBCollectionThroughput(ctx // UpdateMongoDBCollectionThroughput - Update the RUs per second of an Azure Cosmos DB MongoDB collection // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *MongoDBResourcesClient) updateMongoDBCollectionThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *MongoDBResourcesClientBeginUpdateMongoDBCollectionThroughputOptions) (*http.Response, error) { req, err := client.updateMongoDBCollectionThroughputCreateRequest(ctx, resourceGroupName, accountName, databaseName, collectionName, updateThroughputParameters, options) if err != nil { @@ -1912,7 +1683,7 @@ func (client *MongoDBResourcesClient) updateMongoDBCollectionThroughputCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, updateThroughputParameters) @@ -1920,7 +1691,7 @@ func (client *MongoDBResourcesClient) updateMongoDBCollectionThroughputCreateReq // BeginUpdateMongoDBDatabaseThroughput - Update RUs per second of the an Azure Cosmos DB MongoDB database // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -1941,7 +1712,7 @@ func (client *MongoDBResourcesClient) BeginUpdateMongoDBDatabaseThroughput(ctx c // UpdateMongoDBDatabaseThroughput - Update RUs per second of the an Azure Cosmos DB MongoDB database // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *MongoDBResourcesClient) updateMongoDBDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *MongoDBResourcesClientBeginUpdateMongoDBDatabaseThroughputOptions) (*http.Response, error) { req, err := client.updateMongoDBDatabaseThroughputCreateRequest(ctx, resourceGroupName, accountName, databaseName, updateThroughputParameters, options) if err != nil { @@ -1981,7 +1752,7 @@ func (client *MongoDBResourcesClient) updateMongoDBDatabaseThroughputCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, updateThroughputParameters) diff --git a/sdk/resourcemanager/cosmos/armcosmos/mongodbresources_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/mongodbresources_client_example_test.go deleted file mode 100644 index 451483498c2c..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/mongodbresources_client_example_test.go +++ /dev/null @@ -1,887 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBMongoDBDatabaseList.json -func ExampleMongoDBResourcesClient_NewListMongoDBDatabasesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewMongoDBResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListMongoDBDatabasesPager("rgName", - "ddb1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBMongoDBDatabaseGet.json -func ExampleMongoDBResourcesClient_GetMongoDBDatabase() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewMongoDBResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetMongoDBDatabase(ctx, - "rg1", - "ddb1", - "databaseName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBMongoDBDatabaseCreateUpdate.json -func ExampleMongoDBResourcesClient_BeginCreateUpdateMongoDBDatabase() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewMongoDBResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateUpdateMongoDBDatabase(ctx, - "rg1", - "ddb1", - "databaseName", - armcosmos.MongoDBDatabaseCreateUpdateParameters{ - Location: to.Ptr("West US"), - Tags: map[string]*string{}, - Properties: &armcosmos.MongoDBDatabaseCreateUpdateProperties{ - Options: &armcosmos.CreateUpdateOptions{}, - Resource: &armcosmos.MongoDBDatabaseResource{ - ID: to.Ptr("databaseName"), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBMongoDBDatabaseDelete.json -func ExampleMongoDBResourcesClient_BeginDeleteMongoDBDatabase() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewMongoDBResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDeleteMongoDBDatabase(ctx, - "rg1", - "ddb1", - "databaseName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBMongoDBDatabaseThroughputGet.json -func ExampleMongoDBResourcesClient_GetMongoDBDatabaseThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewMongoDBResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetMongoDBDatabaseThroughput(ctx, - "rg1", - "ddb1", - "databaseName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBMongoDBDatabaseThroughputUpdate.json -func ExampleMongoDBResourcesClient_BeginUpdateMongoDBDatabaseThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewMongoDBResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdateMongoDBDatabaseThroughput(ctx, - "rg1", - "ddb1", - "databaseName", - armcosmos.ThroughputSettingsUpdateParameters{ - Location: to.Ptr("West US"), - Tags: map[string]*string{}, - Properties: &armcosmos.ThroughputSettingsUpdateProperties{ - Resource: &armcosmos.ThroughputSettingsResource{ - Throughput: to.Ptr[int32](400), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBMongoDBDatabaseMigrateToAutoscale.json -func ExampleMongoDBResourcesClient_BeginMigrateMongoDBDatabaseToAutoscale() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewMongoDBResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginMigrateMongoDBDatabaseToAutoscale(ctx, - "rg1", - "ddb1", - "databaseName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBMongoDBDatabaseMigrateToManualThroughput.json -func ExampleMongoDBResourcesClient_BeginMigrateMongoDBDatabaseToManualThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewMongoDBResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginMigrateMongoDBDatabaseToManualThroughput(ctx, - "rg1", - "ddb1", - "databaseName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBMongoDBCollectionRetrieveThroughputDistribution.json -func ExampleMongoDBResourcesClient_BeginMongoDBContainerRetrieveThroughputDistribution() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewMongoDBResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginMongoDBContainerRetrieveThroughputDistribution(ctx, - "rg1", - "ddb1", - "databaseName", - "collectionName", - armcosmos.RetrieveThroughputParameters{ - Properties: &armcosmos.RetrieveThroughputProperties{ - Resource: &armcosmos.RetrieveThroughputPropertiesResource{ - PhysicalPartitionIDs: []*armcosmos.PhysicalPartitionID{ - { - ID: to.Ptr("0"), - }, - { - ID: to.Ptr("1"), - }}, - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBMongoDBCollectionRedistributeThroughput.json -func ExampleMongoDBResourcesClient_BeginMongoDBContainerRedistributeThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewMongoDBResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginMongoDBContainerRedistributeThroughput(ctx, - "rg1", - "ddb1", - "databaseName", - "collectionName", - armcosmos.RedistributeThroughputParameters{ - Properties: &armcosmos.RedistributeThroughputProperties{ - Resource: &armcosmos.RedistributeThroughputPropertiesResource{ - SourcePhysicalPartitionThroughputInfo: []*armcosmos.PhysicalPartitionThroughputInfoResource{ - { - ID: to.Ptr("2"), - Throughput: to.Ptr[float64](5000), - }, - { - ID: to.Ptr("3"), - }}, - TargetPhysicalPartitionThroughputInfo: []*armcosmos.PhysicalPartitionThroughputInfoResource{ - { - ID: to.Ptr("0"), - Throughput: to.Ptr[float64](5000), - }, - { - ID: to.Ptr("1"), - Throughput: to.Ptr[float64](5000), - }}, - ThroughputPolicy: to.Ptr(armcosmos.ThroughputPolicyTypeCustom), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBMongoDBCollectionList.json -func ExampleMongoDBResourcesClient_NewListMongoDBCollectionsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewMongoDBResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListMongoDBCollectionsPager("rgName", - "ddb1", - "databaseName", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBMongoDBCollectionGet.json -func ExampleMongoDBResourcesClient_GetMongoDBCollection() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewMongoDBResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetMongoDBCollection(ctx, - "rgName", - "ddb1", - "databaseName", - "collectionName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBMongoDBCollectionCreateUpdate.json -func ExampleMongoDBResourcesClient_BeginCreateUpdateMongoDBCollection() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewMongoDBResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateUpdateMongoDBCollection(ctx, - "rg1", - "ddb1", - "databaseName", - "collectionName", - armcosmos.MongoDBCollectionCreateUpdateParameters{ - Location: to.Ptr("West US"), - Tags: map[string]*string{}, - Properties: &armcosmos.MongoDBCollectionCreateUpdateProperties{ - Options: &armcosmos.CreateUpdateOptions{}, - Resource: &armcosmos.MongoDBCollectionResource{ - AnalyticalStorageTTL: to.Ptr[int32](500), - ID: to.Ptr("collectionName"), - Indexes: []*armcosmos.MongoIndex{ - { - Key: &armcosmos.MongoIndexKeys{ - Keys: []*string{ - to.Ptr("_ts")}, - }, - Options: &armcosmos.MongoIndexOptions{ - ExpireAfterSeconds: to.Ptr[int32](100), - Unique: to.Ptr(true), - }, - }, - { - Key: &armcosmos.MongoIndexKeys{ - Keys: []*string{ - to.Ptr("_id")}, - }, - }}, - ShardKey: map[string]*string{ - "testKey": to.Ptr("Hash"), - }, - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBMongoDBCollectionDelete.json -func ExampleMongoDBResourcesClient_BeginDeleteMongoDBCollection() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewMongoDBResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDeleteMongoDBCollection(ctx, - "rg1", - "ddb1", - "databaseName", - "collectionName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBMongoDBCollectionPartitionMerge.json -func ExampleMongoDBResourcesClient_BeginListMongoDBCollectionPartitionMerge() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewMongoDBResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginListMongoDBCollectionPartitionMerge(ctx, - "rgName", - "ddb1", - "databaseName", - "collectionName", - armcosmos.MergeParameters{ - IsDryRun: to.Ptr(false), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBMongoDBCollectionThroughputGet.json -func ExampleMongoDBResourcesClient_GetMongoDBCollectionThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewMongoDBResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetMongoDBCollectionThroughput(ctx, - "rg1", - "ddb1", - "databaseName", - "collectionName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBMongoDBCollectionThroughputUpdate.json -func ExampleMongoDBResourcesClient_BeginUpdateMongoDBCollectionThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewMongoDBResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdateMongoDBCollectionThroughput(ctx, - "rg1", - "ddb1", - "databaseName", - "collectionName", - armcosmos.ThroughputSettingsUpdateParameters{ - Location: to.Ptr("West US"), - Tags: map[string]*string{}, - Properties: &armcosmos.ThroughputSettingsUpdateProperties{ - Resource: &armcosmos.ThroughputSettingsResource{ - Throughput: to.Ptr[int32](400), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBMongoDBCollectionMigrateToAutoscale.json -func ExampleMongoDBResourcesClient_BeginMigrateMongoDBCollectionToAutoscale() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewMongoDBResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginMigrateMongoDBCollectionToAutoscale(ctx, - "rg1", - "ddb1", - "databaseName", - "collectionName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBMongoDBCollectionMigrateToManualThroughput.json -func ExampleMongoDBResourcesClient_BeginMigrateMongoDBCollectionToManualThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewMongoDBResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginMigrateMongoDBCollectionToManualThroughput(ctx, - "rg1", - "ddb1", - "databaseName", - "collectionName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBMongoDBRoleDefinitionGet.json -func ExampleMongoDBResourcesClient_GetMongoRoleDefinition() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewMongoDBResourcesClient("mySubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetMongoRoleDefinition(ctx, - "myMongoRoleDefinitionId", - "myResourceGroupName", - "myAccountName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBMongoDBRoleDefinitionCreateUpdate.json -func ExampleMongoDBResourcesClient_BeginCreateUpdateMongoRoleDefinition() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewMongoDBResourcesClient("mySubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateUpdateMongoRoleDefinition(ctx, - "myMongoRoleDefinitionId", - "myResourceGroupName", - "myAccountName", - armcosmos.MongoRoleDefinitionCreateUpdateParameters{ - Properties: &armcosmos.MongoRoleDefinitionResource{ - DatabaseName: to.Ptr("sales"), - Privileges: []*armcosmos.Privilege{ - { - Actions: []*string{ - to.Ptr("insert"), - to.Ptr("find")}, - Resource: &armcosmos.PrivilegeResource{ - Collection: to.Ptr("sales"), - Db: to.Ptr("sales"), - }, - }}, - RoleName: to.Ptr("myRoleName"), - Roles: []*armcosmos.Role{ - { - Db: to.Ptr("sales"), - Role: to.Ptr("myInheritedRole"), - }}, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBMongoDBRoleDefinitionDelete.json -func ExampleMongoDBResourcesClient_BeginDeleteMongoRoleDefinition() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewMongoDBResourcesClient("mySubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDeleteMongoRoleDefinition(ctx, - "myMongoRoleDefinitionId", - "myResourceGroupName", - "myAccountName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBMongoDBRoleDefinitionList.json -func ExampleMongoDBResourcesClient_NewListMongoRoleDefinitionsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewMongoDBResourcesClient("mySubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListMongoRoleDefinitionsPager("myResourceGroupName", - "myAccountName", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBMongoDBUserDefinitionGet.json -func ExampleMongoDBResourcesClient_GetMongoUserDefinition() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewMongoDBResourcesClient("mySubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetMongoUserDefinition(ctx, - "myMongoUserDefinitionId", - "myResourceGroupName", - "myAccountName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBMongoDBUserDefinitionCreateUpdate.json -func ExampleMongoDBResourcesClient_BeginCreateUpdateMongoUserDefinition() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewMongoDBResourcesClient("mySubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateUpdateMongoUserDefinition(ctx, - "myMongoUserDefinitionId", - "myResourceGroupName", - "myAccountName", - armcosmos.MongoUserDefinitionCreateUpdateParameters{ - Properties: &armcosmos.MongoUserDefinitionResource{ - CustomData: to.Ptr("My custom data"), - DatabaseName: to.Ptr("sales"), - Mechanisms: to.Ptr("SCRAM-SHA-256"), - Password: to.Ptr("myPassword"), - Roles: []*armcosmos.Role{ - { - Db: to.Ptr("sales"), - Role: to.Ptr("myReadRole"), - }}, - UserName: to.Ptr("myUserName"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBMongoDBUserDefinitionDelete.json -func ExampleMongoDBResourcesClient_BeginDeleteMongoUserDefinition() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewMongoDBResourcesClient("mySubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDeleteMongoUserDefinition(ctx, - "myMongoUserDefinitionId", - "myResourceGroupName", - "myAccountName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBMongoDBUserDefinitionList.json -func ExampleMongoDBResourcesClient_NewListMongoUserDefinitionsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewMongoDBResourcesClient("mySubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListMongoUserDefinitionsPager("myResourceGroupName", - "myAccountName", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBMongoDBCollectionBackupInformation.json -func ExampleMongoDBResourcesClient_BeginRetrieveContinuousBackupInformation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewMongoDBResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRetrieveContinuousBackupInformation(ctx, - "rgName", - "ddb1", - "databaseName", - "collectionName", - armcosmos.ContinuousBackupRestoreLocation{ - Location: to.Ptr("North Europe"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/notebookworkspaces_client.go b/sdk/resourcemanager/cosmos/armcosmos/notebookworkspaces_client.go index 2946f5383c50..d5c7dd2bb51c 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/notebookworkspaces_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/notebookworkspaces_client.go @@ -57,7 +57,7 @@ func NewNotebookWorkspacesClient(subscriptionID string, credential azcore.TokenC // BeginCreateOrUpdate - Creates the notebook workspace for a Cosmos DB account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // notebookWorkspaceName - The name of the notebook workspace resource. @@ -78,7 +78,7 @@ func (client *NotebookWorkspacesClient) BeginCreateOrUpdate(ctx context.Context, // CreateOrUpdate - Creates the notebook workspace for a Cosmos DB account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *NotebookWorkspacesClient) createOrUpdate(ctx context.Context, resourceGroupName string, accountName string, notebookWorkspaceName NotebookWorkspaceName, notebookCreateUpdateParameters NotebookWorkspaceCreateUpdateParameters, options *NotebookWorkspacesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, accountName, notebookWorkspaceName, notebookCreateUpdateParameters, options) if err != nil { @@ -118,7 +118,7 @@ func (client *NotebookWorkspacesClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, notebookCreateUpdateParameters) @@ -126,7 +126,7 @@ func (client *NotebookWorkspacesClient) createOrUpdateCreateRequest(ctx context. // BeginDelete - Deletes the notebook workspace for a Cosmos DB account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // notebookWorkspaceName - The name of the notebook workspace resource. @@ -146,7 +146,7 @@ func (client *NotebookWorkspacesClient) BeginDelete(ctx context.Context, resourc // Delete - Deletes the notebook workspace for a Cosmos DB account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *NotebookWorkspacesClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, notebookWorkspaceName NotebookWorkspaceName, options *NotebookWorkspacesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, notebookWorkspaceName, options) if err != nil { @@ -186,7 +186,7 @@ func (client *NotebookWorkspacesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -194,7 +194,7 @@ func (client *NotebookWorkspacesClient) deleteCreateRequest(ctx context.Context, // Get - Gets the notebook workspace for a Cosmos DB account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // notebookWorkspaceName - The name of the notebook workspace resource. @@ -238,7 +238,7 @@ func (client *NotebookWorkspacesClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -255,7 +255,7 @@ func (client *NotebookWorkspacesClient) getHandleResponse(resp *http.Response) ( // NewListByDatabaseAccountPager - Gets the notebook workspace resources of an existing Cosmos DB account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // options - NotebookWorkspacesClientListByDatabaseAccountOptions contains the optional parameters for the NotebookWorkspacesClient.ListByDatabaseAccount @@ -302,7 +302,7 @@ func (client *NotebookWorkspacesClient) listByDatabaseAccountCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -319,7 +319,7 @@ func (client *NotebookWorkspacesClient) listByDatabaseAccountHandleResponse(resp // ListConnectionInfo - Retrieves the connection info for the notebook workspace // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // notebookWorkspaceName - The name of the notebook workspace resource. @@ -364,7 +364,7 @@ func (client *NotebookWorkspacesClient) listConnectionInfoCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -381,7 +381,7 @@ func (client *NotebookWorkspacesClient) listConnectionInfoHandleResponse(resp *h // BeginRegenerateAuthToken - Regenerates the auth token for the notebook workspace // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // notebookWorkspaceName - The name of the notebook workspace resource. @@ -401,7 +401,7 @@ func (client *NotebookWorkspacesClient) BeginRegenerateAuthToken(ctx context.Con // RegenerateAuthToken - Regenerates the auth token for the notebook workspace // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *NotebookWorkspacesClient) regenerateAuthToken(ctx context.Context, resourceGroupName string, accountName string, notebookWorkspaceName NotebookWorkspaceName, options *NotebookWorkspacesClientBeginRegenerateAuthTokenOptions) (*http.Response, error) { req, err := client.regenerateAuthTokenCreateRequest(ctx, resourceGroupName, accountName, notebookWorkspaceName, options) if err != nil { @@ -441,7 +441,7 @@ func (client *NotebookWorkspacesClient) regenerateAuthTokenCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -449,7 +449,7 @@ func (client *NotebookWorkspacesClient) regenerateAuthTokenCreateRequest(ctx con // BeginStart - Starts the notebook workspace // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // notebookWorkspaceName - The name of the notebook workspace resource. @@ -469,7 +469,7 @@ func (client *NotebookWorkspacesClient) BeginStart(ctx context.Context, resource // Start - Starts the notebook workspace // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *NotebookWorkspacesClient) start(ctx context.Context, resourceGroupName string, accountName string, notebookWorkspaceName NotebookWorkspaceName, options *NotebookWorkspacesClientBeginStartOptions) (*http.Response, error) { req, err := client.startCreateRequest(ctx, resourceGroupName, accountName, notebookWorkspaceName, options) if err != nil { @@ -509,7 +509,7 @@ func (client *NotebookWorkspacesClient) startCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/notebookworkspaces_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/notebookworkspaces_client_example_test.go deleted file mode 100644 index 97e47d0074b5..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/notebookworkspaces_client_example_test.go +++ /dev/null @@ -1,192 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBNotebookWorkspaceList.json -func ExampleNotebookWorkspacesClient_NewListByDatabaseAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewNotebookWorkspacesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabaseAccountPager("rg1", - "ddb1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBNotebookWorkspaceGet.json -func ExampleNotebookWorkspacesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewNotebookWorkspacesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "ddb1", - armcosmos.NotebookWorkspaceNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBNotebookWorkspaceCreate.json -func ExampleNotebookWorkspacesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewNotebookWorkspacesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "rg1", - "ddb1", - armcosmos.NotebookWorkspaceNameDefault, - armcosmos.NotebookWorkspaceCreateUpdateParameters{}, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBNotebookWorkspaceDelete.json -func ExampleNotebookWorkspacesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewNotebookWorkspacesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "rg1", - "ddb1", - armcosmos.NotebookWorkspaceNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBNotebookWorkspaceListConnectionInfo.json -func ExampleNotebookWorkspacesClient_ListConnectionInfo() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewNotebookWorkspacesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListConnectionInfo(ctx, - "rg1", - "ddb1", - armcosmos.NotebookWorkspaceNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBNotebookWorkspaceRegenerateAuthToken.json -func ExampleNotebookWorkspacesClient_BeginRegenerateAuthToken() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewNotebookWorkspacesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRegenerateAuthToken(ctx, - "rg1", - "ddb1", - armcosmos.NotebookWorkspaceNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBNotebookWorkspaceStart.json -func ExampleNotebookWorkspacesClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewNotebookWorkspacesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStart(ctx, - "rg1", - "ddb1", - armcosmos.NotebookWorkspaceNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/operations_client.go b/sdk/resourcemanager/cosmos/armcosmos/operations_client.go index f25015056892..4fe6988ca3fe 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/operations_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/operations_client.go @@ -51,7 +51,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available Cosmos DB Resource Provider operations. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -89,7 +89,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/operations_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/operations_client_example_test.go deleted file mode 100644 index ac82d4f5f290..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/operations_client_example_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBOperationsList.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewOperationsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/partitionkeyrangeid_client.go b/sdk/resourcemanager/cosmos/armcosmos/partitionkeyrangeid_client.go index 6ac7d1e2edb9..cd26080d2722 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/partitionkeyrangeid_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/partitionkeyrangeid_client.go @@ -57,7 +57,7 @@ func NewPartitionKeyRangeIDClient(subscriptionID string, credential azcore.Token // NewListMetricsPager - Retrieves the metrics determined by the given filter for the given partition key range id. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseRid - Cosmos DB database rid. @@ -122,7 +122,7 @@ func (client *PartitionKeyRangeIDClient) listMetricsCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") reqQP.Set("$filter", filter) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/cosmos/armcosmos/partitionkeyrangeid_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/partitionkeyrangeid_client_example_test.go deleted file mode 100644 index 06aeb5a3cae5..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/partitionkeyrangeid_client_example_test.go +++ /dev/null @@ -1,47 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBPKeyRangeIdGetMetrics.json -func ExamplePartitionKeyRangeIDClient_NewListMetricsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewPartitionKeyRangeIDClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListMetricsPager("rg1", - "ddb1", - "databaseRid", - "collectionRid", - "0", - "$filter=(name.value eq 'Max RUs Per Second') and timeGrain eq duration'PT1M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T23:58:55.2780000Z", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/partitionkeyrangeidregion_client.go b/sdk/resourcemanager/cosmos/armcosmos/partitionkeyrangeidregion_client.go index 0e1e345cedc0..9d686b66d221 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/partitionkeyrangeidregion_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/partitionkeyrangeidregion_client.go @@ -57,7 +57,7 @@ func NewPartitionKeyRangeIDRegionClient(subscriptionID string, credential azcore // NewListMetricsPager - Retrieves the metrics determined by the given filter for the given partition key range id and region. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // region - Cosmos DB region, with spaces between words and each word capitalized. @@ -127,7 +127,7 @@ func (client *PartitionKeyRangeIDRegionClient) listMetricsCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") reqQP.Set("$filter", filter) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/cosmos/armcosmos/partitionkeyrangeidregion_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/partitionkeyrangeidregion_client_example_test.go deleted file mode 100644 index 8f5d3813542b..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/partitionkeyrangeidregion_client_example_test.go +++ /dev/null @@ -1,48 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBPKeyRangeIdRegionGetMetrics.json -func ExamplePartitionKeyRangeIDRegionClient_NewListMetricsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewPartitionKeyRangeIDRegionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListMetricsPager("rg1", - "ddb1", - "West US", - "databaseRid", - "collectionRid", - "0", - "$filter=(name.value eq 'Max RUs Per Second') and timeGrain eq duration'PT1M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T23:58:55.2780000Z", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/percentile_client.go b/sdk/resourcemanager/cosmos/armcosmos/percentile_client.go index 345e1a189259..913858019689 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/percentile_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/percentile_client.go @@ -58,7 +58,7 @@ func NewPercentileClient(subscriptionID string, credential azcore.TokenCredentia // NewListMetricsPager - Retrieves the metrics determined by the given filter for the given database account. This url is // only for PBS and Replication Latency data // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // filter - An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are @@ -107,7 +107,7 @@ func (client *PercentileClient) listMetricsCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") reqQP.Set("$filter", filter) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/cosmos/armcosmos/percentile_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/percentile_client_example_test.go deleted file mode 100644 index 8b96a2161b89..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/percentile_client_example_test.go +++ /dev/null @@ -1,44 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBPercentileGetMetrics.json -func ExamplePercentileClient_NewListMetricsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewPercentileClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListMetricsPager("rg1", - "ddb1", - "$filter=(name.value eq 'Probabilistic Bounded Staleness') and timeGrain eq duration'PT5M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T00:13:55.2780000Z", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/percentilesourcetarget_client.go b/sdk/resourcemanager/cosmos/armcosmos/percentilesourcetarget_client.go index 947f2e30c2ce..3557eb8f934b 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/percentilesourcetarget_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/percentilesourcetarget_client.go @@ -58,7 +58,7 @@ func NewPercentileSourceTargetClient(subscriptionID string, credential azcore.To // NewListMetricsPager - 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 // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // sourceRegion - Source region from which data is written. Cosmos DB region, with spaces between words and each word capitalized. @@ -118,7 +118,7 @@ func (client *PercentileSourceTargetClient) listMetricsCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") reqQP.Set("$filter", filter) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/cosmos/armcosmos/percentilesourcetarget_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/percentilesourcetarget_client_example_test.go deleted file mode 100644 index 8bcff59c5b47..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/percentilesourcetarget_client_example_test.go +++ /dev/null @@ -1,46 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBPercentileSourceTargetGetMetrics.json -func ExamplePercentileSourceTargetClient_NewListMetricsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewPercentileSourceTargetClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListMetricsPager("rg1", - "ddb1", - "West Central US", - "East US", - "$filter=(name.value eq 'Probabilistic Bounded Staleness') and timeGrain eq duration'PT5M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T00:13:55.2780000Z", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/percentiletarget_client.go b/sdk/resourcemanager/cosmos/armcosmos/percentiletarget_client.go index f99436778235..c933e43d6420 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/percentiletarget_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/percentiletarget_client.go @@ -58,7 +58,7 @@ func NewPercentileTargetClient(subscriptionID string, credential azcore.TokenCre // NewListMetricsPager - Retrieves the metrics determined by the given filter for the given account target region. This url // is only for PBS and Replication Latency data // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // targetRegion - Target region to which data is written. Cosmos DB region, with spaces between words and each word capitalized. @@ -113,7 +113,7 @@ func (client *PercentileTargetClient) listMetricsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") reqQP.Set("$filter", filter) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/cosmos/armcosmos/percentiletarget_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/percentiletarget_client_example_test.go deleted file mode 100644 index 92ae5d9332a0..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/percentiletarget_client_example_test.go +++ /dev/null @@ -1,45 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBPercentileTargetGetMetrics.json -func ExamplePercentileTargetClient_NewListMetricsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewPercentileTargetClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListMetricsPager("rg1", - "ddb1", - "East US", - "$filter=(name.value eq 'Probabilistic Bounded Staleness') and timeGrain eq duration'PT5M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T00:13:55.2780000Z", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/polymorphic_helpers.go b/sdk/resourcemanager/cosmos/armcosmos/polymorphic_helpers.go index 6094920bf513..9cc96084bc6b 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/polymorphic_helpers.go +++ b/sdk/resourcemanager/cosmos/armcosmos/polymorphic_helpers.go @@ -31,28 +31,6 @@ func unmarshalBackupPolicyClassification(rawMsg json.RawMessage) (BackupPolicyCl return b, json.Unmarshal(rawMsg, b) } -func unmarshalDataTransferDataSourceSinkClassification(rawMsg json.RawMessage) (DataTransferDataSourceSinkClassification, error) { - if rawMsg == nil { - return nil, nil - } - var m map[string]interface{} - if err := json.Unmarshal(rawMsg, &m); err != nil { - return nil, err - } - var b DataTransferDataSourceSinkClassification - switch m["component"] { - case string(DataTransferComponentAzureBlobStorage): - b = &AzureBlobDataTransferDataSourceSink{} - case string(DataTransferComponentCosmosDBCassandra): - b = &CassandraDataTransferDataSourceSink{} - case string(DataTransferComponentCosmosDBSQL): - b = &SQLDataTransferDataSourceSink{} - default: - b = &DataTransferDataSourceSink{} - } - return b, json.Unmarshal(rawMsg, b) -} - func unmarshalServiceResourcePropertiesClassification(rawMsg json.RawMessage) (ServiceResourcePropertiesClassification, error) { if rawMsg == nil { return nil, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/privateendpointconnections_client.go b/sdk/resourcemanager/cosmos/armcosmos/privateendpointconnections_client.go index 6e2be2b8e96e..e9c1264ec3a3 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/privateendpointconnections_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/privateendpointconnections_client.go @@ -57,7 +57,7 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // BeginCreateOrUpdate - Approve or reject a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // privateEndpointConnectionName - The name of the private endpoint connection. @@ -77,7 +77,7 @@ func (client *PrivateEndpointConnectionsClient) BeginCreateOrUpdate(ctx context. // CreateOrUpdate - Approve or reject a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *PrivateEndpointConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, accountName, privateEndpointConnectionName, parameters, options) if err != nil { @@ -117,7 +117,7 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -125,7 +125,7 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx // BeginDelete - Deletes a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // privateEndpointConnectionName - The name of the private endpoint connection. @@ -145,7 +145,7 @@ func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, // Delete - Deletes a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, privateEndpointConnectionName, options) if err != nil { @@ -185,7 +185,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -193,7 +193,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. // Get - Gets a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // privateEndpointConnectionName - The name of the private endpoint connection. @@ -238,7 +238,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -255,7 +255,7 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // NewListByDatabaseAccountPager - List all private endpoint connections on a Cosmos DB account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // options - PrivateEndpointConnectionsClientListByDatabaseAccountOptions contains the optional parameters for the PrivateEndpointConnectionsClient.ListByDatabaseAccount @@ -302,7 +302,7 @@ func (client *PrivateEndpointConnectionsClient) listByDatabaseAccountCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/privateendpointconnections_client_example_test.go deleted file mode 100644 index d4980ce5e8bb..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/privateendpointconnections_client_example_test.go +++ /dev/null @@ -1,127 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBPrivateEndpointConnectionListGet.json -func ExamplePrivateEndpointConnectionsClient_NewListByDatabaseAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewPrivateEndpointConnectionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabaseAccountPager("rg1", - "ddb1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBPrivateEndpointConnectionGet.json -func ExamplePrivateEndpointConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewPrivateEndpointConnectionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "ddb1", - "privateEndpointConnectionName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBPrivateEndpointConnectionUpdate.json -func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewPrivateEndpointConnectionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "rg1", - "ddb1", - "privateEndpointConnectionName", - armcosmos.PrivateEndpointConnection{ - Properties: &armcosmos.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armcosmos.PrivateLinkServiceConnectionStateProperty{ - Description: to.Ptr("Approved by johndoe@contoso.com"), - Status: to.Ptr("Approved"), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBPrivateEndpointConnectionDelete.json -func ExamplePrivateEndpointConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewPrivateEndpointConnectionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "rg1", - "ddb1", - "privateEndpointConnectionName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/privatelinkresources_client.go b/sdk/resourcemanager/cosmos/armcosmos/privatelinkresources_client.go index 6af2f1510052..adfe2b405dd0 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/privatelinkresources_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/privatelinkresources_client.go @@ -57,7 +57,7 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // Get - Gets the private link resources that need to be created for a Cosmos DB account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // groupName - The name of the private link resource. @@ -102,7 +102,7 @@ func (client *PrivateLinkResourcesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -119,7 +119,7 @@ func (client *PrivateLinkResourcesClient) getHandleResponse(resp *http.Response) // NewListByDatabaseAccountPager - Gets the private link resources that need to be created for a Cosmos DB account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // options - PrivateLinkResourcesClientListByDatabaseAccountOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByDatabaseAccount @@ -166,7 +166,7 @@ func (client *PrivateLinkResourcesClient) listByDatabaseAccountCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/privatelinkresources_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/privatelinkresources_client_example_test.go deleted file mode 100644 index 7ca8e886d5aa..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/privatelinkresources_client_example_test.go +++ /dev/null @@ -1,66 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBPrivateLinkResourceListGet.json -func ExamplePrivateLinkResourcesClient_NewListByDatabaseAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewPrivateLinkResourcesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabaseAccountPager("rg1", - "ddb1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBPrivateLinkResourceGet.json -func ExamplePrivateLinkResourcesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewPrivateLinkResourcesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "ddb1", - "sql", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/response_types.go b/sdk/resourcemanager/cosmos/armcosmos/response_types.go index ebb38948af04..a996656955ea 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/response_types.go +++ b/sdk/resourcemanager/cosmos/armcosmos/response_types.go @@ -24,11 +24,6 @@ type CassandraClustersClientDeleteResponse struct { // placeholder for future response values } -// CassandraClustersClientGetBackupResponse contains the response from method CassandraClustersClient.GetBackup. -type CassandraClustersClientGetBackupResponse struct { - BackupResource -} - // CassandraClustersClientGetResponse contains the response from method CassandraClustersClient.Get. type CassandraClustersClientGetResponse struct { ClusterResource @@ -39,11 +34,6 @@ type CassandraClustersClientInvokeCommandResponse struct { CommandOutput } -// CassandraClustersClientListBackupsResponse contains the response from method CassandraClustersClient.ListBackups. -type CassandraClustersClientListBackupsResponse struct { - ListBackups -} - // CassandraClustersClientListByResourceGroupResponse contains the response from method CassandraClustersClient.ListByResourceGroup. type CassandraClustersClientListByResourceGroupResponse struct { ListClusters @@ -104,11 +94,6 @@ type CassandraResourcesClientCreateUpdateCassandraTableResponse struct { CassandraTableGetResults } -// CassandraResourcesClientCreateUpdateCassandraViewResponse contains the response from method CassandraResourcesClient.CreateUpdateCassandraView. -type CassandraResourcesClientCreateUpdateCassandraViewResponse struct { - CassandraViewGetResults -} - // CassandraResourcesClientDeleteCassandraKeyspaceResponse contains the response from method CassandraResourcesClient.DeleteCassandraKeyspace. type CassandraResourcesClientDeleteCassandraKeyspaceResponse struct { // placeholder for future response values @@ -119,11 +104,6 @@ type CassandraResourcesClientDeleteCassandraTableResponse struct { // placeholder for future response values } -// CassandraResourcesClientDeleteCassandraViewResponse contains the response from method CassandraResourcesClient.DeleteCassandraView. -type CassandraResourcesClientDeleteCassandraViewResponse struct { - // placeholder for future response values -} - // CassandraResourcesClientGetCassandraKeyspaceResponse contains the response from method CassandraResourcesClient.GetCassandraKeyspace. type CassandraResourcesClientGetCassandraKeyspaceResponse struct { CassandraKeyspaceGetResults @@ -144,16 +124,6 @@ type CassandraResourcesClientGetCassandraTableThroughputResponse struct { ThroughputSettingsGetResults } -// CassandraResourcesClientGetCassandraViewResponse contains the response from method CassandraResourcesClient.GetCassandraView. -type CassandraResourcesClientGetCassandraViewResponse struct { - CassandraViewGetResults -} - -// CassandraResourcesClientGetCassandraViewThroughputResponse contains the response from method CassandraResourcesClient.GetCassandraViewThroughput. -type CassandraResourcesClientGetCassandraViewThroughputResponse struct { - ThroughputSettingsGetResults -} - // CassandraResourcesClientListCassandraKeyspacesResponse contains the response from method CassandraResourcesClient.ListCassandraKeyspaces. type CassandraResourcesClientListCassandraKeyspacesResponse struct { CassandraKeyspaceListResult @@ -164,11 +134,6 @@ type CassandraResourcesClientListCassandraTablesResponse struct { CassandraTableListResult } -// CassandraResourcesClientListCassandraViewsResponse contains the response from method CassandraResourcesClient.ListCassandraViews. -type CassandraResourcesClientListCassandraViewsResponse struct { - CassandraViewListResult -} - // CassandraResourcesClientMigrateCassandraKeyspaceToAutoscaleResponse contains the response from method CassandraResourcesClient.MigrateCassandraKeyspaceToAutoscale. type CassandraResourcesClientMigrateCassandraKeyspaceToAutoscaleResponse struct { ThroughputSettingsGetResults @@ -189,16 +154,6 @@ type CassandraResourcesClientMigrateCassandraTableToManualThroughputResponse str ThroughputSettingsGetResults } -// CassandraResourcesClientMigrateCassandraViewToAutoscaleResponse contains the response from method CassandraResourcesClient.MigrateCassandraViewToAutoscale. -type CassandraResourcesClientMigrateCassandraViewToAutoscaleResponse struct { - ThroughputSettingsGetResults -} - -// CassandraResourcesClientMigrateCassandraViewToManualThroughputResponse contains the response from method CassandraResourcesClient.MigrateCassandraViewToManualThroughput. -type CassandraResourcesClientMigrateCassandraViewToManualThroughputResponse struct { - ThroughputSettingsGetResults -} - // CassandraResourcesClientUpdateCassandraKeyspaceThroughputResponse contains the response from method CassandraResourcesClient.UpdateCassandraKeyspaceThroughput. type CassandraResourcesClientUpdateCassandraKeyspaceThroughputResponse struct { ThroughputSettingsGetResults @@ -209,11 +164,6 @@ type CassandraResourcesClientUpdateCassandraTableThroughputResponse struct { ThroughputSettingsGetResults } -// CassandraResourcesClientUpdateCassandraViewThroughputResponse contains the response from method CassandraResourcesClient.UpdateCassandraViewThroughput. -type CassandraResourcesClientUpdateCassandraViewThroughputResponse struct { - ThroughputSettingsGetResults -} - // CollectionClientListMetricDefinitionsResponse contains the response from method CollectionClient.ListMetricDefinitions. type CollectionClientListMetricDefinitionsResponse struct { MetricDefinitionsListResult @@ -249,36 +199,6 @@ type CollectionRegionClientListMetricsResponse struct { MetricListResult } -// DataTransferJobsClientCancelResponse contains the response from method DataTransferJobsClient.Cancel. -type DataTransferJobsClientCancelResponse struct { - DataTransferJobGetResults -} - -// DataTransferJobsClientCreateResponse contains the response from method DataTransferJobsClient.Create. -type DataTransferJobsClientCreateResponse struct { - DataTransferJobGetResults -} - -// DataTransferJobsClientGetResponse contains the response from method DataTransferJobsClient.Get. -type DataTransferJobsClientGetResponse struct { - DataTransferJobGetResults -} - -// DataTransferJobsClientListByDatabaseAccountResponse contains the response from method DataTransferJobsClient.ListByDatabaseAccount. -type DataTransferJobsClientListByDatabaseAccountResponse struct { - DataTransferJobFeedResults -} - -// DataTransferJobsClientPauseResponse contains the response from method DataTransferJobsClient.Pause. -type DataTransferJobsClientPauseResponse struct { - DataTransferJobGetResults -} - -// DataTransferJobsClientResumeResponse contains the response from method DataTransferJobsClient.Resume. -type DataTransferJobsClientResumeResponse struct { - DataTransferJobGetResults -} - // DatabaseAccountRegionClientListMetricsResponse contains the response from method DatabaseAccountRegionClient.ListMetrics. type DatabaseAccountRegionClientListMetricsResponse struct { MetricListResult @@ -390,26 +310,6 @@ type DatabaseClientListUsagesResponse struct { UsagesResult } -// GraphResourcesClientCreateUpdateGraphResponse contains the response from method GraphResourcesClient.CreateUpdateGraph. -type GraphResourcesClientCreateUpdateGraphResponse struct { - GraphResourceGetResults -} - -// GraphResourcesClientDeleteGraphResourceResponse contains the response from method GraphResourcesClient.DeleteGraphResource. -type GraphResourcesClientDeleteGraphResourceResponse struct { - // placeholder for future response values -} - -// GraphResourcesClientGetGraphResponse contains the response from method GraphResourcesClient.GetGraph. -type GraphResourcesClientGetGraphResponse struct { - GraphResourceGetResults -} - -// GraphResourcesClientListGraphsResponse contains the response from method GraphResourcesClient.ListGraphs. -type GraphResourcesClientListGraphsResponse struct { - GraphResourcesListResult -} - // GremlinResourcesClientCreateUpdateGremlinDatabaseResponse contains the response from method GremlinResourcesClient.CreateUpdateGremlinDatabase. type GremlinResourcesClientCreateUpdateGremlinDatabaseResponse struct { GremlinDatabaseGetResults @@ -480,11 +380,6 @@ type GremlinResourcesClientMigrateGremlinGraphToManualThroughputResponse struct ThroughputSettingsGetResults } -// GremlinResourcesClientRetrieveContinuousBackupInformationResponse contains the response from method GremlinResourcesClient.RetrieveContinuousBackupInformation. -type GremlinResourcesClientRetrieveContinuousBackupInformationResponse struct { - BackupInformation -} - // GremlinResourcesClientUpdateGremlinDatabaseThroughputResponse contains the response from method GremlinResourcesClient.UpdateGremlinDatabaseThroughput. type GremlinResourcesClientUpdateGremlinDatabaseThroughputResponse struct { ThroughputSettingsGetResults @@ -575,11 +470,6 @@ type MongoDBResourcesClientGetMongoUserDefinitionResponse struct { MongoUserDefinitionGetResults } -// MongoDBResourcesClientListMongoDBCollectionPartitionMergeResponse contains the response from method MongoDBResourcesClient.ListMongoDBCollectionPartitionMerge. -type MongoDBResourcesClientListMongoDBCollectionPartitionMergeResponse struct { - PhysicalPartitionStorageInfoCollection -} - // MongoDBResourcesClientListMongoDBCollectionsResponse contains the response from method MongoDBResourcesClient.ListMongoDBCollections. type MongoDBResourcesClientListMongoDBCollectionsResponse struct { MongoDBCollectionListResult @@ -620,16 +510,6 @@ type MongoDBResourcesClientMigrateMongoDBDatabaseToManualThroughputResponse stru ThroughputSettingsGetResults } -// MongoDBResourcesClientMongoDBContainerRedistributeThroughputResponse contains the response from method MongoDBResourcesClient.MongoDBContainerRedistributeThroughput. -type MongoDBResourcesClientMongoDBContainerRedistributeThroughputResponse struct { - PhysicalPartitionThroughputInfoResult -} - -// MongoDBResourcesClientMongoDBContainerRetrieveThroughputDistributionResponse contains the response from method MongoDBResourcesClient.MongoDBContainerRetrieveThroughputDistribution. -type MongoDBResourcesClientMongoDBContainerRetrieveThroughputDistributionResponse struct { - PhysicalPartitionThroughputInfoResult -} - // MongoDBResourcesClientRetrieveContinuousBackupInformationResponse contains the response from method MongoDBResourcesClient.RetrieveContinuousBackupInformation. type MongoDBResourcesClientRetrieveContinuousBackupInformationResponse struct { BackupInformation @@ -755,21 +635,6 @@ type RestorableDatabaseAccountsClientListResponse struct { RestorableDatabaseAccountsListResult } -// RestorableGremlinDatabasesClientListResponse contains the response from method RestorableGremlinDatabasesClient.List. -type RestorableGremlinDatabasesClientListResponse struct { - RestorableGremlinDatabasesListResult -} - -// RestorableGremlinGraphsClientListResponse contains the response from method RestorableGremlinGraphsClient.List. -type RestorableGremlinGraphsClientListResponse struct { - RestorableGremlinGraphsListResult -} - -// RestorableGremlinResourcesClientListResponse contains the response from method RestorableGremlinResourcesClient.List. -type RestorableGremlinResourcesClientListResponse struct { - RestorableGremlinResourcesListResult -} - // RestorableMongodbCollectionsClientListResponse contains the response from method RestorableMongodbCollectionsClient.List. type RestorableMongodbCollectionsClientListResponse struct { RestorableMongodbCollectionsListResult @@ -800,21 +665,6 @@ type RestorableSQLResourcesClientListResponse struct { RestorableSQLResourcesListResult } -// RestorableTableResourcesClientListResponse contains the response from method RestorableTableResourcesClient.List. -type RestorableTableResourcesClientListResponse struct { - RestorableTableResourcesListResult -} - -// RestorableTablesClientListResponse contains the response from method RestorableTablesClient.List. -type RestorableTablesClientListResponse struct { - RestorableTablesListResult -} - -// SQLResourcesClientCreateUpdateClientEncryptionKeyResponse contains the response from method SQLResourcesClient.CreateUpdateClientEncryptionKey. -type SQLResourcesClientCreateUpdateClientEncryptionKeyResponse struct { - ClientEncryptionKeyGetResults -} - // SQLResourcesClientCreateUpdateSQLContainerResponse contains the response from method SQLResourcesClient.CreateUpdateSQLContainer. type SQLResourcesClientCreateUpdateSQLContainerResponse struct { SQLContainerGetResults @@ -885,11 +735,6 @@ type SQLResourcesClientDeleteSQLUserDefinedFunctionResponse struct { // placeholder for future response values } -// SQLResourcesClientGetClientEncryptionKeyResponse contains the response from method SQLResourcesClient.GetClientEncryptionKey. -type SQLResourcesClientGetClientEncryptionKeyResponse struct { - ClientEncryptionKeyGetResults -} - // SQLResourcesClientGetSQLContainerResponse contains the response from method SQLResourcesClient.GetSQLContainer. type SQLResourcesClientGetSQLContainerResponse struct { SQLContainerGetResults @@ -935,16 +780,6 @@ type SQLResourcesClientGetSQLUserDefinedFunctionResponse struct { SQLUserDefinedFunctionGetResults } -// SQLResourcesClientListClientEncryptionKeysResponse contains the response from method SQLResourcesClient.ListClientEncryptionKeys. -type SQLResourcesClientListClientEncryptionKeysResponse struct { - ClientEncryptionKeysListResult -} - -// SQLResourcesClientListSQLContainerPartitionMergeResponse contains the response from method SQLResourcesClient.ListSQLContainerPartitionMerge. -type SQLResourcesClientListSQLContainerPartitionMergeResponse struct { - PhysicalPartitionStorageInfoCollection -} - // SQLResourcesClientListSQLContainersResponse contains the response from method SQLResourcesClient.ListSQLContainers. type SQLResourcesClientListSQLContainersResponse struct { SQLContainerListResult @@ -1005,16 +840,6 @@ type SQLResourcesClientRetrieveContinuousBackupInformationResponse struct { BackupInformation } -// SQLResourcesClientSQLContainerRedistributeThroughputResponse contains the response from method SQLResourcesClient.SQLContainerRedistributeThroughput. -type SQLResourcesClientSQLContainerRedistributeThroughputResponse struct { - PhysicalPartitionThroughputInfoResult -} - -// SQLResourcesClientSQLContainerRetrieveThroughputDistributionResponse contains the response from method SQLResourcesClient.SQLContainerRetrieveThroughputDistribution. -type SQLResourcesClientSQLContainerRetrieveThroughputDistributionResponse struct { - PhysicalPartitionThroughputInfoResult -} - // SQLResourcesClientUpdateSQLContainerThroughputResponse contains the response from method SQLResourcesClient.UpdateSQLContainerThroughput. type SQLResourcesClientUpdateSQLContainerThroughputResponse struct { ThroughputSettingsGetResults @@ -1080,11 +905,6 @@ type TableResourcesClientMigrateTableToManualThroughputResponse struct { ThroughputSettingsGetResults } -// TableResourcesClientRetrieveContinuousBackupInformationResponse contains the response from method TableResourcesClient.RetrieveContinuousBackupInformation. -type TableResourcesClientRetrieveContinuousBackupInformationResponse struct { - BackupInformation -} - // TableResourcesClientUpdateTableThroughputResponse contains the response from method TableResourcesClient.UpdateTableThroughput. type TableResourcesClientUpdateTableThroughputResponse struct { ThroughputSettingsGetResults diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorabledatabaseaccounts_client.go b/sdk/resourcemanager/cosmos/armcosmos/restorabledatabaseaccounts_client.go index 52e673cce6d0..1592d6fb32b1 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/restorabledatabaseaccounts_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/restorabledatabaseaccounts_client.go @@ -58,7 +58,7 @@ func NewRestorableDatabaseAccountsClient(subscriptionID string, credential azcor // GetByLocation - Retrieves the properties of an existing Azure Cosmos DB restorable database account. This call requires // 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' permission. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // location - Cosmos DB region, with spaces between words and each word capitalized. // instanceID - The instanceId GUID of a restorable database account. // options - RestorableDatabaseAccountsClientGetByLocationOptions contains the optional parameters for the RestorableDatabaseAccountsClient.GetByLocation @@ -98,7 +98,7 @@ func (client *RestorableDatabaseAccountsClient) getByLocationCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -116,7 +116,7 @@ func (client *RestorableDatabaseAccountsClient) getByLocationHandleResponse(resp // NewListPager - Lists all the restorable Azure Cosmos DB database accounts available under the subscription. This call requires // 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // options - RestorableDatabaseAccountsClientListOptions contains the optional parameters for the RestorableDatabaseAccountsClient.List // method. func (client *RestorableDatabaseAccountsClient) NewListPager(options *RestorableDatabaseAccountsClientListOptions) *runtime.Pager[RestorableDatabaseAccountsClientListResponse] { @@ -153,7 +153,7 @@ func (client *RestorableDatabaseAccountsClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -172,7 +172,7 @@ func (client *RestorableDatabaseAccountsClient) listHandleResponse(resp *http.Re // in a region. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' // permission. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // location - Cosmos DB region, with spaces between words and each word capitalized. // options - RestorableDatabaseAccountsClientListByLocationOptions contains the optional parameters for the RestorableDatabaseAccountsClient.ListByLocation // method. @@ -214,7 +214,7 @@ func (client *RestorableDatabaseAccountsClient) listByLocationCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorabledatabaseaccounts_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/restorabledatabaseaccounts_client_example_test.go deleted file mode 100644 index 8234ecb00c21..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/restorabledatabaseaccounts_client_example_test.go +++ /dev/null @@ -1,88 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBRestorableDatabaseAccountList.json -func ExampleRestorableDatabaseAccountsClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewRestorableDatabaseAccountsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByLocationPager("West US", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBRestorableDatabaseAccountNoLocationList.json -func ExampleRestorableDatabaseAccountsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewRestorableDatabaseAccountsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBRestorableDatabaseAccountGet.json -func ExampleRestorableDatabaseAccountsClient_GetByLocation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewRestorableDatabaseAccountsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetByLocation(ctx, - "West US", - "d9b26648-2f53-4541-b3d8-3044f4f9810d", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablegremlindatabases_client.go b/sdk/resourcemanager/cosmos/armcosmos/restorablegremlindatabases_client.go deleted file mode 100644 index 9bb3bf907055..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablegremlindatabases_client.go +++ /dev/null @@ -1,122 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armcosmos - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// RestorableGremlinDatabasesClient contains the methods for the RestorableGremlinDatabases group. -// Don't use this type directly, use NewRestorableGremlinDatabasesClient() instead. -type RestorableGremlinDatabasesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewRestorableGremlinDatabasesClient creates a new instance of RestorableGremlinDatabasesClient with the specified values. -// subscriptionID - The ID of the target subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewRestorableGremlinDatabasesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RestorableGremlinDatabasesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &RestorableGremlinDatabasesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// NewListPager - 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 -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -// location - Cosmos DB region, with spaces between words and each word capitalized. -// instanceID - The instanceId GUID of a restorable database account. -// options - RestorableGremlinDatabasesClientListOptions contains the optional parameters for the RestorableGremlinDatabasesClient.List -// method. -func (client *RestorableGremlinDatabasesClient) NewListPager(location string, instanceID string, options *RestorableGremlinDatabasesClientListOptions) *runtime.Pager[RestorableGremlinDatabasesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[RestorableGremlinDatabasesClientListResponse]{ - More: func(page RestorableGremlinDatabasesClientListResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *RestorableGremlinDatabasesClientListResponse) (RestorableGremlinDatabasesClientListResponse, error) { - req, err := client.listCreateRequest(ctx, location, instanceID, options) - if err != nil { - return RestorableGremlinDatabasesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return RestorableGremlinDatabasesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RestorableGremlinDatabasesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *RestorableGremlinDatabasesClient) listCreateRequest(ctx context.Context, location string, instanceID string, options *RestorableGremlinDatabasesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGremlinDatabases" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *RestorableGremlinDatabasesClient) listHandleResponse(resp *http.Response) (RestorableGremlinDatabasesClientListResponse, error) { - result := RestorableGremlinDatabasesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RestorableGremlinDatabasesListResult); err != nil { - return RestorableGremlinDatabasesClientListResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablegremlindatabases_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/restorablegremlindatabases_client_example_test.go deleted file mode 100644 index 8ae26f4c1d49..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablegremlindatabases_client_example_test.go +++ /dev/null @@ -1,43 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBRestorableGremlinDatabaseList.json -func ExampleRestorableGremlinDatabasesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewRestorableGremlinDatabasesClient("2296c272-5d55-40d9-bc05-4d56dc2d7588", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("WestUS", - "d9b26648-2f53-4541-b3d8-3044f4f9810d", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablegremlingraphs_client.go b/sdk/resourcemanager/cosmos/armcosmos/restorablegremlingraphs_client.go deleted file mode 100644 index a7d7c4c54eda..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablegremlingraphs_client.go +++ /dev/null @@ -1,131 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armcosmos - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// RestorableGremlinGraphsClient contains the methods for the RestorableGremlinGraphs group. -// Don't use this type directly, use NewRestorableGremlinGraphsClient() instead. -type RestorableGremlinGraphsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewRestorableGremlinGraphsClient creates a new instance of RestorableGremlinGraphsClient with the specified values. -// subscriptionID - The ID of the target subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewRestorableGremlinGraphsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RestorableGremlinGraphsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &RestorableGremlinGraphsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// NewListPager - 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 -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -// location - Cosmos DB region, with spaces between words and each word capitalized. -// instanceID - The instanceId GUID of a restorable database account. -// options - RestorableGremlinGraphsClientListOptions contains the optional parameters for the RestorableGremlinGraphsClient.List -// method. -func (client *RestorableGremlinGraphsClient) NewListPager(location string, instanceID string, options *RestorableGremlinGraphsClientListOptions) *runtime.Pager[RestorableGremlinGraphsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[RestorableGremlinGraphsClientListResponse]{ - More: func(page RestorableGremlinGraphsClientListResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *RestorableGremlinGraphsClientListResponse) (RestorableGremlinGraphsClientListResponse, error) { - req, err := client.listCreateRequest(ctx, location, instanceID, options) - if err != nil { - return RestorableGremlinGraphsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return RestorableGremlinGraphsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RestorableGremlinGraphsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *RestorableGremlinGraphsClient) listCreateRequest(ctx context.Context, location string, instanceID string, options *RestorableGremlinGraphsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGraphs" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") - if options != nil && options.RestorableGremlinDatabaseRid != nil { - reqQP.Set("restorableGremlinDatabaseRid", *options.RestorableGremlinDatabaseRid) - } - if options != nil && options.StartTime != nil { - reqQP.Set("startTime", *options.StartTime) - } - if options != nil && options.EndTime != nil { - reqQP.Set("endTime", *options.EndTime) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *RestorableGremlinGraphsClient) listHandleResponse(resp *http.Response) (RestorableGremlinGraphsClientListResponse, error) { - result := RestorableGremlinGraphsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RestorableGremlinGraphsListResult); err != nil { - return RestorableGremlinGraphsClientListResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablegremlingraphs_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/restorablegremlingraphs_client_example_test.go deleted file mode 100644 index 6406474f7bc8..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablegremlingraphs_client_example_test.go +++ /dev/null @@ -1,47 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBRestorableGremlinGraphList.json -func ExampleRestorableGremlinGraphsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewRestorableGremlinGraphsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("WestUS", - "98a570f2-63db-4117-91f0-366327b7b353", - &armcosmos.RestorableGremlinGraphsClientListOptions{RestorableGremlinDatabaseRid: to.Ptr("PD5DALigDgw="), - StartTime: nil, - EndTime: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablegremlinresources_client.go b/sdk/resourcemanager/cosmos/armcosmos/restorablegremlinresources_client.go deleted file mode 100644 index f6de58449533..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablegremlinresources_client.go +++ /dev/null @@ -1,128 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armcosmos - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// RestorableGremlinResourcesClient contains the methods for the RestorableGremlinResources group. -// Don't use this type directly, use NewRestorableGremlinResourcesClient() instead. -type RestorableGremlinResourcesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewRestorableGremlinResourcesClient creates a new instance of RestorableGremlinResourcesClient with the specified values. -// subscriptionID - The ID of the target subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewRestorableGremlinResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RestorableGremlinResourcesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &RestorableGremlinResourcesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// NewListPager - 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. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -// location - Cosmos DB region, with spaces between words and each word capitalized. -// instanceID - The instanceId GUID of a restorable database account. -// options - RestorableGremlinResourcesClientListOptions contains the optional parameters for the RestorableGremlinResourcesClient.List -// method. -func (client *RestorableGremlinResourcesClient) NewListPager(location string, instanceID string, options *RestorableGremlinResourcesClientListOptions) *runtime.Pager[RestorableGremlinResourcesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[RestorableGremlinResourcesClientListResponse]{ - More: func(page RestorableGremlinResourcesClientListResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *RestorableGremlinResourcesClientListResponse) (RestorableGremlinResourcesClientListResponse, error) { - req, err := client.listCreateRequest(ctx, location, instanceID, options) - if err != nil { - return RestorableGremlinResourcesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return RestorableGremlinResourcesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RestorableGremlinResourcesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *RestorableGremlinResourcesClient) listCreateRequest(ctx context.Context, location string, instanceID string, options *RestorableGremlinResourcesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGremlinResources" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") - if options != nil && options.RestoreLocation != nil { - reqQP.Set("restoreLocation", *options.RestoreLocation) - } - if options != nil && options.RestoreTimestampInUTC != nil { - reqQP.Set("restoreTimestampInUtc", *options.RestoreTimestampInUTC) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *RestorableGremlinResourcesClient) listHandleResponse(resp *http.Response) (RestorableGremlinResourcesClientListResponse, error) { - result := RestorableGremlinResourcesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RestorableGremlinResourcesListResult); err != nil { - return RestorableGremlinResourcesClientListResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablegremlinresources_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/restorablegremlinresources_client_example_test.go deleted file mode 100644 index 8a8caf04fadf..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablegremlinresources_client_example_test.go +++ /dev/null @@ -1,46 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBRestorableGremlinResourceList.json -func ExampleRestorableGremlinResourcesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewRestorableGremlinResourcesClient("2296c272-5d55-40d9-bc05-4d56dc2d7588", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("WestUS", - "d9b26648-2f53-4541-b3d8-3044f4f9810d", - &armcosmos.RestorableGremlinResourcesClientListOptions{RestoreLocation: to.Ptr("WestUS"), - RestoreTimestampInUTC: to.Ptr("06/01/2022 4:56"), - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbcollections_client.go b/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbcollections_client.go index 3331d2d7a96d..2a4638ac671b 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbcollections_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbcollections_client.go @@ -59,7 +59,7 @@ func NewRestorableMongodbCollectionsClient(subscriptionID string, credential azc // database. This helps in scenario where container was accidentally deleted. This API requires // 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/…/read' permission // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // location - Cosmos DB region, with spaces between words and each word capitalized. // instanceID - The instanceId GUID of a restorable database account. // options - RestorableMongodbCollectionsClientListOptions contains the optional parameters for the RestorableMongodbCollectionsClient.List @@ -106,16 +106,10 @@ func (client *RestorableMongodbCollectionsClient) listCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") if options != nil && options.RestorableMongodbDatabaseRid != nil { reqQP.Set("restorableMongodbDatabaseRid", *options.RestorableMongodbDatabaseRid) } - if options != nil && options.StartTime != nil { - reqQP.Set("startTime", *options.StartTime) - } - if options != nil && options.EndTime != nil { - reqQP.Set("endTime", *options.EndTime) - } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbcollections_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbcollections_client_example_test.go deleted file mode 100644 index a43ca210924d..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbcollections_client_example_test.go +++ /dev/null @@ -1,47 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBRestorableMongodbCollectionList.json -func ExampleRestorableMongodbCollectionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewRestorableMongodbCollectionsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("WestUS", - "98a570f2-63db-4117-91f0-366327b7b353", - &armcosmos.RestorableMongodbCollectionsClientListOptions{RestorableMongodbDatabaseRid: to.Ptr("PD5DALigDgw="), - StartTime: nil, - EndTime: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbdatabases_client.go b/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbdatabases_client.go index e3ef95995141..5891098aebb1 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbdatabases_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbdatabases_client.go @@ -59,7 +59,7 @@ func NewRestorableMongodbDatabasesClient(subscriptionID string, credential azcor // account. This helps in scenario where database was accidentally deleted to get the deletion // time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/…/read' permission // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // location - Cosmos DB region, with spaces between words and each word capitalized. // instanceID - The instanceId GUID of a restorable database account. // options - RestorableMongodbDatabasesClientListOptions contains the optional parameters for the RestorableMongodbDatabasesClient.List @@ -106,7 +106,7 @@ func (client *RestorableMongodbDatabasesClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbdatabases_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbdatabases_client_example_test.go deleted file mode 100644 index d41d9af8c283..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbdatabases_client_example_test.go +++ /dev/null @@ -1,43 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBRestorableMongodbDatabaseList.json -func ExampleRestorableMongodbDatabasesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewRestorableMongodbDatabasesClient("2296c272-5d55-40d9-bc05-4d56dc2d7588", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("WestUS", - "d9b26648-2f53-4541-b3d8-3044f4f9810d", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbresources_client.go b/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbresources_client.go index b845d56599d3..207a8fba820a 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbresources_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbresources_client.go @@ -59,7 +59,7 @@ func NewRestorableMongodbResourcesClient(subscriptionID string, credential azcor // This helps in scenarios to validate what resources exist at given timestamp and location. // This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/…/read' permission. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // location - Cosmos DB region, with spaces between words and each word capitalized. // instanceID - The instanceId GUID of a restorable database account. // options - RestorableMongodbResourcesClientListOptions contains the optional parameters for the RestorableMongodbResourcesClient.List @@ -106,7 +106,7 @@ func (client *RestorableMongodbResourcesClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") if options != nil && options.RestoreLocation != nil { reqQP.Set("restoreLocation", *options.RestoreLocation) } diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbresources_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbresources_client_example_test.go deleted file mode 100644 index 4ec114654478..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablemongodbresources_client_example_test.go +++ /dev/null @@ -1,46 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBRestorableMongodbResourceList.json -func ExampleRestorableMongodbResourcesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewRestorableMongodbResourcesClient("2296c272-5d55-40d9-bc05-4d56dc2d7588", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("WestUS", - "d9b26648-2f53-4541-b3d8-3044f4f9810d", - &armcosmos.RestorableMongodbResourcesClientListOptions{RestoreLocation: to.Ptr("WestUS"), - RestoreTimestampInUTC: to.Ptr("06/01/2022 4:56"), - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablesqlcontainers_client.go b/sdk/resourcemanager/cosmos/armcosmos/restorablesqlcontainers_client.go index 7acd6fd9a7a2..1f3a6bebf699 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablesqlcontainers_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/restorablesqlcontainers_client.go @@ -59,7 +59,7 @@ func NewRestorableSQLContainersClient(subscriptionID string, credential azcore.T // This helps in scenario where container was accidentally deleted. This API requires // 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/…/read' permission // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // location - Cosmos DB region, with spaces between words and each word capitalized. // instanceID - The instanceId GUID of a restorable database account. // options - RestorableSQLContainersClientListOptions contains the optional parameters for the RestorableSQLContainersClient.List @@ -106,7 +106,7 @@ func (client *RestorableSQLContainersClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") if options != nil && options.RestorableSQLDatabaseRid != nil { reqQP.Set("restorableSqlDatabaseRid", *options.RestorableSQLDatabaseRid) } diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablesqlcontainers_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/restorablesqlcontainers_client_example_test.go deleted file mode 100644 index 127c98494cc4..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablesqlcontainers_client_example_test.go +++ /dev/null @@ -1,47 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBRestorableSqlContainerList.json -func ExampleRestorableSQLContainersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewRestorableSQLContainersClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("WestUS", - "98a570f2-63db-4117-91f0-366327b7b353", - &armcosmos.RestorableSQLContainersClientListOptions{RestorableSQLDatabaseRid: to.Ptr("3fu-hg=="), - StartTime: nil, - EndTime: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablesqldatabases_client.go b/sdk/resourcemanager/cosmos/armcosmos/restorablesqldatabases_client.go index 2f2169f0ef15..5ee279a1978f 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablesqldatabases_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/restorablesqldatabases_client.go @@ -59,7 +59,7 @@ func NewRestorableSQLDatabasesClient(subscriptionID string, credential azcore.To // account. This helps in scenario where database was accidentally deleted to get the deletion // time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/…/read' permission // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // location - Cosmos DB region, with spaces between words and each word capitalized. // instanceID - The instanceId GUID of a restorable database account. // options - RestorableSQLDatabasesClientListOptions contains the optional parameters for the RestorableSQLDatabasesClient.List @@ -106,7 +106,7 @@ func (client *RestorableSQLDatabasesClient) listCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablesqldatabases_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/restorablesqldatabases_client_example_test.go deleted file mode 100644 index 9f8cf70de714..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablesqldatabases_client_example_test.go +++ /dev/null @@ -1,43 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBRestorableSqlDatabaseList.json -func ExampleRestorableSQLDatabasesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewRestorableSQLDatabasesClient("2296c272-5d55-40d9-bc05-4d56dc2d7588", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("WestUS", - "d9b26648-2f53-4541-b3d8-3044f4f9810d", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablesqlresources_client.go b/sdk/resourcemanager/cosmos/armcosmos/restorablesqlresources_client.go index 8093fa7d55b5..3545118896ff 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablesqlresources_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/restorablesqlresources_client.go @@ -59,7 +59,7 @@ func NewRestorableSQLResourcesClient(subscriptionID string, credential azcore.To // This helps in scenarios to validate what resources exist at given timestamp and location. // This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/…/read' permission. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // location - Cosmos DB region, with spaces between words and each word capitalized. // instanceID - The instanceId GUID of a restorable database account. // options - RestorableSQLResourcesClientListOptions contains the optional parameters for the RestorableSQLResourcesClient.List @@ -106,7 +106,7 @@ func (client *RestorableSQLResourcesClient) listCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") if options != nil && options.RestoreLocation != nil { reqQP.Set("restoreLocation", *options.RestoreLocation) } diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorablesqlresources_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/restorablesqlresources_client_example_test.go deleted file mode 100644 index 2fde7be64f8e..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/restorablesqlresources_client_example_test.go +++ /dev/null @@ -1,46 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBRestorableSqlResourceList.json -func ExampleRestorableSQLResourcesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewRestorableSQLResourcesClient("2296c272-5d55-40d9-bc05-4d56dc2d7588", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("WestUS", - "d9b26648-2f53-4541-b3d8-3044f4f9810d", - &armcosmos.RestorableSQLResourcesClientListOptions{RestoreLocation: to.Ptr("WestUS"), - RestoreTimestampInUTC: to.Ptr("06/01/2022 4:56"), - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorabletableresources_client.go b/sdk/resourcemanager/cosmos/armcosmos/restorabletableresources_client.go deleted file mode 100644 index 7e06d970f5af..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/restorabletableresources_client.go +++ /dev/null @@ -1,128 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armcosmos - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// RestorableTableResourcesClient contains the methods for the RestorableTableResources group. -// Don't use this type directly, use NewRestorableTableResourcesClient() instead. -type RestorableTableResourcesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewRestorableTableResourcesClient creates a new instance of RestorableTableResourcesClient with the specified values. -// subscriptionID - The ID of the target subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewRestorableTableResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RestorableTableResourcesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &RestorableTableResourcesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// NewListPager - 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. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -// location - Cosmos DB region, with spaces between words and each word capitalized. -// instanceID - The instanceId GUID of a restorable database account. -// options - RestorableTableResourcesClientListOptions contains the optional parameters for the RestorableTableResourcesClient.List -// method. -func (client *RestorableTableResourcesClient) NewListPager(location string, instanceID string, options *RestorableTableResourcesClientListOptions) *runtime.Pager[RestorableTableResourcesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[RestorableTableResourcesClientListResponse]{ - More: func(page RestorableTableResourcesClientListResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *RestorableTableResourcesClientListResponse) (RestorableTableResourcesClientListResponse, error) { - req, err := client.listCreateRequest(ctx, location, instanceID, options) - if err != nil { - return RestorableTableResourcesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return RestorableTableResourcesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RestorableTableResourcesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *RestorableTableResourcesClient) listCreateRequest(ctx context.Context, location string, instanceID string, options *RestorableTableResourcesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableTableResources" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") - if options != nil && options.RestoreLocation != nil { - reqQP.Set("restoreLocation", *options.RestoreLocation) - } - if options != nil && options.RestoreTimestampInUTC != nil { - reqQP.Set("restoreTimestampInUtc", *options.RestoreTimestampInUTC) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *RestorableTableResourcesClient) listHandleResponse(resp *http.Response) (RestorableTableResourcesClientListResponse, error) { - result := RestorableTableResourcesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RestorableTableResourcesListResult); err != nil { - return RestorableTableResourcesClientListResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorabletableresources_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/restorabletableresources_client_example_test.go deleted file mode 100644 index c81be8b32ab2..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/restorabletableresources_client_example_test.go +++ /dev/null @@ -1,46 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBRestorableTableResourceList.json -func ExampleRestorableTableResourcesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewRestorableTableResourcesClient("2296c272-5d55-40d9-bc05-4d56dc2d7588", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("WestUS", - "d9b26648-2f53-4541-b3d8-3044f4f9810d", - &armcosmos.RestorableTableResourcesClientListOptions{RestoreLocation: to.Ptr("WestUS"), - RestoreTimestampInUTC: to.Ptr("06/01/2022 4:56"), - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorabletables_client.go b/sdk/resourcemanager/cosmos/armcosmos/restorabletables_client.go deleted file mode 100644 index 0539e0c34c65..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/restorabletables_client.go +++ /dev/null @@ -1,127 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armcosmos - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// RestorableTablesClient contains the methods for the RestorableTables group. -// Don't use this type directly, use NewRestorableTablesClient() instead. -type RestorableTablesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewRestorableTablesClient creates a new instance of RestorableTablesClient with the specified values. -// subscriptionID - The ID of the target subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewRestorableTablesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RestorableTablesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &RestorableTablesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// NewListPager - 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 -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -// location - Cosmos DB region, with spaces between words and each word capitalized. -// instanceID - The instanceId GUID of a restorable database account. -// options - RestorableTablesClientListOptions contains the optional parameters for the RestorableTablesClient.List method. -func (client *RestorableTablesClient) NewListPager(location string, instanceID string, options *RestorableTablesClientListOptions) *runtime.Pager[RestorableTablesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[RestorableTablesClientListResponse]{ - More: func(page RestorableTablesClientListResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *RestorableTablesClientListResponse) (RestorableTablesClientListResponse, error) { - req, err := client.listCreateRequest(ctx, location, instanceID, options) - if err != nil { - return RestorableTablesClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return RestorableTablesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RestorableTablesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *RestorableTablesClient) listCreateRequest(ctx context.Context, location string, instanceID string, options *RestorableTablesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableTables" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") - if options != nil && options.StartTime != nil { - reqQP.Set("startTime", *options.StartTime) - } - if options != nil && options.EndTime != nil { - reqQP.Set("endTime", *options.EndTime) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *RestorableTablesClient) listHandleResponse(resp *http.Response) (RestorableTablesClientListResponse, error) { - result := RestorableTablesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RestorableTablesListResult); err != nil { - return RestorableTablesClientListResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/restorabletables_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/restorabletables_client_example_test.go deleted file mode 100644 index be1165ddc54a..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/restorabletables_client_example_test.go +++ /dev/null @@ -1,45 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBRestorableTableList.json -func ExampleRestorableTablesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewRestorableTablesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("WestUS", - "98a570f2-63db-4117-91f0-366327b7b353", - &armcosmos.RestorableTablesClientListOptions{StartTime: nil, - EndTime: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/service_client.go b/sdk/resourcemanager/cosmos/armcosmos/service_client.go index 2a09063dbda1..4b42c0b7dd5c 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/service_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/service_client.go @@ -57,7 +57,7 @@ func NewServiceClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreate - Creates a service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // serviceName - Cosmos DB service name. @@ -77,7 +77,7 @@ func (client *ServiceClient) BeginCreate(ctx context.Context, resourceGroupName // Create - Creates a service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *ServiceClient) create(ctx context.Context, resourceGroupName string, accountName string, serviceName string, createUpdateParameters ServiceResourceCreateUpdateParameters, options *ServiceClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, serviceName, createUpdateParameters, options) if err != nil { @@ -117,7 +117,7 @@ func (client *ServiceClient) createCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, createUpdateParameters) @@ -125,7 +125,7 @@ func (client *ServiceClient) createCreateRequest(ctx context.Context, resourceGr // BeginDelete - Deletes service with the given serviceName. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // serviceName - Cosmos DB service name. @@ -144,7 +144,7 @@ func (client *ServiceClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes service with the given serviceName. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *ServiceClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, serviceName string, options *ServiceClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, serviceName, options) if err != nil { @@ -184,7 +184,7 @@ func (client *ServiceClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -192,7 +192,7 @@ func (client *ServiceClient) deleteCreateRequest(ctx context.Context, resourceGr // Get - Gets the status of service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // serviceName - Cosmos DB service name. @@ -236,7 +236,7 @@ func (client *ServiceClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -253,7 +253,7 @@ func (client *ServiceClient) getHandleResponse(resp *http.Response) (ServiceClie // NewListPager - Gets the status of service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // options - ServiceClientListOptions contains the optional parameters for the ServiceClient.List method. @@ -299,7 +299,7 @@ func (client *ServiceClient) listCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/service_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/service_client_example_test.go deleted file mode 100644 index 4a8d6631e312..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/service_client_example_test.go +++ /dev/null @@ -1,126 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBServicesList.json -func ExampleServiceClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewServiceClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("rg1", - "ddb1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBDataTransferServiceCreate.json -func ExampleServiceClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewServiceClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, - "rg1", - "ddb1", - "DataTransfer", - armcosmos.ServiceResourceCreateUpdateParameters{ - Properties: &armcosmos.ServiceResourceCreateUpdateProperties{ - InstanceCount: to.Ptr[int32](1), - InstanceSize: to.Ptr(armcosmos.ServiceSizeCosmosD4S), - ServiceType: to.Ptr(armcosmos.ServiceTypeDataTransfer), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBDataTransferServiceGet.json -func ExampleServiceClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewServiceClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "ddb1", - "DataTransfer", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBDataTransferServiceDelete.json -func ExampleServiceClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewServiceClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "rg1", - "ddb1", - "DataTransfer", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/sqlresources_client.go b/sdk/resourcemanager/cosmos/armcosmos/sqlresources_client.go index d777146a69ad..2bda73157857 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/sqlresources_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/sqlresources_client.go @@ -55,85 +55,9 @@ func NewSQLResourcesClient(subscriptionID string, credential azcore.TokenCredent return client, nil } -// BeginCreateUpdateClientEncryptionKey - Create or update a ClientEncryptionKey. This API is meant to be invoked via tools -// such as the Azure Powershell (instead of directly). -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// accountName - Cosmos DB database account name. -// databaseName - Cosmos DB database name. -// clientEncryptionKeyName - Cosmos DB ClientEncryptionKey name. -// createUpdateClientEncryptionKeyParameters - The parameters to provide for the client encryption key. -// options - SQLResourcesClientBeginCreateUpdateClientEncryptionKeyOptions contains the optional parameters for the SQLResourcesClient.BeginCreateUpdateClientEncryptionKey -// method. -func (client *SQLResourcesClient) BeginCreateUpdateClientEncryptionKey(ctx context.Context, resourceGroupName string, accountName string, databaseName string, clientEncryptionKeyName string, createUpdateClientEncryptionKeyParameters ClientEncryptionKeyCreateUpdateParameters, options *SQLResourcesClientBeginCreateUpdateClientEncryptionKeyOptions) (*runtime.Poller[SQLResourcesClientCreateUpdateClientEncryptionKeyResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createUpdateClientEncryptionKey(ctx, resourceGroupName, accountName, databaseName, clientEncryptionKeyName, createUpdateClientEncryptionKeyParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[SQLResourcesClientCreateUpdateClientEncryptionKeyResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[SQLResourcesClientCreateUpdateClientEncryptionKeyResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateUpdateClientEncryptionKey - Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such -// as the Azure Powershell (instead of directly). -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -func (client *SQLResourcesClient) createUpdateClientEncryptionKey(ctx context.Context, resourceGroupName string, accountName string, databaseName string, clientEncryptionKeyName string, createUpdateClientEncryptionKeyParameters ClientEncryptionKeyCreateUpdateParameters, options *SQLResourcesClientBeginCreateUpdateClientEncryptionKeyOptions) (*http.Response, error) { - req, err := client.createUpdateClientEncryptionKeyCreateRequest(ctx, resourceGroupName, accountName, databaseName, clientEncryptionKeyName, createUpdateClientEncryptionKeyParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createUpdateClientEncryptionKeyCreateRequest creates the CreateUpdateClientEncryptionKey request. -func (client *SQLResourcesClient) createUpdateClientEncryptionKeyCreateRequest(ctx context.Context, resourceGroupName string, accountName string, databaseName string, clientEncryptionKeyName string, createUpdateClientEncryptionKeyParameters ClientEncryptionKeyCreateUpdateParameters, options *SQLResourcesClientBeginCreateUpdateClientEncryptionKeyOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - if databaseName == "" { - return nil, errors.New("parameter databaseName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) - if clientEncryptionKeyName == "" { - return nil, errors.New("parameter clientEncryptionKeyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clientEncryptionKeyName}", url.PathEscape(clientEncryptionKeyName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, createUpdateClientEncryptionKeyParameters) -} - // BeginCreateUpdateSQLContainer - Create or update an Azure Cosmos DB SQL container // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -155,7 +79,7 @@ func (client *SQLResourcesClient) BeginCreateUpdateSQLContainer(ctx context.Cont // CreateUpdateSQLContainer - Create or update an Azure Cosmos DB SQL container // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *SQLResourcesClient) createUpdateSQLContainer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, createUpdateSQLContainerParameters SQLContainerCreateUpdateParameters, options *SQLResourcesClientBeginCreateUpdateSQLContainerOptions) (*http.Response, error) { req, err := client.createUpdateSQLContainerCreateRequest(ctx, resourceGroupName, accountName, databaseName, containerName, createUpdateSQLContainerParameters, options) if err != nil { @@ -199,7 +123,7 @@ func (client *SQLResourcesClient) createUpdateSQLContainerCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, createUpdateSQLContainerParameters) @@ -207,7 +131,7 @@ func (client *SQLResourcesClient) createUpdateSQLContainerCreateRequest(ctx cont // BeginCreateUpdateSQLDatabase - Create or update an Azure Cosmos DB SQL database // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -228,7 +152,7 @@ func (client *SQLResourcesClient) BeginCreateUpdateSQLDatabase(ctx context.Conte // CreateUpdateSQLDatabase - Create or update an Azure Cosmos DB SQL database // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *SQLResourcesClient) createUpdateSQLDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string, createUpdateSQLDatabaseParameters SQLDatabaseCreateUpdateParameters, options *SQLResourcesClientBeginCreateUpdateSQLDatabaseOptions) (*http.Response, error) { req, err := client.createUpdateSQLDatabaseCreateRequest(ctx, resourceGroupName, accountName, databaseName, createUpdateSQLDatabaseParameters, options) if err != nil { @@ -268,7 +192,7 @@ func (client *SQLResourcesClient) createUpdateSQLDatabaseCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, createUpdateSQLDatabaseParameters) @@ -276,7 +200,7 @@ func (client *SQLResourcesClient) createUpdateSQLDatabaseCreateRequest(ctx conte // BeginCreateUpdateSQLRoleAssignment - Creates or updates an Azure Cosmos DB SQL Role Assignment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // roleAssignmentID - The GUID for the Role Assignment. // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. @@ -297,7 +221,7 @@ func (client *SQLResourcesClient) BeginCreateUpdateSQLRoleAssignment(ctx context // CreateUpdateSQLRoleAssignment - Creates or updates an Azure Cosmos DB SQL Role Assignment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *SQLResourcesClient) createUpdateSQLRoleAssignment(ctx context.Context, roleAssignmentID string, resourceGroupName string, accountName string, createUpdateSQLRoleAssignmentParameters SQLRoleAssignmentCreateUpdateParameters, options *SQLResourcesClientBeginCreateUpdateSQLRoleAssignmentOptions) (*http.Response, error) { req, err := client.createUpdateSQLRoleAssignmentCreateRequest(ctx, roleAssignmentID, resourceGroupName, accountName, createUpdateSQLRoleAssignmentParameters, options) if err != nil { @@ -337,7 +261,7 @@ func (client *SQLResourcesClient) createUpdateSQLRoleAssignmentCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, createUpdateSQLRoleAssignmentParameters) @@ -345,7 +269,7 @@ func (client *SQLResourcesClient) createUpdateSQLRoleAssignmentCreateRequest(ctx // BeginCreateUpdateSQLRoleDefinition - Creates or updates an Azure Cosmos DB SQL Role Definition. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // roleDefinitionID - The GUID for the Role Definition. // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. @@ -366,7 +290,7 @@ func (client *SQLResourcesClient) BeginCreateUpdateSQLRoleDefinition(ctx context // CreateUpdateSQLRoleDefinition - Creates or updates an Azure Cosmos DB SQL Role Definition. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *SQLResourcesClient) createUpdateSQLRoleDefinition(ctx context.Context, roleDefinitionID string, resourceGroupName string, accountName string, createUpdateSQLRoleDefinitionParameters SQLRoleDefinitionCreateUpdateParameters, options *SQLResourcesClientBeginCreateUpdateSQLRoleDefinitionOptions) (*http.Response, error) { req, err := client.createUpdateSQLRoleDefinitionCreateRequest(ctx, roleDefinitionID, resourceGroupName, accountName, createUpdateSQLRoleDefinitionParameters, options) if err != nil { @@ -406,7 +330,7 @@ func (client *SQLResourcesClient) createUpdateSQLRoleDefinitionCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, createUpdateSQLRoleDefinitionParameters) @@ -414,7 +338,7 @@ func (client *SQLResourcesClient) createUpdateSQLRoleDefinitionCreateRequest(ctx // BeginCreateUpdateSQLStoredProcedure - Create or update an Azure Cosmos DB SQL storedProcedure // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -437,7 +361,7 @@ func (client *SQLResourcesClient) BeginCreateUpdateSQLStoredProcedure(ctx contex // CreateUpdateSQLStoredProcedure - Create or update an Azure Cosmos DB SQL storedProcedure // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *SQLResourcesClient) createUpdateSQLStoredProcedure(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, storedProcedureName string, createUpdateSQLStoredProcedureParameters SQLStoredProcedureCreateUpdateParameters, options *SQLResourcesClientBeginCreateUpdateSQLStoredProcedureOptions) (*http.Response, error) { req, err := client.createUpdateSQLStoredProcedureCreateRequest(ctx, resourceGroupName, accountName, databaseName, containerName, storedProcedureName, createUpdateSQLStoredProcedureParameters, options) if err != nil { @@ -485,7 +409,7 @@ func (client *SQLResourcesClient) createUpdateSQLStoredProcedureCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, createUpdateSQLStoredProcedureParameters) @@ -493,7 +417,7 @@ func (client *SQLResourcesClient) createUpdateSQLStoredProcedureCreateRequest(ct // BeginCreateUpdateSQLTrigger - Create or update an Azure Cosmos DB SQL trigger // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -516,7 +440,7 @@ func (client *SQLResourcesClient) BeginCreateUpdateSQLTrigger(ctx context.Contex // CreateUpdateSQLTrigger - Create or update an Azure Cosmos DB SQL trigger // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *SQLResourcesClient) createUpdateSQLTrigger(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, triggerName string, createUpdateSQLTriggerParameters SQLTriggerCreateUpdateParameters, options *SQLResourcesClientBeginCreateUpdateSQLTriggerOptions) (*http.Response, error) { req, err := client.createUpdateSQLTriggerCreateRequest(ctx, resourceGroupName, accountName, databaseName, containerName, triggerName, createUpdateSQLTriggerParameters, options) if err != nil { @@ -564,7 +488,7 @@ func (client *SQLResourcesClient) createUpdateSQLTriggerCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, createUpdateSQLTriggerParameters) @@ -572,7 +496,7 @@ func (client *SQLResourcesClient) createUpdateSQLTriggerCreateRequest(ctx contex // BeginCreateUpdateSQLUserDefinedFunction - Create or update an Azure Cosmos DB SQL userDefinedFunction // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -595,7 +519,7 @@ func (client *SQLResourcesClient) BeginCreateUpdateSQLUserDefinedFunction(ctx co // CreateUpdateSQLUserDefinedFunction - Create or update an Azure Cosmos DB SQL userDefinedFunction // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *SQLResourcesClient) createUpdateSQLUserDefinedFunction(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, userDefinedFunctionName string, createUpdateSQLUserDefinedFunctionParameters SQLUserDefinedFunctionCreateUpdateParameters, options *SQLResourcesClientBeginCreateUpdateSQLUserDefinedFunctionOptions) (*http.Response, error) { req, err := client.createUpdateSQLUserDefinedFunctionCreateRequest(ctx, resourceGroupName, accountName, databaseName, containerName, userDefinedFunctionName, createUpdateSQLUserDefinedFunctionParameters, options) if err != nil { @@ -643,7 +567,7 @@ func (client *SQLResourcesClient) createUpdateSQLUserDefinedFunctionCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, createUpdateSQLUserDefinedFunctionParameters) @@ -651,7 +575,7 @@ func (client *SQLResourcesClient) createUpdateSQLUserDefinedFunctionCreateReques // BeginDeleteSQLContainer - Deletes an existing Azure Cosmos DB SQL container. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -672,7 +596,7 @@ func (client *SQLResourcesClient) BeginDeleteSQLContainer(ctx context.Context, r // DeleteSQLContainer - Deletes an existing Azure Cosmos DB SQL container. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *SQLResourcesClient) deleteSQLContainer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, options *SQLResourcesClientBeginDeleteSQLContainerOptions) (*http.Response, error) { req, err := client.deleteSQLContainerCreateRequest(ctx, resourceGroupName, accountName, databaseName, containerName, options) if err != nil { @@ -716,14 +640,14 @@ func (client *SQLResourcesClient) deleteSQLContainerCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // BeginDeleteSQLDatabase - Deletes an existing Azure Cosmos DB SQL database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -743,7 +667,7 @@ func (client *SQLResourcesClient) BeginDeleteSQLDatabase(ctx context.Context, re // DeleteSQLDatabase - Deletes an existing Azure Cosmos DB SQL database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *SQLResourcesClient) deleteSQLDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *SQLResourcesClientBeginDeleteSQLDatabaseOptions) (*http.Response, error) { req, err := client.deleteSQLDatabaseCreateRequest(ctx, resourceGroupName, accountName, databaseName, options) if err != nil { @@ -783,14 +707,14 @@ func (client *SQLResourcesClient) deleteSQLDatabaseCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // BeginDeleteSQLRoleAssignment - Deletes an existing Azure Cosmos DB SQL Role Assignment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // roleAssignmentID - The GUID for the Role Assignment. // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. @@ -810,7 +734,7 @@ func (client *SQLResourcesClient) BeginDeleteSQLRoleAssignment(ctx context.Conte // DeleteSQLRoleAssignment - Deletes an existing Azure Cosmos DB SQL Role Assignment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *SQLResourcesClient) deleteSQLRoleAssignment(ctx context.Context, roleAssignmentID string, resourceGroupName string, accountName string, options *SQLResourcesClientBeginDeleteSQLRoleAssignmentOptions) (*http.Response, error) { req, err := client.deleteSQLRoleAssignmentCreateRequest(ctx, roleAssignmentID, resourceGroupName, accountName, options) if err != nil { @@ -850,7 +774,7 @@ func (client *SQLResourcesClient) deleteSQLRoleAssignmentCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -858,7 +782,7 @@ func (client *SQLResourcesClient) deleteSQLRoleAssignmentCreateRequest(ctx conte // BeginDeleteSQLRoleDefinition - Deletes an existing Azure Cosmos DB SQL Role Definition. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // roleDefinitionID - The GUID for the Role Definition. // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. @@ -878,7 +802,7 @@ func (client *SQLResourcesClient) BeginDeleteSQLRoleDefinition(ctx context.Conte // DeleteSQLRoleDefinition - Deletes an existing Azure Cosmos DB SQL Role Definition. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *SQLResourcesClient) deleteSQLRoleDefinition(ctx context.Context, roleDefinitionID string, resourceGroupName string, accountName string, options *SQLResourcesClientBeginDeleteSQLRoleDefinitionOptions) (*http.Response, error) { req, err := client.deleteSQLRoleDefinitionCreateRequest(ctx, roleDefinitionID, resourceGroupName, accountName, options) if err != nil { @@ -918,7 +842,7 @@ func (client *SQLResourcesClient) deleteSQLRoleDefinitionCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -926,7 +850,7 @@ func (client *SQLResourcesClient) deleteSQLRoleDefinitionCreateRequest(ctx conte // BeginDeleteSQLStoredProcedure - Deletes an existing Azure Cosmos DB SQL storedProcedure. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -948,7 +872,7 @@ func (client *SQLResourcesClient) BeginDeleteSQLStoredProcedure(ctx context.Cont // DeleteSQLStoredProcedure - Deletes an existing Azure Cosmos DB SQL storedProcedure. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *SQLResourcesClient) deleteSQLStoredProcedure(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, storedProcedureName string, options *SQLResourcesClientBeginDeleteSQLStoredProcedureOptions) (*http.Response, error) { req, err := client.deleteSQLStoredProcedureCreateRequest(ctx, resourceGroupName, accountName, databaseName, containerName, storedProcedureName, options) if err != nil { @@ -996,14 +920,14 @@ func (client *SQLResourcesClient) deleteSQLStoredProcedureCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // BeginDeleteSQLTrigger - Deletes an existing Azure Cosmos DB SQL trigger. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -1025,7 +949,7 @@ func (client *SQLResourcesClient) BeginDeleteSQLTrigger(ctx context.Context, res // DeleteSQLTrigger - Deletes an existing Azure Cosmos DB SQL trigger. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *SQLResourcesClient) deleteSQLTrigger(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, triggerName string, options *SQLResourcesClientBeginDeleteSQLTriggerOptions) (*http.Response, error) { req, err := client.deleteSQLTriggerCreateRequest(ctx, resourceGroupName, accountName, databaseName, containerName, triggerName, options) if err != nil { @@ -1073,14 +997,14 @@ func (client *SQLResourcesClient) deleteSQLTriggerCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // BeginDeleteSQLUserDefinedFunction - Deletes an existing Azure Cosmos DB SQL userDefinedFunction. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -1102,7 +1026,7 @@ func (client *SQLResourcesClient) BeginDeleteSQLUserDefinedFunction(ctx context. // DeleteSQLUserDefinedFunction - Deletes an existing Azure Cosmos DB SQL userDefinedFunction. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *SQLResourcesClient) deleteSQLUserDefinedFunction(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, userDefinedFunctionName string, options *SQLResourcesClientBeginDeleteSQLUserDefinedFunctionOptions) (*http.Response, error) { req, err := client.deleteSQLUserDefinedFunctionCreateRequest(ctx, resourceGroupName, accountName, databaseName, containerName, userDefinedFunctionName, options) if err != nil { @@ -1150,81 +1074,14 @@ func (client *SQLResourcesClient) deleteSQLUserDefinedFunctionCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } -// GetClientEncryptionKey - Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// accountName - Cosmos DB database account name. -// databaseName - Cosmos DB database name. -// clientEncryptionKeyName - Cosmos DB ClientEncryptionKey name. -// options - SQLResourcesClientGetClientEncryptionKeyOptions contains the optional parameters for the SQLResourcesClient.GetClientEncryptionKey -// method. -func (client *SQLResourcesClient) GetClientEncryptionKey(ctx context.Context, resourceGroupName string, accountName string, databaseName string, clientEncryptionKeyName string, options *SQLResourcesClientGetClientEncryptionKeyOptions) (SQLResourcesClientGetClientEncryptionKeyResponse, error) { - req, err := client.getClientEncryptionKeyCreateRequest(ctx, resourceGroupName, accountName, databaseName, clientEncryptionKeyName, options) - if err != nil { - return SQLResourcesClientGetClientEncryptionKeyResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return SQLResourcesClientGetClientEncryptionKeyResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SQLResourcesClientGetClientEncryptionKeyResponse{}, runtime.NewResponseError(resp) - } - return client.getClientEncryptionKeyHandleResponse(resp) -} - -// getClientEncryptionKeyCreateRequest creates the GetClientEncryptionKey request. -func (client *SQLResourcesClient) getClientEncryptionKeyCreateRequest(ctx context.Context, resourceGroupName string, accountName string, databaseName string, clientEncryptionKeyName string, options *SQLResourcesClientGetClientEncryptionKeyOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - if databaseName == "" { - return nil, errors.New("parameter databaseName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) - if clientEncryptionKeyName == "" { - return nil, errors.New("parameter clientEncryptionKeyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clientEncryptionKeyName}", url.PathEscape(clientEncryptionKeyName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getClientEncryptionKeyHandleResponse handles the GetClientEncryptionKey response. -func (client *SQLResourcesClient) getClientEncryptionKeyHandleResponse(resp *http.Response) (SQLResourcesClientGetClientEncryptionKeyResponse, error) { - result := SQLResourcesClientGetClientEncryptionKeyResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ClientEncryptionKeyGetResults); err != nil { - return SQLResourcesClientGetClientEncryptionKeyResponse{}, err - } - return result, nil -} - // GetSQLContainer - Gets the SQL container under an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -1274,7 +1131,7 @@ func (client *SQLResourcesClient) getSQLContainerCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1291,7 +1148,7 @@ func (client *SQLResourcesClient) getSQLContainerHandleResponse(resp *http.Respo // GetSQLContainerThroughput - Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -1341,7 +1198,7 @@ func (client *SQLResourcesClient) getSQLContainerThroughputCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1358,7 +1215,7 @@ func (client *SQLResourcesClient) getSQLContainerThroughputHandleResponse(resp * // GetSQLDatabase - Gets the SQL database under an existing Azure Cosmos DB database account with the provided name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -1403,7 +1260,7 @@ func (client *SQLResourcesClient) getSQLDatabaseCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1421,7 +1278,7 @@ func (client *SQLResourcesClient) getSQLDatabaseHandleResponse(resp *http.Respon // GetSQLDatabaseThroughput - Gets the RUs per second of the SQL database under an existing Azure Cosmos DB database account // with the provided name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -1466,7 +1323,7 @@ func (client *SQLResourcesClient) getSQLDatabaseThroughputCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1483,7 +1340,7 @@ func (client *SQLResourcesClient) getSQLDatabaseThroughputHandleResponse(resp *h // GetSQLRoleAssignment - Retrieves the properties of an existing Azure Cosmos DB SQL Role Assignment with the given Id. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // roleAssignmentID - The GUID for the Role Assignment. // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. @@ -1528,7 +1385,7 @@ func (client *SQLResourcesClient) getSQLRoleAssignmentCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1545,7 +1402,7 @@ func (client *SQLResourcesClient) getSQLRoleAssignmentHandleResponse(resp *http. // GetSQLRoleDefinition - Retrieves the properties of an existing Azure Cosmos DB SQL Role Definition with the given Id. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // roleDefinitionID - The GUID for the Role Definition. // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. @@ -1590,7 +1447,7 @@ func (client *SQLResourcesClient) getSQLRoleDefinitionCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1607,7 +1464,7 @@ func (client *SQLResourcesClient) getSQLRoleDefinitionHandleResponse(resp *http. // GetSQLStoredProcedure - Gets the SQL storedProcedure under an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -1662,7 +1519,7 @@ func (client *SQLResourcesClient) getSQLStoredProcedureCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1679,7 +1536,7 @@ func (client *SQLResourcesClient) getSQLStoredProcedureHandleResponse(resp *http // GetSQLTrigger - Gets the SQL trigger under an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -1734,7 +1591,7 @@ func (client *SQLResourcesClient) getSQLTriggerCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1751,7 +1608,7 @@ func (client *SQLResourcesClient) getSQLTriggerHandleResponse(resp *http.Respons // GetSQLUserDefinedFunction - Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -1806,7 +1663,7 @@ func (client *SQLResourcesClient) getSQLUserDefinedFunctionCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1821,154 +1678,9 @@ func (client *SQLResourcesClient) getSQLUserDefinedFunctionHandleResponse(resp * return result, nil } -// NewListClientEncryptionKeysPager - Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// accountName - Cosmos DB database account name. -// databaseName - Cosmos DB database name. -// options - SQLResourcesClientListClientEncryptionKeysOptions contains the optional parameters for the SQLResourcesClient.ListClientEncryptionKeys -// method. -func (client *SQLResourcesClient) NewListClientEncryptionKeysPager(resourceGroupName string, accountName string, databaseName string, options *SQLResourcesClientListClientEncryptionKeysOptions) *runtime.Pager[SQLResourcesClientListClientEncryptionKeysResponse] { - return runtime.NewPager(runtime.PagingHandler[SQLResourcesClientListClientEncryptionKeysResponse]{ - More: func(page SQLResourcesClientListClientEncryptionKeysResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *SQLResourcesClientListClientEncryptionKeysResponse) (SQLResourcesClientListClientEncryptionKeysResponse, error) { - req, err := client.listClientEncryptionKeysCreateRequest(ctx, resourceGroupName, accountName, databaseName, options) - if err != nil { - return SQLResourcesClientListClientEncryptionKeysResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return SQLResourcesClientListClientEncryptionKeysResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SQLResourcesClientListClientEncryptionKeysResponse{}, runtime.NewResponseError(resp) - } - return client.listClientEncryptionKeysHandleResponse(resp) - }, - }) -} - -// listClientEncryptionKeysCreateRequest creates the ListClientEncryptionKeys request. -func (client *SQLResourcesClient) listClientEncryptionKeysCreateRequest(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *SQLResourcesClientListClientEncryptionKeysOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - if databaseName == "" { - return nil, errors.New("parameter databaseName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listClientEncryptionKeysHandleResponse handles the ListClientEncryptionKeys response. -func (client *SQLResourcesClient) listClientEncryptionKeysHandleResponse(resp *http.Response) (SQLResourcesClientListClientEncryptionKeysResponse, error) { - result := SQLResourcesClientListClientEncryptionKeysResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ClientEncryptionKeysListResult); err != nil { - return SQLResourcesClientListClientEncryptionKeysResponse{}, err - } - return result, nil -} - -// BeginListSQLContainerPartitionMerge - Merges the partitions of a SQL Container -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// accountName - Cosmos DB database account name. -// databaseName - Cosmos DB database name. -// containerName - Cosmos DB container name. -// mergeParameters - The parameters for the merge operation. -// options - SQLResourcesClientBeginListSQLContainerPartitionMergeOptions contains the optional parameters for the SQLResourcesClient.BeginListSQLContainerPartitionMerge -// method. -func (client *SQLResourcesClient) BeginListSQLContainerPartitionMerge(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, mergeParameters MergeParameters, options *SQLResourcesClientBeginListSQLContainerPartitionMergeOptions) (*runtime.Poller[SQLResourcesClientListSQLContainerPartitionMergeResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.listSQLContainerPartitionMerge(ctx, resourceGroupName, accountName, databaseName, containerName, mergeParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SQLResourcesClientListSQLContainerPartitionMergeResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[SQLResourcesClientListSQLContainerPartitionMergeResponse](options.ResumeToken, client.pl, nil) - } -} - -// ListSQLContainerPartitionMerge - Merges the partitions of a SQL Container -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -func (client *SQLResourcesClient) listSQLContainerPartitionMerge(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, mergeParameters MergeParameters, options *SQLResourcesClientBeginListSQLContainerPartitionMergeOptions) (*http.Response, error) { - req, err := client.listSQLContainerPartitionMergeCreateRequest(ctx, resourceGroupName, accountName, databaseName, containerName, mergeParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// listSQLContainerPartitionMergeCreateRequest creates the ListSQLContainerPartitionMerge request. -func (client *SQLResourcesClient) listSQLContainerPartitionMergeCreateRequest(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, mergeParameters MergeParameters, options *SQLResourcesClientBeginListSQLContainerPartitionMergeOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/partitionMerge" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - if databaseName == "" { - return nil, errors.New("parameter databaseName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) - if containerName == "" { - return nil, errors.New("parameter containerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{containerName}", url.PathEscape(containerName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, mergeParameters) -} - // NewListSQLContainersPager - Lists the SQL container under an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -2020,7 +1732,7 @@ func (client *SQLResourcesClient) listSQLContainersCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2037,7 +1749,7 @@ func (client *SQLResourcesClient) listSQLContainersHandleResponse(resp *http.Res // NewListSQLDatabasesPager - Lists the SQL databases under an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // options - SQLResourcesClientListSQLDatabasesOptions contains the optional parameters for the SQLResourcesClient.ListSQLDatabases @@ -2084,7 +1796,7 @@ func (client *SQLResourcesClient) listSQLDatabasesCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2101,7 +1813,7 @@ func (client *SQLResourcesClient) listSQLDatabasesHandleResponse(resp *http.Resp // NewListSQLRoleAssignmentsPager - Retrieves the list of all Azure Cosmos DB SQL Role Assignments. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // options - SQLResourcesClientListSQLRoleAssignmentsOptions contains the optional parameters for the SQLResourcesClient.ListSQLRoleAssignments @@ -2148,7 +1860,7 @@ func (client *SQLResourcesClient) listSQLRoleAssignmentsCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2165,7 +1877,7 @@ func (client *SQLResourcesClient) listSQLRoleAssignmentsHandleResponse(resp *htt // NewListSQLRoleDefinitionsPager - Retrieves the list of all Azure Cosmos DB SQL Role Definitions. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // options - SQLResourcesClientListSQLRoleDefinitionsOptions contains the optional parameters for the SQLResourcesClient.ListSQLRoleDefinitions @@ -2212,7 +1924,7 @@ func (client *SQLResourcesClient) listSQLRoleDefinitionsCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2229,7 +1941,7 @@ func (client *SQLResourcesClient) listSQLRoleDefinitionsHandleResponse(resp *htt // NewListSQLStoredProceduresPager - Lists the SQL storedProcedure under an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -2286,7 +1998,7 @@ func (client *SQLResourcesClient) listSQLStoredProceduresCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2303,7 +2015,7 @@ func (client *SQLResourcesClient) listSQLStoredProceduresHandleResponse(resp *ht // NewListSQLTriggersPager - Lists the SQL trigger under an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -2360,7 +2072,7 @@ func (client *SQLResourcesClient) listSQLTriggersCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2377,7 +2089,7 @@ func (client *SQLResourcesClient) listSQLTriggersHandleResponse(resp *http.Respo // NewListSQLUserDefinedFunctionsPager - Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -2434,7 +2146,7 @@ func (client *SQLResourcesClient) listSQLUserDefinedFunctionsCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2451,7 +2163,7 @@ func (client *SQLResourcesClient) listSQLUserDefinedFunctionsHandleResponse(resp // BeginMigrateSQLContainerToAutoscale - Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -2472,7 +2184,7 @@ func (client *SQLResourcesClient) BeginMigrateSQLContainerToAutoscale(ctx contex // MigrateSQLContainerToAutoscale - Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *SQLResourcesClient) migrateSQLContainerToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, options *SQLResourcesClientBeginMigrateSQLContainerToAutoscaleOptions) (*http.Response, error) { req, err := client.migrateSQLContainerToAutoscaleCreateRequest(ctx, resourceGroupName, accountName, databaseName, containerName, options) if err != nil { @@ -2516,7 +2228,7 @@ func (client *SQLResourcesClient) migrateSQLContainerToAutoscaleCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2524,7 +2236,7 @@ func (client *SQLResourcesClient) migrateSQLContainerToAutoscaleCreateRequest(ct // BeginMigrateSQLContainerToManualThroughput - Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -2545,7 +2257,7 @@ func (client *SQLResourcesClient) BeginMigrateSQLContainerToManualThroughput(ctx // MigrateSQLContainerToManualThroughput - Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *SQLResourcesClient) migrateSQLContainerToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, options *SQLResourcesClientBeginMigrateSQLContainerToManualThroughputOptions) (*http.Response, error) { req, err := client.migrateSQLContainerToManualThroughputCreateRequest(ctx, resourceGroupName, accountName, databaseName, containerName, options) if err != nil { @@ -2589,7 +2301,7 @@ func (client *SQLResourcesClient) migrateSQLContainerToManualThroughputCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2597,7 +2309,7 @@ func (client *SQLResourcesClient) migrateSQLContainerToManualThroughputCreateReq // BeginMigrateSQLDatabaseToAutoscale - Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -2617,7 +2329,7 @@ func (client *SQLResourcesClient) BeginMigrateSQLDatabaseToAutoscale(ctx context // MigrateSQLDatabaseToAutoscale - Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *SQLResourcesClient) migrateSQLDatabaseToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *SQLResourcesClientBeginMigrateSQLDatabaseToAutoscaleOptions) (*http.Response, error) { req, err := client.migrateSQLDatabaseToAutoscaleCreateRequest(ctx, resourceGroupName, accountName, databaseName, options) if err != nil { @@ -2657,7 +2369,7 @@ func (client *SQLResourcesClient) migrateSQLDatabaseToAutoscaleCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2665,7 +2377,7 @@ func (client *SQLResourcesClient) migrateSQLDatabaseToAutoscaleCreateRequest(ctx // BeginMigrateSQLDatabaseToManualThroughput - Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -2685,7 +2397,7 @@ func (client *SQLResourcesClient) BeginMigrateSQLDatabaseToManualThroughput(ctx // MigrateSQLDatabaseToManualThroughput - Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *SQLResourcesClient) migrateSQLDatabaseToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *SQLResourcesClientBeginMigrateSQLDatabaseToManualThroughputOptions) (*http.Response, error) { req, err := client.migrateSQLDatabaseToManualThroughputCreateRequest(ctx, resourceGroupName, accountName, databaseName, options) if err != nil { @@ -2725,7 +2437,7 @@ func (client *SQLResourcesClient) migrateSQLDatabaseToManualThroughputCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2733,7 +2445,7 @@ func (client *SQLResourcesClient) migrateSQLDatabaseToManualThroughputCreateRequ // BeginRetrieveContinuousBackupInformation - Retrieves continuous backup information for a container resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -2757,7 +2469,7 @@ func (client *SQLResourcesClient) BeginRetrieveContinuousBackupInformation(ctx c // RetrieveContinuousBackupInformation - Retrieves continuous backup information for a container resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *SQLResourcesClient) retrieveContinuousBackupInformation(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, location ContinuousBackupRestoreLocation, options *SQLResourcesClientBeginRetrieveContinuousBackupInformationOptions) (*http.Response, error) { req, err := client.retrieveContinuousBackupInformationCreateRequest(ctx, resourceGroupName, accountName, databaseName, containerName, location, options) if err != nil { @@ -2801,167 +2513,15 @@ func (client *SQLResourcesClient) retrieveContinuousBackupInformationCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, location) } -// BeginSQLContainerRedistributeThroughput - Redistribute throughput for an Azure Cosmos DB SQL container -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// accountName - Cosmos DB database account name. -// databaseName - Cosmos DB database name. -// containerName - Cosmos DB container name. -// redistributeThroughputParameters - The parameters to provide for redistributing throughput for the current SQL container. -// options - SQLResourcesClientBeginSQLContainerRedistributeThroughputOptions contains the optional parameters for the SQLResourcesClient.BeginSQLContainerRedistributeThroughput -// method. -func (client *SQLResourcesClient) BeginSQLContainerRedistributeThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, redistributeThroughputParameters RedistributeThroughputParameters, options *SQLResourcesClientBeginSQLContainerRedistributeThroughputOptions) (*runtime.Poller[SQLResourcesClientSQLContainerRedistributeThroughputResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.sQLContainerRedistributeThroughput(ctx, resourceGroupName, accountName, databaseName, containerName, redistributeThroughputParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SQLResourcesClientSQLContainerRedistributeThroughputResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[SQLResourcesClientSQLContainerRedistributeThroughputResponse](options.ResumeToken, client.pl, nil) - } -} - -// SQLContainerRedistributeThroughput - Redistribute throughput for an Azure Cosmos DB SQL container -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -func (client *SQLResourcesClient) sQLContainerRedistributeThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, redistributeThroughputParameters RedistributeThroughputParameters, options *SQLResourcesClientBeginSQLContainerRedistributeThroughputOptions) (*http.Response, error) { - req, err := client.sqlContainerRedistributeThroughputCreateRequest(ctx, resourceGroupName, accountName, databaseName, containerName, redistributeThroughputParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// sqlContainerRedistributeThroughputCreateRequest creates the SQLContainerRedistributeThroughput request. -func (client *SQLResourcesClient) sqlContainerRedistributeThroughputCreateRequest(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, redistributeThroughputParameters RedistributeThroughputParameters, options *SQLResourcesClientBeginSQLContainerRedistributeThroughputOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/redistributeThroughput" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - if databaseName == "" { - return nil, errors.New("parameter databaseName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) - if containerName == "" { - return nil, errors.New("parameter containerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{containerName}", url.PathEscape(containerName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, redistributeThroughputParameters) -} - -// BeginSQLContainerRetrieveThroughputDistribution - Retrieve throughput distribution for an Azure Cosmos DB SQL container -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// accountName - Cosmos DB database account name. -// databaseName - Cosmos DB database name. -// containerName - Cosmos DB container name. -// retrieveThroughputParameters - The parameters to provide for retrieving throughput distribution for the current SQL container. -// options - SQLResourcesClientBeginSQLContainerRetrieveThroughputDistributionOptions contains the optional parameters for -// the SQLResourcesClient.BeginSQLContainerRetrieveThroughputDistribution method. -func (client *SQLResourcesClient) BeginSQLContainerRetrieveThroughputDistribution(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, retrieveThroughputParameters RetrieveThroughputParameters, options *SQLResourcesClientBeginSQLContainerRetrieveThroughputDistributionOptions) (*runtime.Poller[SQLResourcesClientSQLContainerRetrieveThroughputDistributionResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.sQLContainerRetrieveThroughputDistribution(ctx, resourceGroupName, accountName, databaseName, containerName, retrieveThroughputParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SQLResourcesClientSQLContainerRetrieveThroughputDistributionResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[SQLResourcesClientSQLContainerRetrieveThroughputDistributionResponse](options.ResumeToken, client.pl, nil) - } -} - -// SQLContainerRetrieveThroughputDistribution - Retrieve throughput distribution for an Azure Cosmos DB SQL container -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -func (client *SQLResourcesClient) sQLContainerRetrieveThroughputDistribution(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, retrieveThroughputParameters RetrieveThroughputParameters, options *SQLResourcesClientBeginSQLContainerRetrieveThroughputDistributionOptions) (*http.Response, error) { - req, err := client.sqlContainerRetrieveThroughputDistributionCreateRequest(ctx, resourceGroupName, accountName, databaseName, containerName, retrieveThroughputParameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// sqlContainerRetrieveThroughputDistributionCreateRequest creates the SQLContainerRetrieveThroughputDistribution request. -func (client *SQLResourcesClient) sqlContainerRetrieveThroughputDistributionCreateRequest(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, retrieveThroughputParameters RetrieveThroughputParameters, options *SQLResourcesClientBeginSQLContainerRetrieveThroughputDistributionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/retrieveThroughputDistribution" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - if databaseName == "" { - return nil, errors.New("parameter databaseName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) - if containerName == "" { - return nil, errors.New("parameter containerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{containerName}", url.PathEscape(containerName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, retrieveThroughputParameters) -} - // BeginUpdateSQLContainerThroughput - Update RUs per second of an Azure Cosmos DB SQL container // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -2983,7 +2543,7 @@ func (client *SQLResourcesClient) BeginUpdateSQLContainerThroughput(ctx context. // UpdateSQLContainerThroughput - Update RUs per second of an Azure Cosmos DB SQL container // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *SQLResourcesClient) updateSQLContainerThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *SQLResourcesClientBeginUpdateSQLContainerThroughputOptions) (*http.Response, error) { req, err := client.updateSQLContainerThroughputCreateRequest(ctx, resourceGroupName, accountName, databaseName, containerName, updateThroughputParameters, options) if err != nil { @@ -3027,7 +2587,7 @@ func (client *SQLResourcesClient) updateSQLContainerThroughputCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, updateThroughputParameters) @@ -3035,7 +2595,7 @@ func (client *SQLResourcesClient) updateSQLContainerThroughputCreateRequest(ctx // BeginUpdateSQLDatabaseThroughput - Update RUs per second of an Azure Cosmos DB SQL database // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -3056,7 +2616,7 @@ func (client *SQLResourcesClient) BeginUpdateSQLDatabaseThroughput(ctx context.C // UpdateSQLDatabaseThroughput - Update RUs per second of an Azure Cosmos DB SQL database // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *SQLResourcesClient) updateSQLDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *SQLResourcesClientBeginUpdateSQLDatabaseThroughputOptions) (*http.Response, error) { req, err := client.updateSQLDatabaseThroughputCreateRequest(ctx, resourceGroupName, accountName, databaseName, updateThroughputParameters, options) if err != nil { @@ -3096,7 +2656,7 @@ func (client *SQLResourcesClient) updateSQLDatabaseThroughputCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, updateThroughputParameters) diff --git a/sdk/resourcemanager/cosmos/armcosmos/sqlresources_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/sqlresources_client_example_test.go deleted file mode 100644 index 66ac0367d8c5..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/sqlresources_client_example_test.go +++ /dev/null @@ -1,143 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBSqlClientEncryptionKeysList.json -func ExampleSQLResourcesClient_NewListClientEncryptionKeysPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewSQLResourcesClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListClientEncryptionKeysPager("rgName", - "accountName", - "databaseName", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBSqlClientEncryptionKeyGet.json -func ExampleSQLResourcesClient_GetClientEncryptionKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewSQLResourcesClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetClientEncryptionKey(ctx, - "rgName", - "accountName", - "databaseName", - "cekName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBSqlClientEncryptionKeyCreateUpdate.json -func ExampleSQLResourcesClient_BeginCreateUpdateClientEncryptionKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewSQLResourcesClient("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateUpdateClientEncryptionKey(ctx, - "rgName", - "accountName", - "databaseName", - "cekName", - armcosmos.ClientEncryptionKeyCreateUpdateParameters{ - Properties: &armcosmos.ClientEncryptionKeyCreateUpdateProperties{ - Resource: &armcosmos.ClientEncryptionKeyResource{ - EncryptionAlgorithm: to.Ptr("AEAD_AES_256_CBC_HMAC_SHA256"), - ID: to.Ptr("cekName"), - KeyWrapMetadata: &armcosmos.KeyWrapMetadata{ - Name: to.Ptr("customerManagedKey"), - Type: to.Ptr("AzureKeyVault"), - Algorithm: to.Ptr("RSA-OAEP"), - Value: to.Ptr("AzureKeyVault Key URL"), - }, - WrappedDataEncryptionKey: []byte("This is actually an array of bytes. This request/response is being presented as a string for readability in the example"), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBSqlContainerBackupInformation.json -func ExampleSQLResourcesClient_BeginRetrieveContinuousBackupInformation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewSQLResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRetrieveContinuousBackupInformation(ctx, - "rgName", - "ddb1", - "databaseName", - "containerName", - armcosmos.ContinuousBackupRestoreLocation{ - Location: to.Ptr("North Europe"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/cosmos/armcosmos/tableresources_client.go b/sdk/resourcemanager/cosmos/armcosmos/tableresources_client.go index c69b3eaec892..f2ed01c79c54 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/tableresources_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/tableresources_client.go @@ -57,7 +57,7 @@ func NewTableResourcesClient(subscriptionID string, credential azcore.TokenCrede // BeginCreateUpdateTable - Create or update an Azure Cosmos DB Table // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // tableName - Cosmos DB table name. @@ -78,7 +78,7 @@ func (client *TableResourcesClient) BeginCreateUpdateTable(ctx context.Context, // CreateUpdateTable - Create or update an Azure Cosmos DB Table // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *TableResourcesClient) createUpdateTable(ctx context.Context, resourceGroupName string, accountName string, tableName string, createUpdateTableParameters TableCreateUpdateParameters, options *TableResourcesClientBeginCreateUpdateTableOptions) (*http.Response, error) { req, err := client.createUpdateTableCreateRequest(ctx, resourceGroupName, accountName, tableName, createUpdateTableParameters, options) if err != nil { @@ -118,7 +118,7 @@ func (client *TableResourcesClient) createUpdateTableCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, createUpdateTableParameters) @@ -126,7 +126,7 @@ func (client *TableResourcesClient) createUpdateTableCreateRequest(ctx context.C // BeginDeleteTable - Deletes an existing Azure Cosmos DB Table. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // tableName - Cosmos DB table name. @@ -146,7 +146,7 @@ func (client *TableResourcesClient) BeginDeleteTable(ctx context.Context, resour // DeleteTable - Deletes an existing Azure Cosmos DB Table. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *TableResourcesClient) deleteTable(ctx context.Context, resourceGroupName string, accountName string, tableName string, options *TableResourcesClientBeginDeleteTableOptions) (*http.Response, error) { req, err := client.deleteTableCreateRequest(ctx, resourceGroupName, accountName, tableName, options) if err != nil { @@ -186,14 +186,14 @@ func (client *TableResourcesClient) deleteTableCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // GetTable - Gets the Tables under an existing Azure Cosmos DB database account with the provided name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // tableName - Cosmos DB table name. @@ -237,7 +237,7 @@ func (client *TableResourcesClient) getTableCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -255,7 +255,7 @@ func (client *TableResourcesClient) getTableHandleResponse(resp *http.Response) // GetTableThroughput - Gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided // name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // tableName - Cosmos DB table name. @@ -300,7 +300,7 @@ func (client *TableResourcesClient) getTableThroughputCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -317,7 +317,7 @@ func (client *TableResourcesClient) getTableThroughputHandleResponse(resp *http. // NewListTablesPager - Lists the Tables under an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // options - TableResourcesClientListTablesOptions contains the optional parameters for the TableResourcesClient.ListTables @@ -364,7 +364,7 @@ func (client *TableResourcesClient) listTablesCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -381,7 +381,7 @@ func (client *TableResourcesClient) listTablesHandleResponse(resp *http.Response // BeginMigrateTableToAutoscale - Migrate an Azure Cosmos DB Table from manual throughput to autoscale // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // tableName - Cosmos DB table name. @@ -401,7 +401,7 @@ func (client *TableResourcesClient) BeginMigrateTableToAutoscale(ctx context.Con // MigrateTableToAutoscale - Migrate an Azure Cosmos DB Table from manual throughput to autoscale // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *TableResourcesClient) migrateTableToAutoscale(ctx context.Context, resourceGroupName string, accountName string, tableName string, options *TableResourcesClientBeginMigrateTableToAutoscaleOptions) (*http.Response, error) { req, err := client.migrateTableToAutoscaleCreateRequest(ctx, resourceGroupName, accountName, tableName, options) if err != nil { @@ -441,7 +441,7 @@ func (client *TableResourcesClient) migrateTableToAutoscaleCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -449,7 +449,7 @@ func (client *TableResourcesClient) migrateTableToAutoscaleCreateRequest(ctx con // BeginMigrateTableToManualThroughput - Migrate an Azure Cosmos DB Table from autoscale to manual throughput // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // tableName - Cosmos DB table name. @@ -469,7 +469,7 @@ func (client *TableResourcesClient) BeginMigrateTableToManualThroughput(ctx cont // MigrateTableToManualThroughput - Migrate an Azure Cosmos DB Table from autoscale to manual throughput // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *TableResourcesClient) migrateTableToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, tableName string, options *TableResourcesClientBeginMigrateTableToManualThroughputOptions) (*http.Response, error) { req, err := client.migrateTableToManualThroughputCreateRequest(ctx, resourceGroupName, accountName, tableName, options) if err != nil { @@ -509,86 +509,15 @@ func (client *TableResourcesClient) migrateTableToManualThroughputCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// BeginRetrieveContinuousBackupInformation - Retrieves continuous backup information for a table. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// accountName - Cosmos DB database account name. -// tableName - Cosmos DB table name. -// location - The name of the continuous backup restore location. -// options - TableResourcesClientBeginRetrieveContinuousBackupInformationOptions contains the optional parameters for the -// TableResourcesClient.BeginRetrieveContinuousBackupInformation method. -func (client *TableResourcesClient) BeginRetrieveContinuousBackupInformation(ctx context.Context, resourceGroupName string, accountName string, tableName string, location ContinuousBackupRestoreLocation, options *TableResourcesClientBeginRetrieveContinuousBackupInformationOptions) (*runtime.Poller[TableResourcesClientRetrieveContinuousBackupInformationResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.retrieveContinuousBackupInformation(ctx, resourceGroupName, accountName, tableName, location, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[TableResourcesClientRetrieveContinuousBackupInformationResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[TableResourcesClientRetrieveContinuousBackupInformationResponse](options.ResumeToken, client.pl, nil) - } -} - -// RetrieveContinuousBackupInformation - Retrieves continuous backup information for a table. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview -func (client *TableResourcesClient) retrieveContinuousBackupInformation(ctx context.Context, resourceGroupName string, accountName string, tableName string, location ContinuousBackupRestoreLocation, options *TableResourcesClientBeginRetrieveContinuousBackupInformationOptions) (*http.Response, error) { - req, err := client.retrieveContinuousBackupInformationCreateRequest(ctx, resourceGroupName, accountName, tableName, location, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// retrieveContinuousBackupInformationCreateRequest creates the RetrieveContinuousBackupInformation request. -func (client *TableResourcesClient) retrieveContinuousBackupInformationCreateRequest(ctx context.Context, resourceGroupName string, accountName string, tableName string, location ContinuousBackupRestoreLocation, options *TableResourcesClientBeginRetrieveContinuousBackupInformationOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/retrieveContinuousBackupInformation" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - if tableName == "" { - return nil, errors.New("parameter tableName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{tableName}", url.PathEscape(tableName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, location) -} - // BeginUpdateTableThroughput - Update RUs per second of an Azure Cosmos DB Table // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // tableName - Cosmos DB table name. @@ -609,7 +538,7 @@ func (client *TableResourcesClient) BeginUpdateTableThroughput(ctx context.Conte // UpdateTableThroughput - Update RUs per second of an Azure Cosmos DB Table // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-15-preview +// Generated from API version 2022-08-15 func (client *TableResourcesClient) updateTableThroughput(ctx context.Context, resourceGroupName string, accountName string, tableName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *TableResourcesClientBeginUpdateTableThroughputOptions) (*http.Response, error) { req, err := client.updateTableThroughputCreateRequest(ctx, resourceGroupName, accountName, tableName, updateThroughputParameters, options) if err != nil { @@ -649,7 +578,7 @@ func (client *TableResourcesClient) updateTableThroughputCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-15-preview") + reqQP.Set("api-version", "2022-08-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, updateThroughputParameters) diff --git a/sdk/resourcemanager/cosmos/armcosmos/tableresources_client_example_test.go b/sdk/resourcemanager/cosmos/armcosmos/tableresources_client_example_test.go deleted file mode 100644 index 8f3ef0b52028..000000000000 --- a/sdk/resourcemanager/cosmos/armcosmos/tableresources_client_example_test.go +++ /dev/null @@ -1,272 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcosmos_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBTableList.json -func ExampleTableResourcesClient_NewListTablesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewTableResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListTablesPager("rgName", - "ddb1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBTableGet.json -func ExampleTableResourcesClient_GetTable() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewTableResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetTable(ctx, - "rg1", - "ddb1", - "tableName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBTableCreateUpdate.json -func ExampleTableResourcesClient_BeginCreateUpdateTable() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewTableResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateUpdateTable(ctx, - "rg1", - "ddb1", - "tableName", - armcosmos.TableCreateUpdateParameters{ - Location: to.Ptr("West US"), - Tags: map[string]*string{}, - Properties: &armcosmos.TableCreateUpdateProperties{ - Options: &armcosmos.CreateUpdateOptions{}, - Resource: &armcosmos.TableResource{ - ID: to.Ptr("tableName"), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBTableDelete.json -func ExampleTableResourcesClient_BeginDeleteTable() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewTableResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDeleteTable(ctx, - "rg1", - "ddb1", - "tableName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBTableThroughputGet.json -func ExampleTableResourcesClient_GetTableThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewTableResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetTableThroughput(ctx, - "rg1", - "ddb1", - "tableName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBTableThroughputUpdate.json -func ExampleTableResourcesClient_BeginUpdateTableThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewTableResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdateTableThroughput(ctx, - "rg1", - "ddb1", - "tableName", - armcosmos.ThroughputSettingsUpdateParameters{ - Location: to.Ptr("West US"), - Tags: map[string]*string{}, - Properties: &armcosmos.ThroughputSettingsUpdateProperties{ - Resource: &armcosmos.ThroughputSettingsResource{ - Throughput: to.Ptr[int32](400), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBTableMigrateToAutoscale.json -func ExampleTableResourcesClient_BeginMigrateTableToAutoscale() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewTableResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginMigrateTableToAutoscale(ctx, - "rg1", - "ddb1", - "tableName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBTableMigrateToManualThroughput.json -func ExampleTableResourcesClient_BeginMigrateTableToManualThroughput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewTableResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginMigrateTableToManualThroughput(ctx, - "rg1", - "ddb1", - "tableName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-05-15-preview/examples/CosmosDBTableBackupInformation.json -func ExampleTableResourcesClient_BeginRetrieveContinuousBackupInformation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcosmos.NewTableResourcesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRetrieveContinuousBackupInformation(ctx, - "rgName", - "ddb1", - "tableName1", - armcosmos.ContinuousBackupRestoreLocation{ - Location: to.Ptr("North Europe"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -}